175 lines
6.7 KiB
Go
175 lines
6.7 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)
|
||
}
|
||
|
||
// ListCategory 建立 product 分類
|
||
func (s *ProductServer) ListCategory(ctx context.Context, in *product.ListCategoryReq) (*product.ListCategoryResp, error) {
|
||
l := productlogic.NewListCategoryLogic(ctx, s.svcCtx)
|
||
return l.ListCategory(in)
|
||
}
|
||
|
||
// ====================== 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)
|
||
}
|
||
|
||
// ====================== Tags Service End ======================
|
||
func (s *ProductServer) CreateKYC(ctx context.Context, in *product.CreateKYCReq) (*product.OKResp, error) {
|
||
l := productlogic.NewCreateKYCLogic(ctx, s.svcCtx)
|
||
return l.CreateKYC(in)
|
||
}
|
||
|
||
// FindLatestKYCByUID 根據使用者 UID 查詢最新 KYC 紀錄
|
||
func (s *ProductServer) FindLatestKYCByUID(ctx context.Context, in *product.FindLatestKYCByUIDReq) (*product.KYC, error) {
|
||
l := productlogic.NewFindLatestKYCByUIDLogic(ctx, s.svcCtx)
|
||
return l.FindLatestKYCByUID(in)
|
||
}
|
||
|
||
// FindKYCByID 根據 KYC ID 查詢
|
||
func (s *ProductServer) FindKYCByID(ctx context.Context, in *product.FindKYCByIDReq) (*product.KYC, error) {
|
||
l := productlogic.NewFindKYCByIDLogic(ctx, s.svcCtx)
|
||
return l.FindKYCByID(in)
|
||
}
|
||
|
||
// ListKYC 分頁查詢 KYC 清單(後台審核用)
|
||
func (s *ProductServer) ListKYC(ctx context.Context, in *product.ListKYCReq) (*product.ListKYCResp, error) {
|
||
l := productlogic.NewListKYCLogic(ctx, s.svcCtx)
|
||
return l.ListKYC(in)
|
||
}
|
||
|
||
// UpdateKYCStatus 更新 KYC 審核狀態與原因
|
||
func (s *ProductServer) UpdateKYCStatus(ctx context.Context, in *product.UpdateKYCStatusReq) (*product.OKResp, error) {
|
||
l := productlogic.NewUpdateKYCStatusLogic(ctx, s.svcCtx)
|
||
return l.UpdateKYCStatus(in)
|
||
}
|
||
|
||
// UpdateKYCInfo 更新使用者的 KYC(尚未審核)
|
||
func (s *ProductServer) UpdateKYCInfo(ctx context.Context, in *product.UpdateKYCInfoReq) (*product.OKResp, error) {
|
||
l := productlogic.NewUpdateKYCInfoLogic(ctx, s.svcCtx)
|
||
return l.UpdateKYCInfo(in)
|
||
}
|
||
|
||
// ====================== Know You Customer Service End ======================
|
||
func (s *ProductServer) CreateItem(ctx context.Context, in *product.CreateProductItemRequest) (*product.OKResp, error) {
|
||
l := productlogic.NewCreateItemLogic(ctx, s.svcCtx)
|
||
return l.CreateItem(in)
|
||
}
|
||
|
||
// GetProductItem 取得 ProductItem
|
||
func (s *ProductServer) GetProductItem(ctx context.Context, in *product.GetProductItemRequest) (*product.ProductItem, error) {
|
||
l := productlogic.NewGetProductItemLogic(ctx, s.svcCtx)
|
||
return l.GetProductItem(in)
|
||
}
|
||
|
||
// GetProductItemsByProductID 使用 ProductID 取得 ProductItems
|
||
func (s *ProductServer) GetProductItemsByProductID(ctx context.Context, in *product.ListProductItemRequest) (*product.ListProductItemResponse, error) {
|
||
l := productlogic.NewGetProductItemsByProductIDLogic(ctx, s.svcCtx)
|
||
return l.GetProductItemsByProductID(in)
|
||
}
|
||
|
||
// DeleteProductItems 刪除 Delete Product Item
|
||
func (s *ProductServer) DeleteProductItems(ctx context.Context, in *product.DeleteProductItemRequest) (*product.OKResp, error) {
|
||
l := productlogic.NewDeleteProductItemsLogic(ctx, s.svcCtx)
|
||
return l.DeleteProductItems(in)
|
||
}
|
||
|
||
// DeleteProductItemsByReferenceID 使用 ProductID 刪除所有 Item
|
||
func (s *ProductServer) DeleteProductItemsByReferenceID(ctx context.Context, in *product.DeleteProductItemsByReferenceIDReq) (*product.OKResp, error) {
|
||
l := productlogic.NewDeleteProductItemsByReferenceIDLogic(ctx, s.svcCtx)
|
||
return l.DeleteProductItemsByReferenceID(in)
|
||
}
|
||
|
||
// IncSalesCount 增加賣出數量
|
||
func (s *ProductServer) IncSalesCount(ctx context.Context, in *product.IncDecSalesCountRequest) (*product.OKResp, error) {
|
||
l := productlogic.NewIncSalesCountLogic(ctx, s.svcCtx)
|
||
return l.IncSalesCount(in)
|
||
}
|
||
|
||
// DecSalesCount 減少賣出數量
|
||
func (s *ProductServer) DecSalesCount(ctx context.Context, in *product.IncDecSalesCountRequest) (*product.OKResp, error) {
|
||
l := productlogic.NewDecSalesCountLogic(ctx, s.svcCtx)
|
||
return l.DecSalesCount(in)
|
||
}
|
||
|
||
// Update 更新 Item
|
||
func (s *ProductServer) Update(ctx context.Context, in *product.UpdateProductItemRequest) (*product.OKResp, error) {
|
||
l := productlogic.NewUpdateLogic(ctx, s.svcCtx)
|
||
return l.Update(in)
|
||
}
|
||
|
||
// UpdateStatus 更新 Item status
|
||
func (s *ProductServer) UpdateStatus(ctx context.Context, in *product.UpdateStatusRequest) (*product.OKResp, error) {
|
||
l := productlogic.NewUpdateStatusLogic(ctx, s.svcCtx)
|
||
return l.UpdateStatus(in)
|
||
}
|