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

79 lines
2.8 KiB
Go

// Code generated by goctl. DO NOT EDIT.
// goctl 1.8.1
// Source: product.proto
package product
import (
"context"
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
"github.com/zeromicro/go-zero/zrpc"
"google.golang.org/grpc"
)
type (
Category = product.Category
CategoryReq = product.CategoryReq
CreateCategoryReq = product.CreateCategoryReq
ListCategoryReq = product.ListCategoryReq
ListCategoryResp = product.ListCategoryResp
ModifyCategoryReq = product.ModifyCategoryReq
NoneReq = product.NoneReq
OKResp = product.OKResp
Product interface {
// ====================== Category Service Start ======================
CreateCategory(ctx context.Context, in *CreateCategoryReq, opts ...grpc.CallOption) (*OKResp, error)
// 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)
}
defaultProduct struct {
cli zrpc.Client
}
)
func NewProduct(cli zrpc.Client) Product {
return &defaultProduct{
cli: cli,
}
}
// ====================== Category Service Start ======================
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...)
}
// 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...)
}