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 02:06:40 +00:00
|
|
|
ListCategoryReq = product.ListCategoryReq
|
|
|
|
ListCategoryResp = product.ListCategoryResp
|
|
|
|
ModifyCategoryReq = product.ModifyCategoryReq
|
2025-04-08 00:51:58 +00:00
|
|
|
NoneReq = product.NoneReq
|
|
|
|
OKResp = product.OKResp
|
|
|
|
|
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)
|
|
|
|
// CreateCategory 建立 product 分類
|
|
|
|
ListCategory(ctx context.Context, in *ListCategoryReq, opts ...grpc.CallOption) (*ListCategoryResp, 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...)
|
|
|
|
}
|
|
|
|
|
|
|
|
// CreateCategory 建立 product 分類
|
|
|
|
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...)
|
|
|
|
}
|