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-09 09:29:56 +00:00
|
|
|
|
Category = product.Category
|
|
|
|
|
CategoryReq = product.CategoryReq
|
|
|
|
|
CreateCategoryReq = product.CreateCategoryReq
|
|
|
|
|
CreateKYCReq = product.CreateKYCReq
|
|
|
|
|
CreateProductItemRequest = product.CreateProductItemRequest
|
|
|
|
|
CreateTagsReq = product.CreateTagsReq
|
|
|
|
|
CustomField = product.CustomField
|
|
|
|
|
DeleteProductItemRequest = product.DeleteProductItemRequest
|
|
|
|
|
DeleteProductItemsByReferenceIDReq = product.DeleteProductItemsByReferenceIDReq
|
|
|
|
|
FindKYCByIDReq = product.FindKYCByIDReq
|
|
|
|
|
FindLatestKYCByUIDReq = product.FindLatestKYCByUIDReq
|
|
|
|
|
GetProductItemRequest = product.GetProductItemRequest
|
|
|
|
|
IncDecSalesCountRequest = product.IncDecSalesCountRequest
|
|
|
|
|
KYC = product.KYC
|
|
|
|
|
ListCategoryReq = product.ListCategoryReq
|
|
|
|
|
ListCategoryResp = product.ListCategoryResp
|
|
|
|
|
ListKYCReq = product.ListKYCReq
|
|
|
|
|
ListKYCResp = product.ListKYCResp
|
|
|
|
|
ListProductItemRequest = product.ListProductItemRequest
|
|
|
|
|
ListProductItemResponse = product.ListProductItemResponse
|
|
|
|
|
ListTagsReq = product.ListTagsReq
|
|
|
|
|
ListTagsResp = product.ListTagsResp
|
|
|
|
|
Media = product.Media
|
|
|
|
|
ModifyCategoryReq = product.ModifyCategoryReq
|
|
|
|
|
ModifyTagsReq = product.ModifyTagsReq
|
|
|
|
|
NoneReq = product.NoneReq
|
|
|
|
|
OKResp = product.OKResp
|
|
|
|
|
ProductItem = product.ProductItem
|
|
|
|
|
Tags = product.Tags
|
|
|
|
|
TagsReq = product.TagsReq
|
|
|
|
|
UpdateKYCInfoReq = product.UpdateKYCInfoReq
|
|
|
|
|
UpdateKYCStatusReq = product.UpdateKYCStatusReq
|
|
|
|
|
UpdateProductItemRequest = product.UpdateProductItemRequest
|
|
|
|
|
UpdateStatusRequest = product.UpdateStatusRequest
|
2025-04-08 00:51:58 +00:00
|
|
|
|
|
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)
|
2025-04-08 03:49:07 +00:00
|
|
|
|
// ListCategory 建立 product 分類
|
2025-04-08 02:06:40 +00:00
|
|
|
|
ListCategory(ctx context.Context, in *ListCategoryReq, opts ...grpc.CallOption) (*ListCategoryResp, error)
|
2025-04-08 03:49:07 +00:00
|
|
|
|
// ====================== Category Service End ======================
|
|
|
|
|
CreateTags(ctx context.Context, in *CreateTagsReq, opts ...grpc.CallOption) (*OKResp, error)
|
|
|
|
|
// ModifyTags 修改 tags
|
|
|
|
|
ModifyTags(ctx context.Context, in *ModifyTagsReq, opts ...grpc.CallOption) (*OKResp, error)
|
|
|
|
|
// DeleteTags 刪除tags
|
|
|
|
|
DeleteTags(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*OKResp, error)
|
|
|
|
|
// GetTags 取得 tags
|
|
|
|
|
GetTags(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*Tags, error)
|
|
|
|
|
// ListTags 建立 tags
|
|
|
|
|
ListTags(ctx context.Context, in *ListTagsReq, opts ...grpc.CallOption) (*ListTagsResp, error)
|
2025-04-08 09:20:34 +00:00
|
|
|
|
// ====================== Tags Service End ======================
|
|
|
|
|
CreateKYC(ctx context.Context, in *CreateKYCReq, opts ...grpc.CallOption) (*OKResp, error)
|
|
|
|
|
// FindLatestKYCByUID 根據使用者 UID 查詢最新 KYC 紀錄
|
|
|
|
|
FindLatestKYCByUID(ctx context.Context, in *FindLatestKYCByUIDReq, opts ...grpc.CallOption) (*KYC, error)
|
|
|
|
|
// FindKYCByID 根據 KYC ID 查詢
|
|
|
|
|
FindKYCByID(ctx context.Context, in *FindKYCByIDReq, opts ...grpc.CallOption) (*KYC, error)
|
|
|
|
|
// ListKYC 分頁查詢 KYC 清單(後台審核用)
|
|
|
|
|
ListKYC(ctx context.Context, in *ListKYCReq, opts ...grpc.CallOption) (*ListKYCResp, error)
|
|
|
|
|
// UpdateKYCStatus 更新 KYC 審核狀態與原因
|
|
|
|
|
UpdateKYCStatus(ctx context.Context, in *UpdateKYCStatusReq, opts ...grpc.CallOption) (*OKResp, error)
|
|
|
|
|
// UpdateKYCInfo 更新使用者的 KYC(尚未審核)
|
|
|
|
|
UpdateKYCInfo(ctx context.Context, in *UpdateKYCInfoReq, opts ...grpc.CallOption) (*OKResp, error)
|
2025-04-09 09:29:56 +00:00
|
|
|
|
// ====================== Know You Customer Service End ======================
|
|
|
|
|
CreateItem(ctx context.Context, in *CreateProductItemRequest, opts ...grpc.CallOption) (*OKResp, error)
|
|
|
|
|
// GetProductItem 取得 ProductItem
|
|
|
|
|
GetProductItem(ctx context.Context, in *GetProductItemRequest, opts ...grpc.CallOption) (*ProductItem, error)
|
|
|
|
|
// GetProductItemsByProductID 使用 ProductID 取得 ProductItems
|
|
|
|
|
GetProductItemsByProductID(ctx context.Context, in *ListProductItemRequest, opts ...grpc.CallOption) (*ListProductItemResponse, error)
|
|
|
|
|
// DeleteProductItems 刪除 Delete Product Item
|
|
|
|
|
DeleteProductItems(ctx context.Context, in *DeleteProductItemRequest, opts ...grpc.CallOption) (*OKResp, error)
|
|
|
|
|
// DeleteProductItemsByReferenceID 使用 ProductID 刪除所有 Item
|
|
|
|
|
DeleteProductItemsByReferenceID(ctx context.Context, in *DeleteProductItemsByReferenceIDReq, opts ...grpc.CallOption) (*OKResp, error)
|
|
|
|
|
// IncSalesCount 增加賣出數量
|
|
|
|
|
IncSalesCount(ctx context.Context, in *IncDecSalesCountRequest, opts ...grpc.CallOption) (*OKResp, error)
|
|
|
|
|
// DecSalesCount 減少賣出數量
|
|
|
|
|
DecSalesCount(ctx context.Context, in *IncDecSalesCountRequest, opts ...grpc.CallOption) (*OKResp, error)
|
|
|
|
|
// Update 更新 Item
|
|
|
|
|
Update(ctx context.Context, in *UpdateProductItemRequest, opts ...grpc.CallOption) (*OKResp, error)
|
|
|
|
|
// UpdateStatus 更新 Item status
|
|
|
|
|
UpdateStatus(ctx context.Context, in *UpdateStatusRequest, opts ...grpc.CallOption) (*OKResp, 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...)
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-08 03:49:07 +00:00
|
|
|
|
// ListCategory 建立 product 分類
|
2025-04-08 02:06:40 +00:00
|
|
|
|
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...)
|
|
|
|
|
}
|
2025-04-08 03:49:07 +00:00
|
|
|
|
|
|
|
|
|
// ====================== Category Service End ======================
|
|
|
|
|
func (m *defaultProduct) CreateTags(ctx context.Context, in *CreateTagsReq, opts ...grpc.CallOption) (*OKResp, error) {
|
|
|
|
|
client := product.NewProductClient(m.cli.Conn())
|
|
|
|
|
return client.CreateTags(ctx, in, opts...)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ModifyTags 修改 tags
|
|
|
|
|
func (m *defaultProduct) ModifyTags(ctx context.Context, in *ModifyTagsReq, opts ...grpc.CallOption) (*OKResp, error) {
|
|
|
|
|
client := product.NewProductClient(m.cli.Conn())
|
|
|
|
|
return client.ModifyTags(ctx, in, opts...)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DeleteTags 刪除tags
|
|
|
|
|
func (m *defaultProduct) DeleteTags(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*OKResp, error) {
|
|
|
|
|
client := product.NewProductClient(m.cli.Conn())
|
|
|
|
|
return client.DeleteTags(ctx, in, opts...)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetTags 取得 tags
|
|
|
|
|
func (m *defaultProduct) GetTags(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*Tags, error) {
|
|
|
|
|
client := product.NewProductClient(m.cli.Conn())
|
|
|
|
|
return client.GetTags(ctx, in, opts...)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ListTags 建立 tags
|
|
|
|
|
func (m *defaultProduct) ListTags(ctx context.Context, in *ListTagsReq, opts ...grpc.CallOption) (*ListTagsResp, error) {
|
|
|
|
|
client := product.NewProductClient(m.cli.Conn())
|
|
|
|
|
return client.ListTags(ctx, in, opts...)
|
|
|
|
|
}
|
2025-04-08 09:20:34 +00:00
|
|
|
|
|
|
|
|
|
// ====================== Tags Service End ======================
|
|
|
|
|
func (m *defaultProduct) CreateKYC(ctx context.Context, in *CreateKYCReq, opts ...grpc.CallOption) (*OKResp, error) {
|
|
|
|
|
client := product.NewProductClient(m.cli.Conn())
|
|
|
|
|
return client.CreateKYC(ctx, in, opts...)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// FindLatestKYCByUID 根據使用者 UID 查詢最新 KYC 紀錄
|
|
|
|
|
func (m *defaultProduct) FindLatestKYCByUID(ctx context.Context, in *FindLatestKYCByUIDReq, opts ...grpc.CallOption) (*KYC, error) {
|
|
|
|
|
client := product.NewProductClient(m.cli.Conn())
|
|
|
|
|
return client.FindLatestKYCByUID(ctx, in, opts...)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// FindKYCByID 根據 KYC ID 查詢
|
|
|
|
|
func (m *defaultProduct) FindKYCByID(ctx context.Context, in *FindKYCByIDReq, opts ...grpc.CallOption) (*KYC, error) {
|
|
|
|
|
client := product.NewProductClient(m.cli.Conn())
|
|
|
|
|
return client.FindKYCByID(ctx, in, opts...)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ListKYC 分頁查詢 KYC 清單(後台審核用)
|
|
|
|
|
func (m *defaultProduct) ListKYC(ctx context.Context, in *ListKYCReq, opts ...grpc.CallOption) (*ListKYCResp, error) {
|
|
|
|
|
client := product.NewProductClient(m.cli.Conn())
|
|
|
|
|
return client.ListKYC(ctx, in, opts...)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UpdateKYCStatus 更新 KYC 審核狀態與原因
|
|
|
|
|
func (m *defaultProduct) UpdateKYCStatus(ctx context.Context, in *UpdateKYCStatusReq, opts ...grpc.CallOption) (*OKResp, error) {
|
|
|
|
|
client := product.NewProductClient(m.cli.Conn())
|
|
|
|
|
return client.UpdateKYCStatus(ctx, in, opts...)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UpdateKYCInfo 更新使用者的 KYC(尚未審核)
|
|
|
|
|
func (m *defaultProduct) UpdateKYCInfo(ctx context.Context, in *UpdateKYCInfoReq, opts ...grpc.CallOption) (*OKResp, error) {
|
|
|
|
|
client := product.NewProductClient(m.cli.Conn())
|
|
|
|
|
return client.UpdateKYCInfo(ctx, in, opts...)
|
|
|
|
|
}
|
2025-04-09 09:29:56 +00:00
|
|
|
|
|
|
|
|
|
// ====================== Know You Customer Service End ======================
|
|
|
|
|
func (m *defaultProduct) CreateItem(ctx context.Context, in *CreateProductItemRequest, opts ...grpc.CallOption) (*OKResp, error) {
|
|
|
|
|
client := product.NewProductClient(m.cli.Conn())
|
|
|
|
|
return client.CreateItem(ctx, in, opts...)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetProductItem 取得 ProductItem
|
|
|
|
|
func (m *defaultProduct) GetProductItem(ctx context.Context, in *GetProductItemRequest, opts ...grpc.CallOption) (*ProductItem, error) {
|
|
|
|
|
client := product.NewProductClient(m.cli.Conn())
|
|
|
|
|
return client.GetProductItem(ctx, in, opts...)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetProductItemsByProductID 使用 ProductID 取得 ProductItems
|
|
|
|
|
func (m *defaultProduct) GetProductItemsByProductID(ctx context.Context, in *ListProductItemRequest, opts ...grpc.CallOption) (*ListProductItemResponse, error) {
|
|
|
|
|
client := product.NewProductClient(m.cli.Conn())
|
|
|
|
|
return client.GetProductItemsByProductID(ctx, in, opts...)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DeleteProductItems 刪除 Delete Product Item
|
|
|
|
|
func (m *defaultProduct) DeleteProductItems(ctx context.Context, in *DeleteProductItemRequest, opts ...grpc.CallOption) (*OKResp, error) {
|
|
|
|
|
client := product.NewProductClient(m.cli.Conn())
|
|
|
|
|
return client.DeleteProductItems(ctx, in, opts...)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DeleteProductItemsByReferenceID 使用 ProductID 刪除所有 Item
|
|
|
|
|
func (m *defaultProduct) DeleteProductItemsByReferenceID(ctx context.Context, in *DeleteProductItemsByReferenceIDReq, opts ...grpc.CallOption) (*OKResp, error) {
|
|
|
|
|
client := product.NewProductClient(m.cli.Conn())
|
|
|
|
|
return client.DeleteProductItemsByReferenceID(ctx, in, opts...)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// IncSalesCount 增加賣出數量
|
|
|
|
|
func (m *defaultProduct) IncSalesCount(ctx context.Context, in *IncDecSalesCountRequest, opts ...grpc.CallOption) (*OKResp, error) {
|
|
|
|
|
client := product.NewProductClient(m.cli.Conn())
|
|
|
|
|
return client.IncSalesCount(ctx, in, opts...)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DecSalesCount 減少賣出數量
|
|
|
|
|
func (m *defaultProduct) DecSalesCount(ctx context.Context, in *IncDecSalesCountRequest, opts ...grpc.CallOption) (*OKResp, error) {
|
|
|
|
|
client := product.NewProductClient(m.cli.Conn())
|
|
|
|
|
return client.DecSalesCount(ctx, in, opts...)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update 更新 Item
|
|
|
|
|
func (m *defaultProduct) Update(ctx context.Context, in *UpdateProductItemRequest, opts ...grpc.CallOption) (*OKResp, error) {
|
|
|
|
|
client := product.NewProductClient(m.cli.Conn())
|
|
|
|
|
return client.Update(ctx, in, opts...)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UpdateStatus 更新 Item status
|
|
|
|
|
func (m *defaultProduct) UpdateStatus(ctx context.Context, in *UpdateStatusRequest, opts ...grpc.CallOption) (*OKResp, error) {
|
|
|
|
|
client := product.NewProductClient(m.cli.Conn())
|
|
|
|
|
return client.UpdateStatus(ctx, in, opts...)
|
|
|
|
|
}
|