app-cloudep-product-service/client/product/product.go

125 lines
4.9 KiB
Go
Raw Normal View History

2025-03-12 14:05:38 +00:00
// Code generated by goctl. DO NOT EDIT.
// goctl 1.8.1
// Source: product.proto
package product
import (
2025-04-08 00:51:58 +00:00
"context"
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
2025-03-12 14:05:38 +00:00
"github.com/zeromicro/go-zero/zrpc"
2025-04-08 00:51:58 +00:00
"google.golang.org/grpc"
2025-03-12 14:05:38 +00:00
)
type (
2025-04-08 02:06:40 +00:00
Category = product.Category
CategoryReq = product.CategoryReq
2025-04-08 00:51:58 +00:00
CreateCategoryReq = product.CreateCategoryReq
2025-04-08 03:49:07 +00:00
CreateTagsReq = product.CreateTagsReq
2025-04-08 02:06:40 +00:00
ListCategoryReq = product.ListCategoryReq
ListCategoryResp = product.ListCategoryResp
2025-04-08 03:49:07 +00:00
ListTagsReq = product.ListTagsReq
ListTagsResp = product.ListTagsResp
2025-04-08 02:06:40 +00:00
ModifyCategoryReq = product.ModifyCategoryReq
2025-04-08 03:49:07 +00:00
ModifyTagsReq = product.ModifyTagsReq
2025-04-08 00:51:58 +00:00
NoneReq = product.NoneReq
OKResp = product.OKResp
2025-04-08 03:49:07 +00:00
Tags = product.Tags
TagsReq = product.TagsReq
2025-04-08 00:51:58 +00:00
2025-03-12 14:05:38 +00:00
Product interface {
2025-04-08 02:06:40 +00:00
// ====================== Category Service Start ======================
2025-04-08 00:51:58 +00:00
CreateCategory(ctx context.Context, in *CreateCategoryReq, opts ...grpc.CallOption) (*OKResp, error)
2025-04-08 02:06:40 +00:00
// ModifyCategory 修改 product 分類名稱
ModifyCategory(ctx context.Context, in *ModifyCategoryReq, opts ...grpc.CallOption) (*OKResp, error)
// DeleteCategory 刪除 product 分類
DeleteCategory(ctx context.Context, in *CategoryReq, opts ...grpc.CallOption) (*OKResp, error)
// GetCategory 取得 product 分類
GetCategory(ctx context.Context, in *CategoryReq, opts ...grpc.CallOption) (*Category, error)
2025-04-08 03:49:07 +00:00
// ListCategory 建立 product 分類
2025-04-08 02:06:40 +00:00
ListCategory(ctx context.Context, in *ListCategoryReq, opts ...grpc.CallOption) (*ListCategoryResp, error)
2025-04-08 03:49:07 +00:00
// ====================== Category Service End ======================
CreateTags(ctx context.Context, in *CreateTagsReq, opts ...grpc.CallOption) (*OKResp, error)
// ModifyTags 修改 tags
ModifyTags(ctx context.Context, in *ModifyTagsReq, opts ...grpc.CallOption) (*OKResp, error)
// DeleteTags 刪除tags
DeleteTags(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*OKResp, error)
// GetTags 取得 tags
GetTags(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*Tags, error)
// ListTags 建立 tags
ListTags(ctx context.Context, in *ListTagsReq, opts ...grpc.CallOption) (*ListTagsResp, error)
2025-03-12 14:05:38 +00:00
}
defaultProduct struct {
cli zrpc.Client
}
)
func NewProduct(cli zrpc.Client) Product {
return &defaultProduct{
cli: cli,
}
}
2025-04-08 00:51:58 +00:00
2025-04-08 02:06:40 +00:00
// ====================== Category Service Start ======================
2025-04-08 00:51:58 +00:00
func (m *defaultProduct) CreateCategory(ctx context.Context, in *CreateCategoryReq, opts ...grpc.CallOption) (*OKResp, error) {
client := product.NewProductClient(m.cli.Conn())
return client.CreateCategory(ctx, in, opts...)
}
2025-04-08 02:06:40 +00:00
// ModifyCategory 修改 product 分類名稱
func (m *defaultProduct) ModifyCategory(ctx context.Context, in *ModifyCategoryReq, opts ...grpc.CallOption) (*OKResp, error) {
client := product.NewProductClient(m.cli.Conn())
return client.ModifyCategory(ctx, in, opts...)
}
// DeleteCategory 刪除 product 分類
func (m *defaultProduct) DeleteCategory(ctx context.Context, in *CategoryReq, opts ...grpc.CallOption) (*OKResp, error) {
client := product.NewProductClient(m.cli.Conn())
return client.DeleteCategory(ctx, in, opts...)
}
// GetCategory 取得 product 分類
func (m *defaultProduct) GetCategory(ctx context.Context, in *CategoryReq, opts ...grpc.CallOption) (*Category, error) {
client := product.NewProductClient(m.cli.Conn())
return client.GetCategory(ctx, in, opts...)
}
2025-04-08 03:49:07 +00:00
// ListCategory 建立 product 分類
2025-04-08 02:06:40 +00:00
func (m *defaultProduct) ListCategory(ctx context.Context, in *ListCategoryReq, opts ...grpc.CallOption) (*ListCategoryResp, error) {
client := product.NewProductClient(m.cli.Conn())
return client.ListCategory(ctx, in, opts...)
}
2025-04-08 03:49:07 +00:00
// ====================== Category Service End ======================
func (m *defaultProduct) CreateTags(ctx context.Context, in *CreateTagsReq, opts ...grpc.CallOption) (*OKResp, error) {
client := product.NewProductClient(m.cli.Conn())
return client.CreateTags(ctx, in, opts...)
}
// ModifyTags 修改 tags
func (m *defaultProduct) ModifyTags(ctx context.Context, in *ModifyTagsReq, opts ...grpc.CallOption) (*OKResp, error) {
client := product.NewProductClient(m.cli.Conn())
return client.ModifyTags(ctx, in, opts...)
}
// DeleteTags 刪除tags
func (m *defaultProduct) DeleteTags(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*OKResp, error) {
client := product.NewProductClient(m.cli.Conn())
return client.DeleteTags(ctx, in, opts...)
}
// GetTags 取得 tags
func (m *defaultProduct) GetTags(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*Tags, error) {
client := product.NewProductClient(m.cli.Conn())
return client.GetTags(ctx, in, opts...)
}
// ListTags 建立 tags
func (m *defaultProduct) ListTags(ctx context.Context, in *ListTagsReq, opts ...grpc.CallOption) (*ListTagsResp, error) {
client := product.NewProductClient(m.cli.Conn())
return client.ListTags(ctx, in, opts...)
}