55 lines
1.8 KiB
Go
55 lines
1.8 KiB
Go
// Code generated by goctl. DO NOT EDIT.
|
|
// goctl 1.8.1
|
|
// Source: product.proto
|
|
|
|
package server
|
|
|
|
import (
|
|
"context"
|
|
|
|
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
|
|
"code.30cm.net/digimon/app-cloudep-product-service/internal/logic/product"
|
|
"code.30cm.net/digimon/app-cloudep-product-service/internal/svc"
|
|
)
|
|
|
|
type ProductServer struct {
|
|
svcCtx *svc.ServiceContext
|
|
product.UnimplementedProductServer
|
|
}
|
|
|
|
func NewProductServer(svcCtx *svc.ServiceContext) *ProductServer {
|
|
return &ProductServer{
|
|
svcCtx: svcCtx,
|
|
}
|
|
}
|
|
|
|
// ====================== Category Service Start ======================
|
|
func (s *ProductServer) CreateCategory(ctx context.Context, in *product.CreateCategoryReq) (*product.OKResp, error) {
|
|
l := productlogic.NewCreateCategoryLogic(ctx, s.svcCtx)
|
|
return l.CreateCategory(in)
|
|
}
|
|
|
|
// ModifyCategory 修改 product 分類名稱
|
|
func (s *ProductServer) ModifyCategory(ctx context.Context, in *product.ModifyCategoryReq) (*product.OKResp, error) {
|
|
l := productlogic.NewModifyCategoryLogic(ctx, s.svcCtx)
|
|
return l.ModifyCategory(in)
|
|
}
|
|
|
|
// DeleteCategory 刪除 product 分類
|
|
func (s *ProductServer) DeleteCategory(ctx context.Context, in *product.CategoryReq) (*product.OKResp, error) {
|
|
l := productlogic.NewDeleteCategoryLogic(ctx, s.svcCtx)
|
|
return l.DeleteCategory(in)
|
|
}
|
|
|
|
// GetCategory 取得 product 分類
|
|
func (s *ProductServer) GetCategory(ctx context.Context, in *product.CategoryReq) (*product.Category, error) {
|
|
l := productlogic.NewGetCategoryLogic(ctx, s.svcCtx)
|
|
return l.GetCategory(in)
|
|
}
|
|
|
|
// CreateCategory 建立 product 分類
|
|
func (s *ProductServer) ListCategory(ctx context.Context, in *product.ListCategoryReq) (*product.ListCategoryResp, error) {
|
|
l := productlogic.NewListCategoryLogic(ctx, s.svcCtx)
|
|
return l.ListCategory(in)
|
|
}
|