2025-03-12 14:05:38 +00:00
|
|
|
// Code generated by goctl. DO NOT EDIT.
|
|
|
|
// goctl 1.8.1
|
|
|
|
// Source: product.proto
|
|
|
|
|
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
2025-04-08 00:51:58 +00:00
|
|
|
"context"
|
|
|
|
|
2025-03-12 14:05:38 +00:00
|
|
|
"code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product"
|
2025-04-08 00:51:58 +00:00
|
|
|
"code.30cm.net/digimon/app-cloudep-product-service/internal/logic/product"
|
2025-03-12 14:05:38 +00:00
|
|
|
"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,
|
|
|
|
}
|
|
|
|
}
|
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 (s *ProductServer) CreateCategory(ctx context.Context, in *product.CreateCategoryReq) (*product.OKResp, error) {
|
|
|
|
l := productlogic.NewCreateCategoryLogic(ctx, s.svcCtx)
|
|
|
|
return l.CreateCategory(in)
|
|
|
|
}
|
2025-04-08 02:06:40 +00:00
|
|
|
|
|
|
|
// 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)
|
|
|
|
}
|
|
|
|
|
2025-04-08 03:49:07 +00:00
|
|
|
// ListCategory 建立 product 分類
|
2025-04-08 02:06:40 +00:00
|
|
|
func (s *ProductServer) ListCategory(ctx context.Context, in *product.ListCategoryReq) (*product.ListCategoryResp, error) {
|
|
|
|
l := productlogic.NewListCategoryLogic(ctx, s.svcCtx)
|
|
|
|
return l.ListCategory(in)
|
|
|
|
}
|
2025-04-08 03:49:07 +00:00
|
|
|
|
|
|
|
// ====================== Category Service End ======================
|
|
|
|
func (s *ProductServer) CreateTags(ctx context.Context, in *product.CreateTagsReq) (*product.OKResp, error) {
|
|
|
|
l := productlogic.NewCreateTagsLogic(ctx, s.svcCtx)
|
|
|
|
return l.CreateTags(in)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ModifyTags 修改 tags
|
|
|
|
func (s *ProductServer) ModifyTags(ctx context.Context, in *product.ModifyTagsReq) (*product.OKResp, error) {
|
|
|
|
l := productlogic.NewModifyTagsLogic(ctx, s.svcCtx)
|
|
|
|
return l.ModifyTags(in)
|
|
|
|
}
|
|
|
|
|
|
|
|
// DeleteTags 刪除tags
|
|
|
|
func (s *ProductServer) DeleteTags(ctx context.Context, in *product.TagsReq) (*product.OKResp, error) {
|
|
|
|
l := productlogic.NewDeleteTagsLogic(ctx, s.svcCtx)
|
|
|
|
return l.DeleteTags(in)
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetTags 取得 tags
|
|
|
|
func (s *ProductServer) GetTags(ctx context.Context, in *product.TagsReq) (*product.Tags, error) {
|
|
|
|
l := productlogic.NewGetTagsLogic(ctx, s.svcCtx)
|
|
|
|
return l.GetTags(in)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ListTags 建立 tags
|
|
|
|
func (s *ProductServer) ListTags(ctx context.Context, in *product.ListTagsReq) (*product.ListTagsResp, error) {
|
|
|
|
l := productlogic.NewListTagsLogic(ctx, s.svcCtx)
|
|
|
|
return l.ListTags(in)
|
|
|
|
}
|