diff --git a/Makefile b/Makefile index b9fe018..1d02265 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ fmt: # 格式優化 .PHONY: gen-rpc gen-rpc: # 建立 rpc code - goctl rpc protoc ./generate/protobuf/product.proto -m --style=$(GO_ZERO_STYLE) --go_out=./gen_result/pb --go-grpc_out=./gen_result/pb --zrpc_out=. + goctl rpc protoc ./generate/protobuf/product.proto -m --style=$(GO_ZERO_STYLE) --go_out=./gen_result/pb --go-grpc_out=./gen_result/pb --zrpc_out=. -m go mod tidy @echo "Generate core-api files successfully" diff --git a/client/category_service/category_service.go b/client/category_service/category_service.go new file mode 100644 index 0000000..f5a7d42 --- /dev/null +++ b/client/category_service/category_service.go @@ -0,0 +1,104 @@ +// Code generated by goctl. DO NOT EDIT. +// goctl 1.8.1 +// Source: product.proto + +package category_service + +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 + 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 + + CategoryService interface { + // Create 建立 product 分類 + Create(ctx context.Context, in *CreateCategoryReq, opts ...grpc.CallOption) (*OKResp, error) + // Modify 修改 product 分類名稱 + Modify(ctx context.Context, in *ModifyCategoryReq, opts ...grpc.CallOption) (*OKResp, error) + // Delete 刪除 product 分類 + Delete(ctx context.Context, in *CategoryReq, opts ...grpc.CallOption) (*OKResp, error) + // Get 取得 product 分類 + Get(ctx context.Context, in *CategoryReq, opts ...grpc.CallOption) (*Category, error) + // List 建立 product 分類 + List(ctx context.Context, in *ListCategoryReq, opts ...grpc.CallOption) (*ListCategoryResp, error) + } + + defaultCategoryService struct { + cli zrpc.Client + } +) + +func NewCategoryService(cli zrpc.Client) CategoryService { + return &defaultCategoryService{ + cli: cli, + } +} + +// Create 建立 product 分類 +func (m *defaultCategoryService) Create(ctx context.Context, in *CreateCategoryReq, opts ...grpc.CallOption) (*OKResp, error) { + client := product.NewCategory_ServiceClient(m.cli.Conn()) + return client.Create(ctx, in, opts...) +} + +// Modify 修改 product 分類名稱 +func (m *defaultCategoryService) Modify(ctx context.Context, in *ModifyCategoryReq, opts ...grpc.CallOption) (*OKResp, error) { + client := product.NewCategory_ServiceClient(m.cli.Conn()) + return client.Modify(ctx, in, opts...) +} + +// Delete 刪除 product 分類 +func (m *defaultCategoryService) Delete(ctx context.Context, in *CategoryReq, opts ...grpc.CallOption) (*OKResp, error) { + client := product.NewCategory_ServiceClient(m.cli.Conn()) + return client.Delete(ctx, in, opts...) +} + +// Get 取得 product 分類 +func (m *defaultCategoryService) Get(ctx context.Context, in *CategoryReq, opts ...grpc.CallOption) (*Category, error) { + client := product.NewCategory_ServiceClient(m.cli.Conn()) + return client.Get(ctx, in, opts...) +} + +// List 建立 product 分類 +func (m *defaultCategoryService) List(ctx context.Context, in *ListCategoryReq, opts ...grpc.CallOption) (*ListCategoryResp, error) { + client := product.NewCategory_ServiceClient(m.cli.Conn()) + return client.List(ctx, in, opts...) +} diff --git a/client/kyc_service/kyc_service.go b/client/kyc_service/kyc_service.go new file mode 100644 index 0000000..76c3759 --- /dev/null +++ b/client/kyc_service/kyc_service.go @@ -0,0 +1,112 @@ +// Code generated by goctl. DO NOT EDIT. +// goctl 1.8.1 +// Source: product.proto + +package kyc_service + +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 + 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 + + KycService interface { + // Create 建立 KYC 資料 + Create(ctx context.Context, in *CreateKycReq, opts ...grpc.CallOption) (*OKResp, error) + // FindLatestByUID 根據使用者 UID 查詢最新 KYC 紀錄 + FindLatestByUid(ctx context.Context, in *FindLatestKycByUIDReq, opts ...grpc.CallOption) (*Kyc, error) + // FindByID 根據 KYC ID 查詢 + FindById(ctx context.Context, in *FindKycByIDReq, opts ...grpc.CallOption) (*Kyc, error) + // List 分頁查詢 Kyc 清單(後台審核用) + List(ctx context.Context, in *ListKycReq, opts ...grpc.CallOption) (*ListKycResp, error) + // UpdateStatus 更新 Kyc 審核狀態與原因 + UpdateStatus(ctx context.Context, in *UpdateKycStatusReq, opts ...grpc.CallOption) (*OKResp, error) + // Update 更新使用者的 Kyc(尚未審核) + Update(ctx context.Context, in *UpdateKycInfoReq, opts ...grpc.CallOption) (*OKResp, error) + } + + defaultKycService struct { + cli zrpc.Client + } +) + +func NewKycService(cli zrpc.Client) KycService { + return &defaultKycService{ + cli: cli, + } +} + +// Create 建立 KYC 資料 +func (m *defaultKycService) Create(ctx context.Context, in *CreateKycReq, opts ...grpc.CallOption) (*OKResp, error) { + client := product.NewKyc_ServiceClient(m.cli.Conn()) + return client.Create(ctx, in, opts...) +} + +// FindLatestByUID 根據使用者 UID 查詢最新 KYC 紀錄 +func (m *defaultKycService) FindLatestByUid(ctx context.Context, in *FindLatestKycByUIDReq, opts ...grpc.CallOption) (*Kyc, error) { + client := product.NewKyc_ServiceClient(m.cli.Conn()) + return client.FindLatestByUid(ctx, in, opts...) +} + +// FindByID 根據 KYC ID 查詢 +func (m *defaultKycService) FindById(ctx context.Context, in *FindKycByIDReq, opts ...grpc.CallOption) (*Kyc, error) { + client := product.NewKyc_ServiceClient(m.cli.Conn()) + return client.FindById(ctx, in, opts...) +} + +// List 分頁查詢 Kyc 清單(後台審核用) +func (m *defaultKycService) List(ctx context.Context, in *ListKycReq, opts ...grpc.CallOption) (*ListKycResp, error) { + client := product.NewKyc_ServiceClient(m.cli.Conn()) + return client.List(ctx, in, opts...) +} + +// UpdateStatus 更新 Kyc 審核狀態與原因 +func (m *defaultKycService) UpdateStatus(ctx context.Context, in *UpdateKycStatusReq, opts ...grpc.CallOption) (*OKResp, error) { + client := product.NewKyc_ServiceClient(m.cli.Conn()) + return client.UpdateStatus(ctx, in, opts...) +} + +// Update 更新使用者的 Kyc(尚未審核) +func (m *defaultKycService) Update(ctx context.Context, in *UpdateKycInfoReq, opts ...grpc.CallOption) (*OKResp, error) { + client := product.NewKyc_ServiceClient(m.cli.Conn()) + return client.Update(ctx, in, opts...) +} diff --git a/client/product/product.go b/client/product/product.go deleted file mode 100644 index b6feda0..0000000 --- a/client/product/product.go +++ /dev/null @@ -1,264 +0,0 @@ -// 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 - 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 - - 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) - // ListCategory 建立 product 分類 - ListCategory(ctx context.Context, in *ListCategoryReq, opts ...grpc.CallOption) (*ListCategoryResp, error) - // ====================== 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) - // ====================== 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) - // ====================== 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) - } - - 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...) -} - -// ListCategory 建立 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...) -} - -// ====================== 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...) -} - -// ====================== 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...) -} - -// ====================== 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...) -} diff --git a/client/product_item_service/product_item_service.go b/client/product_item_service/product_item_service.go new file mode 100644 index 0000000..7e745f9 --- /dev/null +++ b/client/product_item_service/product_item_service.go @@ -0,0 +1,136 @@ +// Code generated by goctl. DO NOT EDIT. +// goctl 1.8.1 +// Source: product.proto + +package product_item_service + +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 + 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 + + ProductItemService interface { + // Create 建立 ProductItem + Create(ctx context.Context, in *CreateProductItemRequest, opts ...grpc.CallOption) (*OKResp, error) + // GetProductItem 取得 ProductItem + Get(ctx context.Context, in *GetProductItemRequest, opts ...grpc.CallOption) (*ProductItem, error) + // ListByProductId 使用 ProductID 取得 ProductItems + ListByProductId(ctx context.Context, in *ListProductItemRequest, opts ...grpc.CallOption) (*ListProductItemResponse, error) + // Delete 刪除 Delete Product Item + Delete(ctx context.Context, in *DeleteProductItemRequest, opts ...grpc.CallOption) (*OKResp, error) + // DeleteByReferenceId 使用 ProductID 刪除所有 Item + DeleteByReferenceId(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) + } + + defaultProductItemService struct { + cli zrpc.Client + } +) + +func NewProductItemService(cli zrpc.Client) ProductItemService { + return &defaultProductItemService{ + cli: cli, + } +} + +// Create 建立 ProductItem +func (m *defaultProductItemService) Create(ctx context.Context, in *CreateProductItemRequest, opts ...grpc.CallOption) (*OKResp, error) { + client := product.NewProduct_Item_ServiceClient(m.cli.Conn()) + return client.Create(ctx, in, opts...) +} + +// GetProductItem 取得 ProductItem +func (m *defaultProductItemService) Get(ctx context.Context, in *GetProductItemRequest, opts ...grpc.CallOption) (*ProductItem, error) { + client := product.NewProduct_Item_ServiceClient(m.cli.Conn()) + return client.Get(ctx, in, opts...) +} + +// ListByProductId 使用 ProductID 取得 ProductItems +func (m *defaultProductItemService) ListByProductId(ctx context.Context, in *ListProductItemRequest, opts ...grpc.CallOption) (*ListProductItemResponse, error) { + client := product.NewProduct_Item_ServiceClient(m.cli.Conn()) + return client.ListByProductId(ctx, in, opts...) +} + +// Delete 刪除 Delete Product Item +func (m *defaultProductItemService) Delete(ctx context.Context, in *DeleteProductItemRequest, opts ...grpc.CallOption) (*OKResp, error) { + client := product.NewProduct_Item_ServiceClient(m.cli.Conn()) + return client.Delete(ctx, in, opts...) +} + +// DeleteByReferenceId 使用 ProductID 刪除所有 Item +func (m *defaultProductItemService) DeleteByReferenceId(ctx context.Context, in *DeleteProductItemsByReferenceIDReq, opts ...grpc.CallOption) (*OKResp, error) { + client := product.NewProduct_Item_ServiceClient(m.cli.Conn()) + return client.DeleteByReferenceId(ctx, in, opts...) +} + +// IncSalesCount 增加賣出數量 +func (m *defaultProductItemService) IncSalesCount(ctx context.Context, in *IncDecSalesCountRequest, opts ...grpc.CallOption) (*OKResp, error) { + client := product.NewProduct_Item_ServiceClient(m.cli.Conn()) + return client.IncSalesCount(ctx, in, opts...) +} + +// DecSalesCount 減少賣出數量 +func (m *defaultProductItemService) DecSalesCount(ctx context.Context, in *IncDecSalesCountRequest, opts ...grpc.CallOption) (*OKResp, error) { + client := product.NewProduct_Item_ServiceClient(m.cli.Conn()) + return client.DecSalesCount(ctx, in, opts...) +} + +// Update 更新 Item +func (m *defaultProductItemService) Update(ctx context.Context, in *UpdateProductItemRequest, opts ...grpc.CallOption) (*OKResp, error) { + client := product.NewProduct_Item_ServiceClient(m.cli.Conn()) + return client.Update(ctx, in, opts...) +} + +// UpdateStatus 更新 Item status +func (m *defaultProductItemService) UpdateStatus(ctx context.Context, in *UpdateStatusRequest, opts ...grpc.CallOption) (*OKResp, error) { + client := product.NewProduct_Item_ServiceClient(m.cli.Conn()) + return client.UpdateStatus(ctx, in, opts...) +} diff --git a/client/tag_service/tag_service.go b/client/tag_service/tag_service.go new file mode 100644 index 0000000..c8c379d --- /dev/null +++ b/client/tag_service/tag_service.go @@ -0,0 +1,104 @@ +// Code generated by goctl. DO NOT EDIT. +// goctl 1.8.1 +// Source: product.proto + +package tag_service + +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 + 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 + + TagService interface { + // CreateTags 建立 tags + Create(ctx context.Context, in *CreateTagsReq, opts ...grpc.CallOption) (*OKResp, error) + // ModifyTags 修改 tags + Modify(ctx context.Context, in *ModifyTagsReq, opts ...grpc.CallOption) (*OKResp, error) + // DeleteTags 刪除tags + Delete(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*OKResp, error) + // GetTags 取得 tags + Get(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*Tags, error) + // ListTags 建立 tags + List(ctx context.Context, in *ListTagsReq, opts ...grpc.CallOption) (*ListTagsResp, error) + } + + defaultTagService struct { + cli zrpc.Client + } +) + +func NewTagService(cli zrpc.Client) TagService { + return &defaultTagService{ + cli: cli, + } +} + +// CreateTags 建立 tags +func (m *defaultTagService) Create(ctx context.Context, in *CreateTagsReq, opts ...grpc.CallOption) (*OKResp, error) { + client := product.NewTag_ServiceClient(m.cli.Conn()) + return client.Create(ctx, in, opts...) +} + +// ModifyTags 修改 tags +func (m *defaultTagService) Modify(ctx context.Context, in *ModifyTagsReq, opts ...grpc.CallOption) (*OKResp, error) { + client := product.NewTag_ServiceClient(m.cli.Conn()) + return client.Modify(ctx, in, opts...) +} + +// DeleteTags 刪除tags +func (m *defaultTagService) Delete(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*OKResp, error) { + client := product.NewTag_ServiceClient(m.cli.Conn()) + return client.Delete(ctx, in, opts...) +} + +// GetTags 取得 tags +func (m *defaultTagService) Get(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*Tags, error) { + client := product.NewTag_ServiceClient(m.cli.Conn()) + return client.Get(ctx, in, opts...) +} + +// ListTags 建立 tags +func (m *defaultTagService) List(ctx context.Context, in *ListTagsReq, opts ...grpc.CallOption) (*ListTagsResp, error) { + client := product.NewTag_ServiceClient(m.cli.Conn()) + return client.List(ctx, in, opts...) +} diff --git a/gen_result/pb/product/product.pb.go b/gen_result/pb/product/product.pb.go index 6c3d1fc..3e4e9b9 100644 --- a/gen_result/pb/product/product.pb.go +++ b/gen_result/pb/product/product.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.5 +// protoc-gen-go v1.36.1 // protoc v3.19.4 // source: generate/protobuf/product.proto @@ -11,7 +11,6 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" - unsafe "unsafe" ) const ( @@ -95,7 +94,7 @@ func (*NoneReq) Descriptor() ([]byte, []int) { return file_generate_protobuf_product_proto_rawDescGZIP(), []int{1} } -// ====================== Category Param ====================== +// ====================== Category ====================== type CreateCategoryReq struct { state protoimpl.MessageState `protogen:"open.v1"` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` @@ -418,9 +417,9 @@ func (x *ListCategoryResp) GetData() []*Category { type CreateTagsReq struct { state protoimpl.MessageState `protogen:"open.v1"` - Types int32 `protobuf:"varint,1,opt,name=types,proto3" json:"types,omitempty"` + Types string `protobuf:"bytes,1,opt,name=types,proto3" json:"types,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - ShowType int64 `protobuf:"varint,3,opt,name=show_type,json=showType,proto3" json:"show_type,omitempty"` + ShowType string `protobuf:"bytes,3,opt,name=show_type,json=showType,proto3" json:"show_type,omitempty"` Cover *string `protobuf:"bytes,4,opt,name=cover,proto3,oneof" json:"cover,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -456,11 +455,11 @@ func (*CreateTagsReq) Descriptor() ([]byte, []int) { return file_generate_protobuf_product_proto_rawDescGZIP(), []int{8} } -func (x *CreateTagsReq) GetTypes() int32 { +func (x *CreateTagsReq) GetTypes() string { if x != nil { return x.Types } - return 0 + return "" } func (x *CreateTagsReq) GetName() string { @@ -470,11 +469,11 @@ func (x *CreateTagsReq) GetName() string { return "" } -func (x *CreateTagsReq) GetShowType() int64 { +func (x *CreateTagsReq) GetShowType() string { if x != nil { return x.ShowType } - return 0 + return "" } func (x *CreateTagsReq) GetCover() string { @@ -487,9 +486,9 @@ func (x *CreateTagsReq) GetCover() string { type ModifyTagsReq struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Types *int32 `protobuf:"varint,2,opt,name=types,proto3,oneof" json:"types,omitempty"` + Types *string `protobuf:"bytes,2,opt,name=types,proto3,oneof" json:"types,omitempty"` Name *string `protobuf:"bytes,3,opt,name=name,proto3,oneof" json:"name,omitempty"` - ShowType *int64 `protobuf:"varint,4,opt,name=show_type,json=showType,proto3,oneof" json:"show_type,omitempty"` + ShowType *string `protobuf:"bytes,4,opt,name=show_type,json=showType,proto3,oneof" json:"show_type,omitempty"` Cover *string `protobuf:"bytes,5,opt,name=cover,proto3,oneof" json:"cover,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -532,11 +531,11 @@ func (x *ModifyTagsReq) GetId() string { return "" } -func (x *ModifyTagsReq) GetTypes() int32 { +func (x *ModifyTagsReq) GetTypes() string { if x != nil && x.Types != nil { return *x.Types } - return 0 + return "" } func (x *ModifyTagsReq) GetName() string { @@ -546,11 +545,11 @@ func (x *ModifyTagsReq) GetName() string { return "" } -func (x *ModifyTagsReq) GetShowType() int64 { +func (x *ModifyTagsReq) GetShowType() string { if x != nil && x.ShowType != nil { return *x.ShowType } - return 0 + return "" } func (x *ModifyTagsReq) GetCover() string { @@ -607,9 +606,9 @@ func (x *TagsReq) GetId() string { type Tags struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Types int32 `protobuf:"varint,2,opt,name=types,proto3" json:"types,omitempty"` + Types string `protobuf:"bytes,2,opt,name=types,proto3" json:"types,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - ShowType int64 `protobuf:"varint,4,opt,name=show_type,json=showType,proto3" json:"show_type,omitempty"` + ShowType string `protobuf:"bytes,4,opt,name=show_type,json=showType,proto3" json:"show_type,omitempty"` Cover string `protobuf:"bytes,5,opt,name=cover,proto3" json:"cover,omitempty"` UpdateAt int64 `protobuf:"varint,6,opt,name=update_at,json=updateAt,proto3" json:"update_at,omitempty"` CreatedAt int64 `protobuf:"varint,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` @@ -654,11 +653,11 @@ func (x *Tags) GetId() string { return "" } -func (x *Tags) GetTypes() int32 { +func (x *Tags) GetTypes() string { if x != nil { return x.Types } - return 0 + return "" } func (x *Tags) GetName() string { @@ -668,11 +667,11 @@ func (x *Tags) GetName() string { return "" } -func (x *Tags) GetShowType() int64 { +func (x *Tags) GetShowType() string { if x != nil { return x.ShowType } - return 0 + return "" } func (x *Tags) GetCover() string { @@ -702,8 +701,8 @@ type ListTagsReq struct { PageSize int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` Ids []string `protobuf:"bytes,3,rep,name=ids,proto3" json:"ids,omitempty"` Name *string `protobuf:"bytes,4,opt,name=name,proto3,oneof" json:"name,omitempty"` - Types *int32 `protobuf:"varint,5,opt,name=types,proto3,oneof" json:"types,omitempty"` - ShowType *int64 `protobuf:"varint,6,opt,name=show_type,json=showType,proto3,oneof" json:"show_type,omitempty"` + Types *string `protobuf:"bytes,5,opt,name=types,proto3,oneof" json:"types,omitempty"` + ShowType *string `protobuf:"bytes,6,opt,name=show_type,json=showType,proto3,oneof" json:"show_type,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -766,18 +765,18 @@ func (x *ListTagsReq) GetName() string { return "" } -func (x *ListTagsReq) GetTypes() int32 { +func (x *ListTagsReq) GetTypes() string { if x != nil && x.Types != nil { return *x.Types } - return 0 + return "" } -func (x *ListTagsReq) GetShowType() int64 { +func (x *ListTagsReq) GetShowType() string { if x != nil && x.ShowType != nil { return *x.ShowType } - return 0 + return "" } type ListTagsResp struct { @@ -833,7 +832,7 @@ func (x *ListTagsResp) GetData() []*Tags { } // ====================== KYC Param ====================== -type KYC struct { +type Kyc struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // MongoDB ObjectID 字串格式 Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` // 驗證人 UID @@ -859,20 +858,20 @@ type KYC struct { sizeCache protoimpl.SizeCache } -func (x *KYC) Reset() { - *x = KYC{} +func (x *Kyc) Reset() { + *x = Kyc{} mi := &file_generate_protobuf_product_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *KYC) String() string { +func (x *Kyc) String() string { return protoimpl.X.MessageStringOf(x) } -func (*KYC) ProtoMessage() {} +func (*Kyc) ProtoMessage() {} -func (x *KYC) ProtoReflect() protoreflect.Message { +func (x *Kyc) ProtoReflect() protoreflect.Message { mi := &file_generate_protobuf_product_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -884,152 +883,152 @@ func (x *KYC) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use KYC.ProtoReflect.Descriptor instead. -func (*KYC) Descriptor() ([]byte, []int) { +// Deprecated: Use Kyc.ProtoReflect.Descriptor instead. +func (*Kyc) Descriptor() ([]byte, []int) { return file_generate_protobuf_product_proto_rawDescGZIP(), []int{14} } -func (x *KYC) GetId() string { +func (x *Kyc) GetId() string { if x != nil { return x.Id } return "" } -func (x *KYC) GetUid() string { +func (x *Kyc) GetUid() string { if x != nil { return x.Uid } return "" } -func (x *KYC) GetCountryRegion() string { +func (x *Kyc) GetCountryRegion() string { if x != nil { return x.CountryRegion } return "" } -func (x *KYC) GetName() string { +func (x *Kyc) GetName() string { if x != nil { return x.Name } return "" } -func (x *KYC) GetIdentification() string { +func (x *Kyc) GetIdentification() string { if x != nil { return x.Identification } return "" } -func (x *KYC) GetIdentificationType() string { +func (x *Kyc) GetIdentificationType() string { if x != nil { return x.IdentificationType } return "" } -func (x *KYC) GetAddress() string { +func (x *Kyc) GetAddress() string { if x != nil { return x.Address } return "" } -func (x *KYC) GetPostalCode() string { +func (x *Kyc) GetPostalCode() string { if x != nil { return x.PostalCode } return "" } -func (x *KYC) GetIdFrontImage() string { +func (x *Kyc) GetIdFrontImage() string { if x != nil { return x.IdFrontImage } return "" } -func (x *KYC) GetIdBackImage() string { +func (x *Kyc) GetIdBackImage() string { if x != nil { return x.IdBackImage } return "" } -func (x *KYC) GetBankStatementImg() string { +func (x *Kyc) GetBankStatementImg() string { if x != nil { return x.BankStatementImg } return "" } -func (x *KYC) GetBankCode() string { +func (x *Kyc) GetBankCode() string { if x != nil { return x.BankCode } return "" } -func (x *KYC) GetBankName() string { +func (x *Kyc) GetBankName() string { if x != nil { return x.BankName } return "" } -func (x *KYC) GetBranchCode() string { +func (x *Kyc) GetBranchCode() string { if x != nil { return x.BranchCode } return "" } -func (x *KYC) GetBranchName() string { +func (x *Kyc) GetBranchName() string { if x != nil { return x.BranchName } return "" } -func (x *KYC) GetBankAccount() string { +func (x *Kyc) GetBankAccount() string { if x != nil { return x.BankAccount } return "" } -func (x *KYC) GetStatus() string { +func (x *Kyc) GetStatus() string { if x != nil { return x.Status } return "" } -func (x *KYC) GetRejectReason() string { +func (x *Kyc) GetRejectReason() string { if x != nil { return x.RejectReason } return "" } -func (x *KYC) GetUpdatedAt() int64 { +func (x *Kyc) GetUpdatedAt() int64 { if x != nil { return x.UpdatedAt } return 0 } -func (x *KYC) GetCreatedAt() int64 { +func (x *Kyc) GetCreatedAt() int64 { if x != nil { return x.CreatedAt } return 0 } -type CreateKYCReq struct { +type CreateKycReq struct { state protoimpl.MessageState `protogen:"open.v1"` Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` CountryRegion string `protobuf:"bytes,2,opt,name=country_region,json=countryRegion,proto3" json:"country_region,omitempty"` @@ -1050,20 +1049,20 @@ type CreateKYCReq struct { sizeCache protoimpl.SizeCache } -func (x *CreateKYCReq) Reset() { - *x = CreateKYCReq{} +func (x *CreateKycReq) Reset() { + *x = CreateKycReq{} mi := &file_generate_protobuf_product_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *CreateKYCReq) String() string { +func (x *CreateKycReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateKYCReq) ProtoMessage() {} +func (*CreateKycReq) ProtoMessage() {} -func (x *CreateKYCReq) ProtoReflect() protoreflect.Message { +func (x *CreateKycReq) ProtoReflect() protoreflect.Message { mi := &file_generate_protobuf_product_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1075,137 +1074,137 @@ func (x *CreateKYCReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateKYCReq.ProtoReflect.Descriptor instead. -func (*CreateKYCReq) Descriptor() ([]byte, []int) { +// Deprecated: Use CreateKycReq.ProtoReflect.Descriptor instead. +func (*CreateKycReq) Descriptor() ([]byte, []int) { return file_generate_protobuf_product_proto_rawDescGZIP(), []int{15} } -func (x *CreateKYCReq) GetUid() string { +func (x *CreateKycReq) GetUid() string { if x != nil { return x.Uid } return "" } -func (x *CreateKYCReq) GetCountryRegion() string { +func (x *CreateKycReq) GetCountryRegion() string { if x != nil { return x.CountryRegion } return "" } -func (x *CreateKYCReq) GetName() string { +func (x *CreateKycReq) GetName() string { if x != nil { return x.Name } return "" } -func (x *CreateKYCReq) GetIdentification() string { +func (x *CreateKycReq) GetIdentification() string { if x != nil { return x.Identification } return "" } -func (x *CreateKYCReq) GetIdentificationType() string { +func (x *CreateKycReq) GetIdentificationType() string { if x != nil { return x.IdentificationType } return "" } -func (x *CreateKYCReq) GetAddress() string { +func (x *CreateKycReq) GetAddress() string { if x != nil { return x.Address } return "" } -func (x *CreateKYCReq) GetPostalCode() string { +func (x *CreateKycReq) GetPostalCode() string { if x != nil { return x.PostalCode } return "" } -func (x *CreateKYCReq) GetIdFrontImage() string { +func (x *CreateKycReq) GetIdFrontImage() string { if x != nil { return x.IdFrontImage } return "" } -func (x *CreateKYCReq) GetIdBackImage() string { +func (x *CreateKycReq) GetIdBackImage() string { if x != nil { return x.IdBackImage } return "" } -func (x *CreateKYCReq) GetBankStatementImg() string { +func (x *CreateKycReq) GetBankStatementImg() string { if x != nil { return x.BankStatementImg } return "" } -func (x *CreateKYCReq) GetBankCode() string { +func (x *CreateKycReq) GetBankCode() string { if x != nil { return x.BankCode } return "" } -func (x *CreateKYCReq) GetBankName() string { +func (x *CreateKycReq) GetBankName() string { if x != nil { return x.BankName } return "" } -func (x *CreateKYCReq) GetBranchCode() string { +func (x *CreateKycReq) GetBranchCode() string { if x != nil { return x.BranchCode } return "" } -func (x *CreateKYCReq) GetBranchName() string { +func (x *CreateKycReq) GetBranchName() string { if x != nil { return x.BranchName } return "" } -func (x *CreateKYCReq) GetBankAccount() string { +func (x *CreateKycReq) GetBankAccount() string { if x != nil { return x.BankAccount } return "" } -type FindLatestKYCByUIDReq struct { +type FindLatestKycByUIDReq struct { state protoimpl.MessageState `protogen:"open.v1"` Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *FindLatestKYCByUIDReq) Reset() { - *x = FindLatestKYCByUIDReq{} +func (x *FindLatestKycByUIDReq) Reset() { + *x = FindLatestKycByUIDReq{} mi := &file_generate_protobuf_product_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *FindLatestKYCByUIDReq) String() string { +func (x *FindLatestKycByUIDReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*FindLatestKYCByUIDReq) ProtoMessage() {} +func (*FindLatestKycByUIDReq) ProtoMessage() {} -func (x *FindLatestKYCByUIDReq) ProtoReflect() protoreflect.Message { +func (x *FindLatestKycByUIDReq) ProtoReflect() protoreflect.Message { mi := &file_generate_protobuf_product_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1217,39 +1216,39 @@ func (x *FindLatestKYCByUIDReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use FindLatestKYCByUIDReq.ProtoReflect.Descriptor instead. -func (*FindLatestKYCByUIDReq) Descriptor() ([]byte, []int) { +// Deprecated: Use FindLatestKycByUIDReq.ProtoReflect.Descriptor instead. +func (*FindLatestKycByUIDReq) Descriptor() ([]byte, []int) { return file_generate_protobuf_product_proto_rawDescGZIP(), []int{16} } -func (x *FindLatestKYCByUIDReq) GetUid() string { +func (x *FindLatestKycByUIDReq) GetUid() string { if x != nil { return x.Uid } return "" } -type FindKYCByIDReq struct { +type FindKycByIDReq struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *FindKYCByIDReq) Reset() { - *x = FindKYCByIDReq{} +func (x *FindKycByIDReq) Reset() { + *x = FindKycByIDReq{} mi := &file_generate_protobuf_product_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *FindKYCByIDReq) String() string { +func (x *FindKycByIDReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*FindKYCByIDReq) ProtoMessage() {} +func (*FindKycByIDReq) ProtoMessage() {} -func (x *FindKYCByIDReq) ProtoReflect() protoreflect.Message { +func (x *FindKycByIDReq) ProtoReflect() protoreflect.Message { mi := &file_generate_protobuf_product_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1261,19 +1260,19 @@ func (x *FindKYCByIDReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use FindKYCByIDReq.ProtoReflect.Descriptor instead. -func (*FindKYCByIDReq) Descriptor() ([]byte, []int) { +// Deprecated: Use FindKycByIDReq.ProtoReflect.Descriptor instead. +func (*FindKycByIDReq) Descriptor() ([]byte, []int) { return file_generate_protobuf_product_proto_rawDescGZIP(), []int{17} } -func (x *FindKYCByIDReq) GetId() string { +func (x *FindKycByIDReq) GetId() string { if x != nil { return x.Id } return "" } -type ListKYCReq struct { +type ListKycReq struct { state protoimpl.MessageState `protogen:"open.v1"` Uid *string `protobuf:"bytes,1,opt,name=uid,proto3,oneof" json:"uid,omitempty"` Country *string `protobuf:"bytes,2,opt,name=country,proto3,oneof" json:"country,omitempty"` @@ -1285,20 +1284,20 @@ type ListKYCReq struct { sizeCache protoimpl.SizeCache } -func (x *ListKYCReq) Reset() { - *x = ListKYCReq{} +func (x *ListKycReq) Reset() { + *x = ListKycReq{} mi := &file_generate_protobuf_product_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *ListKYCReq) String() string { +func (x *ListKycReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListKYCReq) ProtoMessage() {} +func (*ListKycReq) ProtoMessage() {} -func (x *ListKYCReq) ProtoReflect() protoreflect.Message { +func (x *ListKycReq) ProtoReflect() protoreflect.Message { mi := &file_generate_protobuf_product_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1310,75 +1309,75 @@ func (x *ListKYCReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListKYCReq.ProtoReflect.Descriptor instead. -func (*ListKYCReq) Descriptor() ([]byte, []int) { +// Deprecated: Use ListKycReq.ProtoReflect.Descriptor instead. +func (*ListKycReq) Descriptor() ([]byte, []int) { return file_generate_protobuf_product_proto_rawDescGZIP(), []int{18} } -func (x *ListKYCReq) GetUid() string { +func (x *ListKycReq) GetUid() string { if x != nil && x.Uid != nil { return *x.Uid } return "" } -func (x *ListKYCReq) GetCountry() string { +func (x *ListKycReq) GetCountry() string { if x != nil && x.Country != nil { return *x.Country } return "" } -func (x *ListKYCReq) GetStatus() string { +func (x *ListKycReq) GetStatus() string { if x != nil && x.Status != nil { return *x.Status } return "" } -func (x *ListKYCReq) GetPageSize() int64 { +func (x *ListKycReq) GetPageSize() int64 { if x != nil { return x.PageSize } return 0 } -func (x *ListKYCReq) GetPageIndex() int64 { +func (x *ListKycReq) GetPageIndex() int64 { if x != nil { return x.PageIndex } return 0 } -func (x *ListKYCReq) GetSortByDate() bool { +func (x *ListKycReq) GetSortByDate() bool { if x != nil { return x.SortByDate } return false } -type ListKYCResp struct { +type ListKycResp struct { state protoimpl.MessageState `protogen:"open.v1"` - List []*KYC `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + List []*Kyc `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *ListKYCResp) Reset() { - *x = ListKYCResp{} +func (x *ListKycResp) Reset() { + *x = ListKycResp{} mi := &file_generate_protobuf_product_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *ListKYCResp) String() string { +func (x *ListKycResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListKYCResp) ProtoMessage() {} +func (*ListKycResp) ProtoMessage() {} -func (x *ListKYCResp) ProtoReflect() protoreflect.Message { +func (x *ListKycResp) ProtoReflect() protoreflect.Message { mi := &file_generate_protobuf_product_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1390,26 +1389,26 @@ func (x *ListKYCResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListKYCResp.ProtoReflect.Descriptor instead. -func (*ListKYCResp) Descriptor() ([]byte, []int) { +// Deprecated: Use ListKycResp.ProtoReflect.Descriptor instead. +func (*ListKycResp) Descriptor() ([]byte, []int) { return file_generate_protobuf_product_proto_rawDescGZIP(), []int{19} } -func (x *ListKYCResp) GetList() []*KYC { +func (x *ListKycResp) GetList() []*Kyc { if x != nil { return x.List } return nil } -func (x *ListKYCResp) GetTotal() int64 { +func (x *ListKycResp) GetTotal() int64 { if x != nil { return x.Total } return 0 } -type UpdateKYCStatusReq struct { +type UpdateKycStatusReq struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` // 可改 enum:PENDING, APPROVED, REJECTED @@ -1418,20 +1417,20 @@ type UpdateKYCStatusReq struct { sizeCache protoimpl.SizeCache } -func (x *UpdateKYCStatusReq) Reset() { - *x = UpdateKYCStatusReq{} +func (x *UpdateKycStatusReq) Reset() { + *x = UpdateKycStatusReq{} mi := &file_generate_protobuf_product_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *UpdateKYCStatusReq) String() string { +func (x *UpdateKycStatusReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateKYCStatusReq) ProtoMessage() {} +func (*UpdateKycStatusReq) ProtoMessage() {} -func (x *UpdateKYCStatusReq) ProtoReflect() protoreflect.Message { +func (x *UpdateKycStatusReq) ProtoReflect() protoreflect.Message { mi := &file_generate_protobuf_product_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1443,33 +1442,33 @@ func (x *UpdateKYCStatusReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UpdateKYCStatusReq.ProtoReflect.Descriptor instead. -func (*UpdateKYCStatusReq) Descriptor() ([]byte, []int) { +// Deprecated: Use UpdateKycStatusReq.ProtoReflect.Descriptor instead. +func (*UpdateKycStatusReq) Descriptor() ([]byte, []int) { return file_generate_protobuf_product_proto_rawDescGZIP(), []int{20} } -func (x *UpdateKYCStatusReq) GetId() string { +func (x *UpdateKycStatusReq) GetId() string { if x != nil { return x.Id } return "" } -func (x *UpdateKYCStatusReq) GetStatus() string { +func (x *UpdateKycStatusReq) GetStatus() string { if x != nil { return x.Status } return "" } -func (x *UpdateKYCStatusReq) GetReason() string { +func (x *UpdateKycStatusReq) GetReason() string { if x != nil && x.Reason != nil { return *x.Reason } return "" } -type UpdateKYCInfoReq struct { +type UpdateKycInfoReq struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"` @@ -1489,20 +1488,20 @@ type UpdateKYCInfoReq struct { sizeCache protoimpl.SizeCache } -func (x *UpdateKYCInfoReq) Reset() { - *x = UpdateKYCInfoReq{} +func (x *UpdateKycInfoReq) Reset() { + *x = UpdateKycInfoReq{} mi := &file_generate_protobuf_product_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *UpdateKYCInfoReq) String() string { +func (x *UpdateKycInfoReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateKYCInfoReq) ProtoMessage() {} +func (*UpdateKycInfoReq) ProtoMessage() {} -func (x *UpdateKYCInfoReq) ProtoReflect() protoreflect.Message { +func (x *UpdateKycInfoReq) ProtoReflect() protoreflect.Message { mi := &file_generate_protobuf_product_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1514,103 +1513,103 @@ func (x *UpdateKYCInfoReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UpdateKYCInfoReq.ProtoReflect.Descriptor instead. -func (*UpdateKYCInfoReq) Descriptor() ([]byte, []int) { +// Deprecated: Use UpdateKycInfoReq.ProtoReflect.Descriptor instead. +func (*UpdateKycInfoReq) Descriptor() ([]byte, []int) { return file_generate_protobuf_product_proto_rawDescGZIP(), []int{21} } -func (x *UpdateKYCInfoReq) GetId() string { +func (x *UpdateKycInfoReq) GetId() string { if x != nil { return x.Id } return "" } -func (x *UpdateKYCInfoReq) GetName() string { +func (x *UpdateKycInfoReq) GetName() string { if x != nil && x.Name != nil { return *x.Name } return "" } -func (x *UpdateKYCInfoReq) GetIdentification() string { +func (x *UpdateKycInfoReq) GetIdentification() string { if x != nil && x.Identification != nil { return *x.Identification } return "" } -func (x *UpdateKYCInfoReq) GetIdentificationType() string { +func (x *UpdateKycInfoReq) GetIdentificationType() string { if x != nil && x.IdentificationType != nil { return *x.IdentificationType } return "" } -func (x *UpdateKYCInfoReq) GetAddress() string { +func (x *UpdateKycInfoReq) GetAddress() string { if x != nil && x.Address != nil { return *x.Address } return "" } -func (x *UpdateKYCInfoReq) GetPostalCode() string { +func (x *UpdateKycInfoReq) GetPostalCode() string { if x != nil && x.PostalCode != nil { return *x.PostalCode } return "" } -func (x *UpdateKYCInfoReq) GetIdFrontImage() string { +func (x *UpdateKycInfoReq) GetIdFrontImage() string { if x != nil && x.IdFrontImage != nil { return *x.IdFrontImage } return "" } -func (x *UpdateKYCInfoReq) GetIdBackImage() string { +func (x *UpdateKycInfoReq) GetIdBackImage() string { if x != nil && x.IdBackImage != nil { return *x.IdBackImage } return "" } -func (x *UpdateKYCInfoReq) GetBankStatementImg() string { +func (x *UpdateKycInfoReq) GetBankStatementImg() string { if x != nil && x.BankStatementImg != nil { return *x.BankStatementImg } return "" } -func (x *UpdateKYCInfoReq) GetBankCode() string { +func (x *UpdateKycInfoReq) GetBankCode() string { if x != nil && x.BankCode != nil { return *x.BankCode } return "" } -func (x *UpdateKYCInfoReq) GetBankName() string { +func (x *UpdateKycInfoReq) GetBankName() string { if x != nil && x.BankName != nil { return *x.BankName } return "" } -func (x *UpdateKYCInfoReq) GetBranchCode() string { +func (x *UpdateKycInfoReq) GetBranchCode() string { if x != nil && x.BranchCode != nil { return *x.BranchCode } return "" } -func (x *UpdateKYCInfoReq) GetBranchName() string { +func (x *UpdateKycInfoReq) GetBranchName() string { if x != nil && x.BranchName != nil { return *x.BranchName } return "" } -func (x *UpdateKYCInfoReq) GetBankAccount() string { +func (x *UpdateKycInfoReq) GetBankAccount() string { if x != nil && x.BankAccount != nil { return *x.BankAccount } @@ -1635,8 +1634,8 @@ type ProductItem struct { Freight []*CustomField `protobuf:"bytes,14,rep,name=freight,proto3" json:"freight,omitempty"` CustomFields []*CustomField `protobuf:"bytes,15,rep,name=custom_fields,json=customFields,proto3" json:"custom_fields,omitempty"` SalesCount uint64 `protobuf:"varint,16,opt,name=sales_count,json=salesCount,proto3" json:"sales_count,omitempty"` - UpdatedAt *string `protobuf:"bytes,17,opt,name=updated_at,json=updatedAt,proto3,oneof" json:"updated_at,omitempty"` - CreatedAt *string `protobuf:"bytes,18,opt,name=created_at,json=createdAt,proto3,oneof" json:"created_at,omitempty"` + UpdatedAt *int64 `protobuf:"varint,17,opt,name=updated_at,json=updatedAt,proto3,oneof" json:"updated_at,omitempty"` + CreatedAt *int64 `protobuf:"varint,18,opt,name=created_at,json=createdAt,proto3,oneof" json:"created_at,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1783,18 +1782,18 @@ func (x *ProductItem) GetSalesCount() uint64 { return 0 } -func (x *ProductItem) GetUpdatedAt() string { +func (x *ProductItem) GetUpdatedAt() int64 { if x != nil && x.UpdatedAt != nil { return *x.UpdatedAt } - return "" + return 0 } -func (x *ProductItem) GetCreatedAt() string { +func (x *ProductItem) GetCreatedAt() int64 { if x != nil && x.CreatedAt != nil { return *x.CreatedAt } - return "" + return 0 } type Media struct { @@ -2475,7 +2474,7 @@ func (x *UpdateStatusRequest) GetStatus() string { var File_generate_protobuf_product_proto protoreflect.FileDescriptor -var file_generate_protobuf_product_proto_rawDesc = string([]byte{ +var file_generate_protobuf_product_proto_rawDesc = []byte{ 0x0a, 0x1f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x22, 0x08, 0x0a, 0x06, 0x4f, 0x4b, @@ -2508,19 +2507,19 @@ var file_generate_protobuf_product_proto_rawDesc = string([]byte{ 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x7b, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x05, + 0x28, 0x09, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x22, 0xbb, 0x01, 0x0a, 0x0d, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x48, 0x00, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x88, 0x01, 0x01, 0x12, 0x17, + 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x77, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x08, 0x73, 0x68, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x54, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x42, 0x07, @@ -2530,9 +2529,9 @@ var file_generate_protobuf_product_proto_rawDesc = string([]byte{ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0xaf, 0x01, 0x0a, 0x04, 0x54, 0x61, 0x67, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, - 0x09, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, + 0x09, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, @@ -2547,9 +2546,9 @@ var file_generate_protobuf_product_proto_rawDesc = string([]byte{ 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x73, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x05, 0x48, 0x01, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x88, 0x01, 0x01, 0x12, 0x20, + 0x28, 0x09, 0x48, 0x01, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x03, 0x48, 0x02, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x54, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, + 0x09, 0x48, 0x02, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x54, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x47, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x73, @@ -2557,7 +2556,7 @@ var file_generate_protobuf_product_proto_rawDesc = string([]byte{ 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x21, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x54, 0x61, 0x67, 0x73, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x88, 0x05, 0x0a, 0x03, 0x4b, - 0x59, 0x43, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x79, 0x63, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, @@ -2598,7 +2597,7 @@ var file_generate_protobuf_product_proto_rawDesc = string([]byte{ 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x86, 0x04, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x4b, 0x59, 0x43, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x4b, 0x79, 0x63, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, @@ -2630,12 +2629,12 @@ var file_generate_protobuf_product_proto_rawDesc = string([]byte{ 0x0a, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x61, 0x6e, 0x6b, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x62, 0x61, 0x6e, 0x6b, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x29, - 0x0a, 0x15, 0x46, 0x69, 0x6e, 0x64, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4b, 0x59, 0x43, 0x42, + 0x0a, 0x15, 0x46, 0x69, 0x6e, 0x64, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4b, 0x79, 0x63, 0x42, 0x79, 0x55, 0x49, 0x44, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x20, 0x0a, 0x0e, 0x46, 0x69, 0x6e, - 0x64, 0x4b, 0x59, 0x43, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x4b, 0x79, 0x63, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0xdc, 0x01, 0x0a, 0x0a, - 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x59, 0x43, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x03, 0x75, 0x69, + 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x79, 0x63, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x75, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x88, 0x01, 0x01, @@ -2649,18 +2648,18 @@ var file_generate_protobuf_product_proto_rawDesc = string([]byte{ 0x0a, 0x73, 0x6f, 0x72, 0x74, 0x42, 0x79, 0x44, 0x61, 0x74, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x75, 0x69, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x45, 0x0a, 0x0b, 0x4c, 0x69, - 0x73, 0x74, 0x4b, 0x59, 0x43, 0x52, 0x65, 0x73, 0x70, 0x12, 0x20, 0x0a, 0x04, 0x6c, 0x69, 0x73, + 0x73, 0x74, 0x4b, 0x79, 0x63, 0x52, 0x65, 0x73, 0x70, 0x12, 0x20, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, - 0x74, 0x2e, 0x4b, 0x59, 0x43, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x74, 0x2e, 0x4b, 0x79, 0x63, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x22, 0x64, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x59, 0x43, 0x53, 0x74, + 0x6c, 0x22, 0x64, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x79, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0xfb, 0x05, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x4b, 0x59, 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, + 0x74, 0x65, 0x4b, 0x79, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x2b, 0x0a, 0x0e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, @@ -2741,9 +2740,9 @@ var file_generate_protobuf_product_proto_rawDesc = string([]byte{ 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x61, 0x6c, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x73, 0x61, 0x6c, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, - 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x88, 0x01, 0x01, 0x12, 0x22, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x5f, 0x61, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x09, 0x63, 0x72, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x88, 0x01, 0x01, 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x22, @@ -2838,118 +2837,114 @@ var file_generate_protobuf_product_proto_rawDesc = string([]byte{ 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0xbf, 0x0c, 0x0a, 0x07, 0x50, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, 0x3d, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, - 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, - 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, - 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x3d, 0x0a, 0x0e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x43, 0x61, - 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, - 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x37, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x74, - 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, + 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0x9e, 0x02, 0x0a, 0x10, 0x43, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x5f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x35, + 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, + 0x63, 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, + 0x79, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, + 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x35, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x12, + 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x36, 0x0a, 0x0b, - 0x47, 0x65, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x14, 0x2e, 0x70, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, - 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x43, 0x61, 0x74, 0x65, - 0x67, 0x6f, 0x72, 0x79, 0x12, 0x43, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x61, 0x74, 0x65, - 0x67, 0x6f, 0x72, 0x79, 0x12, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x19, - 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x61, 0x74, - 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x35, 0x0a, 0x0a, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x54, 0x61, 0x67, 0x73, 0x12, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, - 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x1a, + 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2f, 0x0a, 0x06, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, + 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, + 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2e, 0x0a, + 0x03, 0x47, 0x65, 0x74, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x43, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x72, 0x6f, + 0x64, 0x75, 0x63, 0x74, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x3b, 0x0a, + 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, + 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x32, 0xfd, 0x01, 0x0a, 0x0b, 0x54, + 0x61, 0x67, 0x5f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, + 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x31, 0x0a, + 0x06, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x12, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, + 0x74, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x35, 0x0a, 0x0a, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, 0x61, 0x67, 0x73, 0x12, 0x16, - 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, - 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2f, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x54, 0x61, 0x67, 0x73, 0x12, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, - 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, - 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2a, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x54, - 0x61, 0x67, 0x73, 0x12, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x54, 0x61, - 0x67, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, - 0x54, 0x61, 0x67, 0x73, 0x12, 0x37, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x67, 0x73, - 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, - 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x33, 0x0a, - 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x59, 0x43, 0x12, 0x15, 0x2e, 0x70, 0x72, 0x6f, - 0x64, 0x75, 0x63, 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x59, 0x43, 0x52, 0x65, - 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x42, 0x0a, 0x12, 0x46, 0x69, 0x6e, 0x64, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, - 0x4b, 0x59, 0x43, 0x42, 0x79, 0x55, 0x49, 0x44, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4b, 0x59, 0x43, - 0x42, 0x79, 0x55, 0x49, 0x44, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x2e, 0x4b, 0x59, 0x43, 0x12, 0x34, 0x0a, 0x0b, 0x46, 0x69, 0x6e, 0x64, 0x4b, 0x59, - 0x43, 0x42, 0x79, 0x49, 0x44, 0x12, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, - 0x46, 0x69, 0x6e, 0x64, 0x4b, 0x59, 0x43, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x1a, 0x0c, - 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4b, 0x59, 0x43, 0x12, 0x34, 0x0a, 0x07, - 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x59, 0x43, 0x12, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, - 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x59, 0x43, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x59, 0x43, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x3f, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x59, 0x43, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x59, 0x43, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x3b, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x59, 0x43, - 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x59, 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, - 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x40, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x21, - 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x46, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x47, - 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x50, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x5f, 0x0a, 0x1a, 0x47, 0x65, - 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x42, 0x79, 0x50, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x44, 0x12, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x74, - 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x64, - 0x75, 0x63, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, - 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x12, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x74, 0x65, 0x6d, - 0x73, 0x12, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, - 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5f, 0x0a, 0x1f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x42, 0x79, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x49, 0x44, 0x12, 0x2b, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x49, 0x74, 0x65, 0x6d, 0x73, 0x42, 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x49, 0x44, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, - 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x42, 0x0a, 0x0d, 0x49, 0x6e, 0x63, 0x53, 0x61, 0x6c, - 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, - 0x74, 0x2e, 0x49, 0x6e, 0x63, 0x44, 0x65, 0x63, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x64, - 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x42, 0x0a, 0x0d, 0x44, 0x65, - 0x63, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x2e, 0x70, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x49, 0x6e, 0x63, 0x44, 0x65, 0x63, 0x53, 0x61, 0x6c, 0x65, - 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, - 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3c, - 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x70, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3d, 0x0a, 0x0c, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x2e, 0x70, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, - 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0b, 0x5a, 0x09, 0x2e, - 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -}) + 0x12, 0x2b, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x10, 0x2e, 0x70, 0x72, 0x6f, + 0x64, 0x75, 0x63, 0x74, 0x2e, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, + 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, + 0x03, 0x47, 0x65, 0x74, 0x12, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x54, + 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, + 0x2e, 0x54, 0x61, 0x67, 0x73, 0x12, 0x33, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x2e, + 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x67, 0x73, + 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x32, 0xda, 0x02, 0x0a, 0x0b, 0x4b, + 0x79, 0x63, 0x5f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x12, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x79, 0x63, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x72, + 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3f, 0x0a, 0x0f, + 0x46, 0x69, 0x6e, 0x64, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x42, 0x79, 0x55, 0x69, 0x64, 0x12, + 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x4c, 0x61, + 0x74, 0x65, 0x73, 0x74, 0x4b, 0x79, 0x63, 0x42, 0x79, 0x55, 0x49, 0x44, 0x52, 0x65, 0x71, 0x1a, + 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4b, 0x79, 0x63, 0x12, 0x31, 0x0a, + 0x08, 0x46, 0x69, 0x6e, 0x64, 0x42, 0x79, 0x49, 0x64, 0x12, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x64, + 0x75, 0x63, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x4b, 0x79, 0x63, 0x42, 0x79, 0x49, 0x44, 0x52, + 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4b, 0x79, 0x63, + 0x12, 0x31, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, + 0x63, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x79, 0x63, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, + 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x79, 0x63, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x3c, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x4b, 0x79, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, + 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x34, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x19, 0x2e, 0x70, 0x72, + 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x79, 0x63, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, + 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x32, 0xff, 0x04, 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x64, + 0x75, 0x63, 0x74, 0x5f, 0x49, 0x74, 0x65, 0x6d, 0x5f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x3c, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x21, 0x2e, 0x70, 0x72, 0x6f, + 0x64, 0x75, 0x63, 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x64, 0x75, + 0x63, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, + 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3b, + 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, + 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, + 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x54, 0x0a, 0x0f, 0x4c, + 0x69, 0x73, 0x74, 0x42, 0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1f, + 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, + 0x64, 0x75, 0x63, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, + 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x21, 0x2e, 0x70, 0x72, + 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x64, + 0x75, 0x63, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, + 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x53, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x2b, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x74, + 0x65, 0x6d, 0x73, 0x42, 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x49, 0x44, + 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x42, 0x0a, 0x0d, 0x49, 0x6e, 0x63, 0x53, 0x61, 0x6c, 0x65, 0x73, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, + 0x49, 0x6e, 0x63, 0x44, 0x65, 0x63, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, + 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x42, 0x0a, 0x0d, 0x44, 0x65, 0x63, 0x53, + 0x61, 0x6c, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x64, + 0x75, 0x63, 0x74, 0x2e, 0x49, 0x6e, 0x63, 0x44, 0x65, 0x63, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x70, 0x72, + 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3c, 0x0a, 0x06, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x74, + 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x64, + 0x75, 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3d, 0x0a, 0x0c, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, + 0x64, 0x75, 0x63, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, + 0x63, 0x74, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x70, + 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} var ( file_generate_protobuf_product_proto_rawDescOnce sync.Once - file_generate_protobuf_product_proto_rawDescData []byte + file_generate_protobuf_product_proto_rawDescData = file_generate_protobuf_product_proto_rawDesc ) func file_generate_protobuf_product_proto_rawDescGZIP() []byte { file_generate_protobuf_product_proto_rawDescOnce.Do(func() { - file_generate_protobuf_product_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_generate_protobuf_product_proto_rawDesc), len(file_generate_protobuf_product_proto_rawDesc))) + file_generate_protobuf_product_proto_rawDescData = protoimpl.X.CompressGZIP(file_generate_protobuf_product_proto_rawDescData) }) return file_generate_protobuf_product_proto_rawDescData } @@ -2970,14 +2965,14 @@ var file_generate_protobuf_product_proto_goTypes = []any{ (*Tags)(nil), // 11: product.Tags (*ListTagsReq)(nil), // 12: product.ListTagsReq (*ListTagsResp)(nil), // 13: product.ListTagsResp - (*KYC)(nil), // 14: product.KYC - (*CreateKYCReq)(nil), // 15: product.CreateKYCReq - (*FindLatestKYCByUIDReq)(nil), // 16: product.FindLatestKYCByUIDReq - (*FindKYCByIDReq)(nil), // 17: product.FindKYCByIDReq - (*ListKYCReq)(nil), // 18: product.ListKYCReq - (*ListKYCResp)(nil), // 19: product.ListKYCResp - (*UpdateKYCStatusReq)(nil), // 20: product.UpdateKYCStatusReq - (*UpdateKYCInfoReq)(nil), // 21: product.UpdateKYCInfoReq + (*Kyc)(nil), // 14: product.Kyc + (*CreateKycReq)(nil), // 15: product.CreateKycReq + (*FindLatestKycByUIDReq)(nil), // 16: product.FindLatestKycByUIDReq + (*FindKycByIDReq)(nil), // 17: product.FindKycByIDReq + (*ListKycReq)(nil), // 18: product.ListKycReq + (*ListKycResp)(nil), // 19: product.ListKycResp + (*UpdateKycStatusReq)(nil), // 20: product.UpdateKycStatusReq + (*UpdateKycInfoReq)(nil), // 21: product.UpdateKycInfoReq (*ProductItem)(nil), // 22: product.ProductItem (*Media)(nil), // 23: product.Media (*CustomField)(nil), // 24: product.CustomField @@ -2994,7 +2989,7 @@ var file_generate_protobuf_product_proto_goTypes = []any{ var file_generate_protobuf_product_proto_depIdxs = []int32{ 5, // 0: product.ListCategoryResp.data:type_name -> product.Category 11, // 1: product.ListTagsResp.data:type_name -> product.Tags - 14, // 2: product.ListKYCResp.list:type_name -> product.KYC + 14, // 2: product.ListKycResp.list:type_name -> product.Kyc 23, // 3: product.ProductItem.media:type_name -> product.Media 24, // 4: product.ProductItem.freight:type_name -> product.CustomField 24, // 5: product.ProductItem.custom_fields:type_name -> product.CustomField @@ -3003,56 +2998,56 @@ var file_generate_protobuf_product_proto_depIdxs = []int32{ 23, // 8: product.UpdateProductItemRequest.media:type_name -> product.Media 24, // 9: product.UpdateProductItemRequest.freight:type_name -> product.CustomField 24, // 10: product.UpdateProductItemRequest.custom_fields:type_name -> product.CustomField - 2, // 11: product.Product.CreateCategory:input_type -> product.CreateCategoryReq - 3, // 12: product.Product.ModifyCategory:input_type -> product.ModifyCategoryReq - 4, // 13: product.Product.DeleteCategory:input_type -> product.CategoryReq - 4, // 14: product.Product.GetCategory:input_type -> product.CategoryReq - 6, // 15: product.Product.ListCategory:input_type -> product.ListCategoryReq - 8, // 16: product.Product.CreateTags:input_type -> product.CreateTagsReq - 9, // 17: product.Product.ModifyTags:input_type -> product.ModifyTagsReq - 10, // 18: product.Product.DeleteTags:input_type -> product.TagsReq - 10, // 19: product.Product.GetTags:input_type -> product.TagsReq - 12, // 20: product.Product.ListTags:input_type -> product.ListTagsReq - 15, // 21: product.Product.CreateKYC:input_type -> product.CreateKYCReq - 16, // 22: product.Product.FindLatestKYCByUID:input_type -> product.FindLatestKYCByUIDReq - 17, // 23: product.Product.FindKYCByID:input_type -> product.FindKYCByIDReq - 18, // 24: product.Product.ListKYC:input_type -> product.ListKYCReq - 20, // 25: product.Product.UpdateKYCStatus:input_type -> product.UpdateKYCStatusReq - 21, // 26: product.Product.UpdateKYCInfo:input_type -> product.UpdateKYCInfoReq - 25, // 27: product.Product.CreateItem:input_type -> product.CreateProductItemRequest - 26, // 28: product.Product.GetProductItem:input_type -> product.GetProductItemRequest - 27, // 29: product.Product.GetProductItemsByProductID:input_type -> product.ListProductItemRequest - 29, // 30: product.Product.DeleteProductItems:input_type -> product.DeleteProductItemRequest - 30, // 31: product.Product.DeleteProductItemsByReferenceID:input_type -> product.DeleteProductItemsByReferenceIDReq - 31, // 32: product.Product.IncSalesCount:input_type -> product.IncDecSalesCountRequest - 31, // 33: product.Product.DecSalesCount:input_type -> product.IncDecSalesCountRequest - 32, // 34: product.Product.Update:input_type -> product.UpdateProductItemRequest - 33, // 35: product.Product.UpdateStatus:input_type -> product.UpdateStatusRequest - 0, // 36: product.Product.CreateCategory:output_type -> product.OKResp - 0, // 37: product.Product.ModifyCategory:output_type -> product.OKResp - 0, // 38: product.Product.DeleteCategory:output_type -> product.OKResp - 5, // 39: product.Product.GetCategory:output_type -> product.Category - 7, // 40: product.Product.ListCategory:output_type -> product.ListCategoryResp - 0, // 41: product.Product.CreateTags:output_type -> product.OKResp - 0, // 42: product.Product.ModifyTags:output_type -> product.OKResp - 0, // 43: product.Product.DeleteTags:output_type -> product.OKResp - 11, // 44: product.Product.GetTags:output_type -> product.Tags - 13, // 45: product.Product.ListTags:output_type -> product.ListTagsResp - 0, // 46: product.Product.CreateKYC:output_type -> product.OKResp - 14, // 47: product.Product.FindLatestKYCByUID:output_type -> product.KYC - 14, // 48: product.Product.FindKYCByID:output_type -> product.KYC - 19, // 49: product.Product.ListKYC:output_type -> product.ListKYCResp - 0, // 50: product.Product.UpdateKYCStatus:output_type -> product.OKResp - 0, // 51: product.Product.UpdateKYCInfo:output_type -> product.OKResp - 0, // 52: product.Product.CreateItem:output_type -> product.OKResp - 22, // 53: product.Product.GetProductItem:output_type -> product.ProductItem - 28, // 54: product.Product.GetProductItemsByProductID:output_type -> product.ListProductItemResponse - 0, // 55: product.Product.DeleteProductItems:output_type -> product.OKResp - 0, // 56: product.Product.DeleteProductItemsByReferenceID:output_type -> product.OKResp - 0, // 57: product.Product.IncSalesCount:output_type -> product.OKResp - 0, // 58: product.Product.DecSalesCount:output_type -> product.OKResp - 0, // 59: product.Product.Update:output_type -> product.OKResp - 0, // 60: product.Product.UpdateStatus:output_type -> product.OKResp + 2, // 11: product.Category_Service.Create:input_type -> product.CreateCategoryReq + 3, // 12: product.Category_Service.Modify:input_type -> product.ModifyCategoryReq + 4, // 13: product.Category_Service.Delete:input_type -> product.CategoryReq + 4, // 14: product.Category_Service.Get:input_type -> product.CategoryReq + 6, // 15: product.Category_Service.List:input_type -> product.ListCategoryReq + 8, // 16: product.Tag_Service.Create:input_type -> product.CreateTagsReq + 9, // 17: product.Tag_Service.Modify:input_type -> product.ModifyTagsReq + 10, // 18: product.Tag_Service.Delete:input_type -> product.TagsReq + 10, // 19: product.Tag_Service.Get:input_type -> product.TagsReq + 12, // 20: product.Tag_Service.List:input_type -> product.ListTagsReq + 15, // 21: product.Kyc_Service.Create:input_type -> product.CreateKycReq + 16, // 22: product.Kyc_Service.FindLatestByUid:input_type -> product.FindLatestKycByUIDReq + 17, // 23: product.Kyc_Service.FindById:input_type -> product.FindKycByIDReq + 18, // 24: product.Kyc_Service.List:input_type -> product.ListKycReq + 20, // 25: product.Kyc_Service.UpdateStatus:input_type -> product.UpdateKycStatusReq + 21, // 26: product.Kyc_Service.Update:input_type -> product.UpdateKycInfoReq + 25, // 27: product.Product_Item_Service.Create:input_type -> product.CreateProductItemRequest + 26, // 28: product.Product_Item_Service.Get:input_type -> product.GetProductItemRequest + 27, // 29: product.Product_Item_Service.ListByProductId:input_type -> product.ListProductItemRequest + 29, // 30: product.Product_Item_Service.Delete:input_type -> product.DeleteProductItemRequest + 30, // 31: product.Product_Item_Service.DeleteByReferenceId:input_type -> product.DeleteProductItemsByReferenceIDReq + 31, // 32: product.Product_Item_Service.IncSalesCount:input_type -> product.IncDecSalesCountRequest + 31, // 33: product.Product_Item_Service.DecSalesCount:input_type -> product.IncDecSalesCountRequest + 32, // 34: product.Product_Item_Service.Update:input_type -> product.UpdateProductItemRequest + 33, // 35: product.Product_Item_Service.UpdateStatus:input_type -> product.UpdateStatusRequest + 0, // 36: product.Category_Service.Create:output_type -> product.OKResp + 0, // 37: product.Category_Service.Modify:output_type -> product.OKResp + 0, // 38: product.Category_Service.Delete:output_type -> product.OKResp + 5, // 39: product.Category_Service.Get:output_type -> product.Category + 7, // 40: product.Category_Service.List:output_type -> product.ListCategoryResp + 0, // 41: product.Tag_Service.Create:output_type -> product.OKResp + 0, // 42: product.Tag_Service.Modify:output_type -> product.OKResp + 0, // 43: product.Tag_Service.Delete:output_type -> product.OKResp + 11, // 44: product.Tag_Service.Get:output_type -> product.Tags + 13, // 45: product.Tag_Service.List:output_type -> product.ListTagsResp + 0, // 46: product.Kyc_Service.Create:output_type -> product.OKResp + 14, // 47: product.Kyc_Service.FindLatestByUid:output_type -> product.Kyc + 14, // 48: product.Kyc_Service.FindById:output_type -> product.Kyc + 19, // 49: product.Kyc_Service.List:output_type -> product.ListKycResp + 0, // 50: product.Kyc_Service.UpdateStatus:output_type -> product.OKResp + 0, // 51: product.Kyc_Service.Update:output_type -> product.OKResp + 0, // 52: product.Product_Item_Service.Create:output_type -> product.OKResp + 22, // 53: product.Product_Item_Service.Get:output_type -> product.ProductItem + 28, // 54: product.Product_Item_Service.ListByProductId:output_type -> product.ListProductItemResponse + 0, // 55: product.Product_Item_Service.Delete:output_type -> product.OKResp + 0, // 56: product.Product_Item_Service.DeleteByReferenceId:output_type -> product.OKResp + 0, // 57: product.Product_Item_Service.IncSalesCount:output_type -> product.OKResp + 0, // 58: product.Product_Item_Service.DecSalesCount:output_type -> product.OKResp + 0, // 59: product.Product_Item_Service.Update:output_type -> product.OKResp + 0, // 60: product.Product_Item_Service.UpdateStatus:output_type -> product.OKResp 36, // [36:61] is the sub-list for method output_type 11, // [11:36] is the sub-list for method input_type 11, // [11:11] is the sub-list for extension type_name @@ -3079,17 +3074,18 @@ func file_generate_protobuf_product_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_generate_protobuf_product_proto_rawDesc), len(file_generate_protobuf_product_proto_rawDesc)), + RawDescriptor: file_generate_protobuf_product_proto_rawDesc, NumEnums: 0, NumMessages: 34, NumExtensions: 0, - NumServices: 1, + NumServices: 4, }, GoTypes: file_generate_protobuf_product_proto_goTypes, DependencyIndexes: file_generate_protobuf_product_proto_depIdxs, MessageInfos: file_generate_protobuf_product_proto_msgTypes, }.Build() File_generate_protobuf_product_proto = out.File + file_generate_protobuf_product_proto_rawDesc = nil file_generate_protobuf_product_proto_goTypes = nil file_generate_protobuf_product_proto_depIdxs = nil } diff --git a/gen_result/pb/product/product_grpc.pb.go b/gen_result/pb/product/product_grpc.pb.go index 6c434b1..40b3733 100644 --- a/gen_result/pb/product/product_grpc.pb.go +++ b/gen_result/pb/product/product_grpc.pb.go @@ -19,86 +19,863 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - Product_CreateCategory_FullMethodName = "/product.Product/CreateCategory" - Product_ModifyCategory_FullMethodName = "/product.Product/ModifyCategory" - Product_DeleteCategory_FullMethodName = "/product.Product/DeleteCategory" - Product_GetCategory_FullMethodName = "/product.Product/GetCategory" - Product_ListCategory_FullMethodName = "/product.Product/ListCategory" - Product_CreateTags_FullMethodName = "/product.Product/CreateTags" - Product_ModifyTags_FullMethodName = "/product.Product/ModifyTags" - Product_DeleteTags_FullMethodName = "/product.Product/DeleteTags" - Product_GetTags_FullMethodName = "/product.Product/GetTags" - Product_ListTags_FullMethodName = "/product.Product/ListTags" - Product_CreateKYC_FullMethodName = "/product.Product/CreateKYC" - Product_FindLatestKYCByUID_FullMethodName = "/product.Product/FindLatestKYCByUID" - Product_FindKYCByID_FullMethodName = "/product.Product/FindKYCByID" - Product_ListKYC_FullMethodName = "/product.Product/ListKYC" - Product_UpdateKYCStatus_FullMethodName = "/product.Product/UpdateKYCStatus" - Product_UpdateKYCInfo_FullMethodName = "/product.Product/UpdateKYCInfo" - Product_CreateItem_FullMethodName = "/product.Product/CreateItem" - Product_GetProductItem_FullMethodName = "/product.Product/GetProductItem" - Product_GetProductItemsByProductID_FullMethodName = "/product.Product/GetProductItemsByProductID" - Product_DeleteProductItems_FullMethodName = "/product.Product/DeleteProductItems" - Product_DeleteProductItemsByReferenceID_FullMethodName = "/product.Product/DeleteProductItemsByReferenceID" - Product_IncSalesCount_FullMethodName = "/product.Product/IncSalesCount" - Product_DecSalesCount_FullMethodName = "/product.Product/DecSalesCount" - Product_Update_FullMethodName = "/product.Product/Update" - Product_UpdateStatus_FullMethodName = "/product.Product/UpdateStatus" + Category_Service_Create_FullMethodName = "/product.Category_Service/Create" + Category_Service_Modify_FullMethodName = "/product.Category_Service/Modify" + Category_Service_Delete_FullMethodName = "/product.Category_Service/Delete" + Category_Service_Get_FullMethodName = "/product.Category_Service/Get" + Category_Service_List_FullMethodName = "/product.Category_Service/List" ) -// ProductClient is the client API for Product service. +// Category_ServiceClient is the client API for Category_Service service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type ProductClient interface { - // ====================== Category Service Start ====================== - // CreateCategory 建立 product 分類 - 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) - // ListCategory 建立 product 分類 - ListCategory(ctx context.Context, in *ListCategoryReq, opts ...grpc.CallOption) (*ListCategoryResp, error) - // ====================== Category Service End ====================== - // ====================== Tags Service Start ====================== +type Category_ServiceClient interface { + // Create 建立 product 分類 + Create(ctx context.Context, in *CreateCategoryReq, opts ...grpc.CallOption) (*OKResp, error) + // Modify 修改 product 分類名稱 + Modify(ctx context.Context, in *ModifyCategoryReq, opts ...grpc.CallOption) (*OKResp, error) + // Delete 刪除 product 分類 + Delete(ctx context.Context, in *CategoryReq, opts ...grpc.CallOption) (*OKResp, error) + // Get 取得 product 分類 + Get(ctx context.Context, in *CategoryReq, opts ...grpc.CallOption) (*Category, error) + // List 建立 product 分類 + List(ctx context.Context, in *ListCategoryReq, opts ...grpc.CallOption) (*ListCategoryResp, error) +} + +type category_ServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewCategory_ServiceClient(cc grpc.ClientConnInterface) Category_ServiceClient { + return &category_ServiceClient{cc} +} + +func (c *category_ServiceClient) Create(ctx context.Context, in *CreateCategoryReq, opts ...grpc.CallOption) (*OKResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(OKResp) + err := c.cc.Invoke(ctx, Category_Service_Create_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *category_ServiceClient) Modify(ctx context.Context, in *ModifyCategoryReq, opts ...grpc.CallOption) (*OKResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(OKResp) + err := c.cc.Invoke(ctx, Category_Service_Modify_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *category_ServiceClient) Delete(ctx context.Context, in *CategoryReq, opts ...grpc.CallOption) (*OKResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(OKResp) + err := c.cc.Invoke(ctx, Category_Service_Delete_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *category_ServiceClient) Get(ctx context.Context, in *CategoryReq, opts ...grpc.CallOption) (*Category, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Category) + err := c.cc.Invoke(ctx, Category_Service_Get_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *category_ServiceClient) List(ctx context.Context, in *ListCategoryReq, opts ...grpc.CallOption) (*ListCategoryResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListCategoryResp) + err := c.cc.Invoke(ctx, Category_Service_List_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Category_ServiceServer is the server API for Category_Service service. +// All implementations must embed UnimplementedCategory_ServiceServer +// for forward compatibility. +type Category_ServiceServer interface { + // Create 建立 product 分類 + Create(context.Context, *CreateCategoryReq) (*OKResp, error) + // Modify 修改 product 分類名稱 + Modify(context.Context, *ModifyCategoryReq) (*OKResp, error) + // Delete 刪除 product 分類 + Delete(context.Context, *CategoryReq) (*OKResp, error) + // Get 取得 product 分類 + Get(context.Context, *CategoryReq) (*Category, error) + // List 建立 product 分類 + List(context.Context, *ListCategoryReq) (*ListCategoryResp, error) + mustEmbedUnimplementedCategory_ServiceServer() +} + +// UnimplementedCategory_ServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedCategory_ServiceServer struct{} + +func (UnimplementedCategory_ServiceServer) Create(context.Context, *CreateCategoryReq) (*OKResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") +} +func (UnimplementedCategory_ServiceServer) Modify(context.Context, *ModifyCategoryReq) (*OKResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Modify not implemented") +} +func (UnimplementedCategory_ServiceServer) Delete(context.Context, *CategoryReq) (*OKResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} +func (UnimplementedCategory_ServiceServer) Get(context.Context, *CategoryReq) (*Category, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (UnimplementedCategory_ServiceServer) List(context.Context, *ListCategoryReq) (*ListCategoryResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} +func (UnimplementedCategory_ServiceServer) mustEmbedUnimplementedCategory_ServiceServer() {} +func (UnimplementedCategory_ServiceServer) testEmbeddedByValue() {} + +// UnsafeCategory_ServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to Category_ServiceServer will +// result in compilation errors. +type UnsafeCategory_ServiceServer interface { + mustEmbedUnimplementedCategory_ServiceServer() +} + +func RegisterCategory_ServiceServer(s grpc.ServiceRegistrar, srv Category_ServiceServer) { + // If the following call pancis, it indicates UnimplementedCategory_ServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Category_Service_ServiceDesc, srv) +} + +func _Category_Service_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateCategoryReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Category_ServiceServer).Create(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Category_Service_Create_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Category_ServiceServer).Create(ctx, req.(*CreateCategoryReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Category_Service_Modify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModifyCategoryReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Category_ServiceServer).Modify(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Category_Service_Modify_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Category_ServiceServer).Modify(ctx, req.(*ModifyCategoryReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Category_Service_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CategoryReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Category_ServiceServer).Delete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Category_Service_Delete_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Category_ServiceServer).Delete(ctx, req.(*CategoryReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Category_Service_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CategoryReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Category_ServiceServer).Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Category_Service_Get_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Category_ServiceServer).Get(ctx, req.(*CategoryReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Category_Service_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListCategoryReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Category_ServiceServer).List(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Category_Service_List_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Category_ServiceServer).List(ctx, req.(*ListCategoryReq)) + } + return interceptor(ctx, in, info, handler) +} + +// Category_Service_ServiceDesc is the grpc.ServiceDesc for Category_Service service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Category_Service_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "product.Category_Service", + HandlerType: (*Category_ServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Create", + Handler: _Category_Service_Create_Handler, + }, + { + MethodName: "Modify", + Handler: _Category_Service_Modify_Handler, + }, + { + MethodName: "Delete", + Handler: _Category_Service_Delete_Handler, + }, + { + MethodName: "Get", + Handler: _Category_Service_Get_Handler, + }, + { + MethodName: "List", + Handler: _Category_Service_List_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "generate/protobuf/product.proto", +} + +const ( + Tag_Service_Create_FullMethodName = "/product.Tag_Service/Create" + Tag_Service_Modify_FullMethodName = "/product.Tag_Service/Modify" + Tag_Service_Delete_FullMethodName = "/product.Tag_Service/Delete" + Tag_Service_Get_FullMethodName = "/product.Tag_Service/Get" + Tag_Service_List_FullMethodName = "/product.Tag_Service/List" +) + +// Tag_ServiceClient is the client API for Tag_Service service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type Tag_ServiceClient interface { // CreateTags 建立 tags - CreateTags(ctx context.Context, in *CreateTagsReq, opts ...grpc.CallOption) (*OKResp, error) + Create(ctx context.Context, in *CreateTagsReq, opts ...grpc.CallOption) (*OKResp, error) // ModifyTags 修改 tags - ModifyTags(ctx context.Context, in *ModifyTagsReq, opts ...grpc.CallOption) (*OKResp, error) + Modify(ctx context.Context, in *ModifyTagsReq, opts ...grpc.CallOption) (*OKResp, error) // DeleteTags 刪除tags - DeleteTags(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*OKResp, error) + Delete(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*OKResp, error) // GetTags 取得 tags - GetTags(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*Tags, error) + Get(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*Tags, error) // ListTags 建立 tags - ListTags(ctx context.Context, in *ListTagsReq, opts ...grpc.CallOption) (*ListTagsResp, error) - // ====================== Tags Service End ====================== - // ====================== Know You Customer Service Start ====================== - // CreateKYC 建立 KYC 資料 - 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) - // ====================== Know You Customer Service End ====================== - // ====================== ProductItem Service Start ====================== - // CreateItem 建立 ProductItem - CreateItem(ctx context.Context, in *CreateProductItemRequest, opts ...grpc.CallOption) (*OKResp, error) + List(ctx context.Context, in *ListTagsReq, opts ...grpc.CallOption) (*ListTagsResp, error) +} + +type tag_ServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewTag_ServiceClient(cc grpc.ClientConnInterface) Tag_ServiceClient { + return &tag_ServiceClient{cc} +} + +func (c *tag_ServiceClient) Create(ctx context.Context, in *CreateTagsReq, opts ...grpc.CallOption) (*OKResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(OKResp) + err := c.cc.Invoke(ctx, Tag_Service_Create_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tag_ServiceClient) Modify(ctx context.Context, in *ModifyTagsReq, opts ...grpc.CallOption) (*OKResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(OKResp) + err := c.cc.Invoke(ctx, Tag_Service_Modify_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tag_ServiceClient) Delete(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*OKResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(OKResp) + err := c.cc.Invoke(ctx, Tag_Service_Delete_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tag_ServiceClient) Get(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*Tags, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Tags) + err := c.cc.Invoke(ctx, Tag_Service_Get_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tag_ServiceClient) List(ctx context.Context, in *ListTagsReq, opts ...grpc.CallOption) (*ListTagsResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListTagsResp) + err := c.cc.Invoke(ctx, Tag_Service_List_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Tag_ServiceServer is the server API for Tag_Service service. +// All implementations must embed UnimplementedTag_ServiceServer +// for forward compatibility. +type Tag_ServiceServer interface { + // CreateTags 建立 tags + Create(context.Context, *CreateTagsReq) (*OKResp, error) + // ModifyTags 修改 tags + Modify(context.Context, *ModifyTagsReq) (*OKResp, error) + // DeleteTags 刪除tags + Delete(context.Context, *TagsReq) (*OKResp, error) + // GetTags 取得 tags + Get(context.Context, *TagsReq) (*Tags, error) + // ListTags 建立 tags + List(context.Context, *ListTagsReq) (*ListTagsResp, error) + mustEmbedUnimplementedTag_ServiceServer() +} + +// UnimplementedTag_ServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedTag_ServiceServer struct{} + +func (UnimplementedTag_ServiceServer) Create(context.Context, *CreateTagsReq) (*OKResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") +} +func (UnimplementedTag_ServiceServer) Modify(context.Context, *ModifyTagsReq) (*OKResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Modify not implemented") +} +func (UnimplementedTag_ServiceServer) Delete(context.Context, *TagsReq) (*OKResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} +func (UnimplementedTag_ServiceServer) Get(context.Context, *TagsReq) (*Tags, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (UnimplementedTag_ServiceServer) List(context.Context, *ListTagsReq) (*ListTagsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} +func (UnimplementedTag_ServiceServer) mustEmbedUnimplementedTag_ServiceServer() {} +func (UnimplementedTag_ServiceServer) testEmbeddedByValue() {} + +// UnsafeTag_ServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to Tag_ServiceServer will +// result in compilation errors. +type UnsafeTag_ServiceServer interface { + mustEmbedUnimplementedTag_ServiceServer() +} + +func RegisterTag_ServiceServer(s grpc.ServiceRegistrar, srv Tag_ServiceServer) { + // If the following call pancis, it indicates UnimplementedTag_ServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Tag_Service_ServiceDesc, srv) +} + +func _Tag_Service_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateTagsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Tag_ServiceServer).Create(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Tag_Service_Create_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Tag_ServiceServer).Create(ctx, req.(*CreateTagsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Tag_Service_Modify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModifyTagsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Tag_ServiceServer).Modify(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Tag_Service_Modify_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Tag_ServiceServer).Modify(ctx, req.(*ModifyTagsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Tag_Service_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TagsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Tag_ServiceServer).Delete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Tag_Service_Delete_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Tag_ServiceServer).Delete(ctx, req.(*TagsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Tag_Service_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TagsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Tag_ServiceServer).Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Tag_Service_Get_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Tag_ServiceServer).Get(ctx, req.(*TagsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Tag_Service_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListTagsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Tag_ServiceServer).List(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Tag_Service_List_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Tag_ServiceServer).List(ctx, req.(*ListTagsReq)) + } + return interceptor(ctx, in, info, handler) +} + +// Tag_Service_ServiceDesc is the grpc.ServiceDesc for Tag_Service service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Tag_Service_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "product.Tag_Service", + HandlerType: (*Tag_ServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Create", + Handler: _Tag_Service_Create_Handler, + }, + { + MethodName: "Modify", + Handler: _Tag_Service_Modify_Handler, + }, + { + MethodName: "Delete", + Handler: _Tag_Service_Delete_Handler, + }, + { + MethodName: "Get", + Handler: _Tag_Service_Get_Handler, + }, + { + MethodName: "List", + Handler: _Tag_Service_List_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "generate/protobuf/product.proto", +} + +const ( + Kyc_Service_Create_FullMethodName = "/product.Kyc_Service/Create" + Kyc_Service_FindLatestByUid_FullMethodName = "/product.Kyc_Service/FindLatestByUid" + Kyc_Service_FindById_FullMethodName = "/product.Kyc_Service/FindById" + Kyc_Service_List_FullMethodName = "/product.Kyc_Service/List" + Kyc_Service_UpdateStatus_FullMethodName = "/product.Kyc_Service/UpdateStatus" + Kyc_Service_Update_FullMethodName = "/product.Kyc_Service/Update" +) + +// Kyc_ServiceClient is the client API for Kyc_Service service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type Kyc_ServiceClient interface { + // Create 建立 KYC 資料 + Create(ctx context.Context, in *CreateKycReq, opts ...grpc.CallOption) (*OKResp, error) + // FindLatestByUID 根據使用者 UID 查詢最新 KYC 紀錄 + FindLatestByUid(ctx context.Context, in *FindLatestKycByUIDReq, opts ...grpc.CallOption) (*Kyc, error) + // FindByID 根據 KYC ID 查詢 + FindById(ctx context.Context, in *FindKycByIDReq, opts ...grpc.CallOption) (*Kyc, error) + // List 分頁查詢 Kyc 清單(後台審核用) + List(ctx context.Context, in *ListKycReq, opts ...grpc.CallOption) (*ListKycResp, error) + // UpdateStatus 更新 Kyc 審核狀態與原因 + UpdateStatus(ctx context.Context, in *UpdateKycStatusReq, opts ...grpc.CallOption) (*OKResp, error) + // Update 更新使用者的 Kyc(尚未審核) + Update(ctx context.Context, in *UpdateKycInfoReq, opts ...grpc.CallOption) (*OKResp, error) +} + +type kyc_ServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewKyc_ServiceClient(cc grpc.ClientConnInterface) Kyc_ServiceClient { + return &kyc_ServiceClient{cc} +} + +func (c *kyc_ServiceClient) Create(ctx context.Context, in *CreateKycReq, opts ...grpc.CallOption) (*OKResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(OKResp) + err := c.cc.Invoke(ctx, Kyc_Service_Create_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *kyc_ServiceClient) FindLatestByUid(ctx context.Context, in *FindLatestKycByUIDReq, opts ...grpc.CallOption) (*Kyc, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Kyc) + err := c.cc.Invoke(ctx, Kyc_Service_FindLatestByUid_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *kyc_ServiceClient) FindById(ctx context.Context, in *FindKycByIDReq, opts ...grpc.CallOption) (*Kyc, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Kyc) + err := c.cc.Invoke(ctx, Kyc_Service_FindById_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *kyc_ServiceClient) List(ctx context.Context, in *ListKycReq, opts ...grpc.CallOption) (*ListKycResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListKycResp) + err := c.cc.Invoke(ctx, Kyc_Service_List_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *kyc_ServiceClient) UpdateStatus(ctx context.Context, in *UpdateKycStatusReq, opts ...grpc.CallOption) (*OKResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(OKResp) + err := c.cc.Invoke(ctx, Kyc_Service_UpdateStatus_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *kyc_ServiceClient) Update(ctx context.Context, in *UpdateKycInfoReq, opts ...grpc.CallOption) (*OKResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(OKResp) + err := c.cc.Invoke(ctx, Kyc_Service_Update_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Kyc_ServiceServer is the server API for Kyc_Service service. +// All implementations must embed UnimplementedKyc_ServiceServer +// for forward compatibility. +type Kyc_ServiceServer interface { + // Create 建立 KYC 資料 + Create(context.Context, *CreateKycReq) (*OKResp, error) + // FindLatestByUID 根據使用者 UID 查詢最新 KYC 紀錄 + FindLatestByUid(context.Context, *FindLatestKycByUIDReq) (*Kyc, error) + // FindByID 根據 KYC ID 查詢 + FindById(context.Context, *FindKycByIDReq) (*Kyc, error) + // List 分頁查詢 Kyc 清單(後台審核用) + List(context.Context, *ListKycReq) (*ListKycResp, error) + // UpdateStatus 更新 Kyc 審核狀態與原因 + UpdateStatus(context.Context, *UpdateKycStatusReq) (*OKResp, error) + // Update 更新使用者的 Kyc(尚未審核) + Update(context.Context, *UpdateKycInfoReq) (*OKResp, error) + mustEmbedUnimplementedKyc_ServiceServer() +} + +// UnimplementedKyc_ServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedKyc_ServiceServer struct{} + +func (UnimplementedKyc_ServiceServer) Create(context.Context, *CreateKycReq) (*OKResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") +} +func (UnimplementedKyc_ServiceServer) FindLatestByUid(context.Context, *FindLatestKycByUIDReq) (*Kyc, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindLatestByUid not implemented") +} +func (UnimplementedKyc_ServiceServer) FindById(context.Context, *FindKycByIDReq) (*Kyc, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindById not implemented") +} +func (UnimplementedKyc_ServiceServer) List(context.Context, *ListKycReq) (*ListKycResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} +func (UnimplementedKyc_ServiceServer) UpdateStatus(context.Context, *UpdateKycStatusReq) (*OKResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateStatus not implemented") +} +func (UnimplementedKyc_ServiceServer) Update(context.Context, *UpdateKycInfoReq) (*OKResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") +} +func (UnimplementedKyc_ServiceServer) mustEmbedUnimplementedKyc_ServiceServer() {} +func (UnimplementedKyc_ServiceServer) testEmbeddedByValue() {} + +// UnsafeKyc_ServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to Kyc_ServiceServer will +// result in compilation errors. +type UnsafeKyc_ServiceServer interface { + mustEmbedUnimplementedKyc_ServiceServer() +} + +func RegisterKyc_ServiceServer(s grpc.ServiceRegistrar, srv Kyc_ServiceServer) { + // If the following call pancis, it indicates UnimplementedKyc_ServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Kyc_Service_ServiceDesc, srv) +} + +func _Kyc_Service_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateKycReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Kyc_ServiceServer).Create(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Kyc_Service_Create_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Kyc_ServiceServer).Create(ctx, req.(*CreateKycReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Kyc_Service_FindLatestByUid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindLatestKycByUIDReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Kyc_ServiceServer).FindLatestByUid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Kyc_Service_FindLatestByUid_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Kyc_ServiceServer).FindLatestByUid(ctx, req.(*FindLatestKycByUIDReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Kyc_Service_FindById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindKycByIDReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Kyc_ServiceServer).FindById(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Kyc_Service_FindById_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Kyc_ServiceServer).FindById(ctx, req.(*FindKycByIDReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Kyc_Service_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListKycReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Kyc_ServiceServer).List(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Kyc_Service_List_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Kyc_ServiceServer).List(ctx, req.(*ListKycReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Kyc_Service_UpdateStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateKycStatusReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Kyc_ServiceServer).UpdateStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Kyc_Service_UpdateStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Kyc_ServiceServer).UpdateStatus(ctx, req.(*UpdateKycStatusReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Kyc_Service_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateKycInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(Kyc_ServiceServer).Update(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Kyc_Service_Update_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(Kyc_ServiceServer).Update(ctx, req.(*UpdateKycInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + +// Kyc_Service_ServiceDesc is the grpc.ServiceDesc for Kyc_Service service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Kyc_Service_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "product.Kyc_Service", + HandlerType: (*Kyc_ServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Create", + Handler: _Kyc_Service_Create_Handler, + }, + { + MethodName: "FindLatestByUid", + Handler: _Kyc_Service_FindLatestByUid_Handler, + }, + { + MethodName: "FindById", + Handler: _Kyc_Service_FindById_Handler, + }, + { + MethodName: "List", + Handler: _Kyc_Service_List_Handler, + }, + { + MethodName: "UpdateStatus", + Handler: _Kyc_Service_UpdateStatus_Handler, + }, + { + MethodName: "Update", + Handler: _Kyc_Service_Update_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "generate/protobuf/product.proto", +} + +const ( + Product_Item_Service_Create_FullMethodName = "/product.Product_Item_Service/Create" + Product_Item_Service_Get_FullMethodName = "/product.Product_Item_Service/Get" + Product_Item_Service_ListByProductId_FullMethodName = "/product.Product_Item_Service/ListByProductId" + Product_Item_Service_Delete_FullMethodName = "/product.Product_Item_Service/Delete" + Product_Item_Service_DeleteByReferenceId_FullMethodName = "/product.Product_Item_Service/DeleteByReferenceId" + Product_Item_Service_IncSalesCount_FullMethodName = "/product.Product_Item_Service/IncSalesCount" + Product_Item_Service_DecSalesCount_FullMethodName = "/product.Product_Item_Service/DecSalesCount" + Product_Item_Service_Update_FullMethodName = "/product.Product_Item_Service/Update" + Product_Item_Service_UpdateStatus_FullMethodName = "/product.Product_Item_Service/UpdateStatus" +) + +// Product_Item_ServiceClient is the client API for Product_Item_Service service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type Product_Item_ServiceClient interface { + // Create 建立 ProductItem + Create(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) + Get(ctx context.Context, in *GetProductItemRequest, opts ...grpc.CallOption) (*ProductItem, error) + // ListByProductId 使用 ProductID 取得 ProductItems + ListByProductId(ctx context.Context, in *ListProductItemRequest, opts ...grpc.CallOption) (*ListProductItemResponse, error) + // Delete 刪除 Delete Product Item + Delete(ctx context.Context, in *DeleteProductItemRequest, opts ...grpc.CallOption) (*OKResp, error) + // DeleteByReferenceId 使用 ProductID 刪除所有 Item + DeleteByReferenceId(ctx context.Context, in *DeleteProductItemsByReferenceIDReq, opts ...grpc.CallOption) (*OKResp, error) // IncSalesCount 增加賣出數量 IncSalesCount(ctx context.Context, in *IncDecSalesCountRequest, opts ...grpc.CallOption) (*OKResp, error) // DecSalesCount 減少賣出數量 @@ -109,317 +886,118 @@ type ProductClient interface { UpdateStatus(ctx context.Context, in *UpdateStatusRequest, opts ...grpc.CallOption) (*OKResp, error) } -type productClient struct { +type product_Item_ServiceClient struct { cc grpc.ClientConnInterface } -func NewProductClient(cc grpc.ClientConnInterface) ProductClient { - return &productClient{cc} +func NewProduct_Item_ServiceClient(cc grpc.ClientConnInterface) Product_Item_ServiceClient { + return &product_Item_ServiceClient{cc} } -func (c *productClient) CreateCategory(ctx context.Context, in *CreateCategoryReq, opts ...grpc.CallOption) (*OKResp, error) { +func (c *product_Item_ServiceClient) Create(ctx context.Context, in *CreateProductItemRequest, opts ...grpc.CallOption) (*OKResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(OKResp) - err := c.cc.Invoke(ctx, Product_CreateCategory_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Product_Item_Service_Create_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *productClient) ModifyCategory(ctx context.Context, in *ModifyCategoryReq, opts ...grpc.CallOption) (*OKResp, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(OKResp) - err := c.cc.Invoke(ctx, Product_ModifyCategory_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *productClient) DeleteCategory(ctx context.Context, in *CategoryReq, opts ...grpc.CallOption) (*OKResp, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(OKResp) - err := c.cc.Invoke(ctx, Product_DeleteCategory_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *productClient) GetCategory(ctx context.Context, in *CategoryReq, opts ...grpc.CallOption) (*Category, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Category) - err := c.cc.Invoke(ctx, Product_GetCategory_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *productClient) ListCategory(ctx context.Context, in *ListCategoryReq, opts ...grpc.CallOption) (*ListCategoryResp, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListCategoryResp) - err := c.cc.Invoke(ctx, Product_ListCategory_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *productClient) CreateTags(ctx context.Context, in *CreateTagsReq, opts ...grpc.CallOption) (*OKResp, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(OKResp) - err := c.cc.Invoke(ctx, Product_CreateTags_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *productClient) ModifyTags(ctx context.Context, in *ModifyTagsReq, opts ...grpc.CallOption) (*OKResp, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(OKResp) - err := c.cc.Invoke(ctx, Product_ModifyTags_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *productClient) DeleteTags(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*OKResp, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(OKResp) - err := c.cc.Invoke(ctx, Product_DeleteTags_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *productClient) GetTags(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*Tags, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Tags) - err := c.cc.Invoke(ctx, Product_GetTags_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *productClient) ListTags(ctx context.Context, in *ListTagsReq, opts ...grpc.CallOption) (*ListTagsResp, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListTagsResp) - err := c.cc.Invoke(ctx, Product_ListTags_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *productClient) CreateKYC(ctx context.Context, in *CreateKYCReq, opts ...grpc.CallOption) (*OKResp, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(OKResp) - err := c.cc.Invoke(ctx, Product_CreateKYC_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *productClient) FindLatestKYCByUID(ctx context.Context, in *FindLatestKYCByUIDReq, opts ...grpc.CallOption) (*KYC, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(KYC) - err := c.cc.Invoke(ctx, Product_FindLatestKYCByUID_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *productClient) FindKYCByID(ctx context.Context, in *FindKYCByIDReq, opts ...grpc.CallOption) (*KYC, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(KYC) - err := c.cc.Invoke(ctx, Product_FindKYCByID_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *productClient) ListKYC(ctx context.Context, in *ListKYCReq, opts ...grpc.CallOption) (*ListKYCResp, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListKYCResp) - err := c.cc.Invoke(ctx, Product_ListKYC_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *productClient) UpdateKYCStatus(ctx context.Context, in *UpdateKYCStatusReq, opts ...grpc.CallOption) (*OKResp, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(OKResp) - err := c.cc.Invoke(ctx, Product_UpdateKYCStatus_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *productClient) UpdateKYCInfo(ctx context.Context, in *UpdateKYCInfoReq, opts ...grpc.CallOption) (*OKResp, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(OKResp) - err := c.cc.Invoke(ctx, Product_UpdateKYCInfo_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *productClient) CreateItem(ctx context.Context, in *CreateProductItemRequest, opts ...grpc.CallOption) (*OKResp, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(OKResp) - err := c.cc.Invoke(ctx, Product_CreateItem_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *productClient) GetProductItem(ctx context.Context, in *GetProductItemRequest, opts ...grpc.CallOption) (*ProductItem, error) { +func (c *product_Item_ServiceClient) Get(ctx context.Context, in *GetProductItemRequest, opts ...grpc.CallOption) (*ProductItem, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ProductItem) - err := c.cc.Invoke(ctx, Product_GetProductItem_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Product_Item_Service_Get_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *productClient) GetProductItemsByProductID(ctx context.Context, in *ListProductItemRequest, opts ...grpc.CallOption) (*ListProductItemResponse, error) { +func (c *product_Item_ServiceClient) ListByProductId(ctx context.Context, in *ListProductItemRequest, opts ...grpc.CallOption) (*ListProductItemResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListProductItemResponse) - err := c.cc.Invoke(ctx, Product_GetProductItemsByProductID_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Product_Item_Service_ListByProductId_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *productClient) DeleteProductItems(ctx context.Context, in *DeleteProductItemRequest, opts ...grpc.CallOption) (*OKResp, error) { +func (c *product_Item_ServiceClient) Delete(ctx context.Context, in *DeleteProductItemRequest, opts ...grpc.CallOption) (*OKResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(OKResp) - err := c.cc.Invoke(ctx, Product_DeleteProductItems_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Product_Item_Service_Delete_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *productClient) DeleteProductItemsByReferenceID(ctx context.Context, in *DeleteProductItemsByReferenceIDReq, opts ...grpc.CallOption) (*OKResp, error) { +func (c *product_Item_ServiceClient) DeleteByReferenceId(ctx context.Context, in *DeleteProductItemsByReferenceIDReq, opts ...grpc.CallOption) (*OKResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(OKResp) - err := c.cc.Invoke(ctx, Product_DeleteProductItemsByReferenceID_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Product_Item_Service_DeleteByReferenceId_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *productClient) IncSalesCount(ctx context.Context, in *IncDecSalesCountRequest, opts ...grpc.CallOption) (*OKResp, error) { +func (c *product_Item_ServiceClient) IncSalesCount(ctx context.Context, in *IncDecSalesCountRequest, opts ...grpc.CallOption) (*OKResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(OKResp) - err := c.cc.Invoke(ctx, Product_IncSalesCount_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Product_Item_Service_IncSalesCount_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *productClient) DecSalesCount(ctx context.Context, in *IncDecSalesCountRequest, opts ...grpc.CallOption) (*OKResp, error) { +func (c *product_Item_ServiceClient) DecSalesCount(ctx context.Context, in *IncDecSalesCountRequest, opts ...grpc.CallOption) (*OKResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(OKResp) - err := c.cc.Invoke(ctx, Product_DecSalesCount_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Product_Item_Service_DecSalesCount_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *productClient) Update(ctx context.Context, in *UpdateProductItemRequest, opts ...grpc.CallOption) (*OKResp, error) { +func (c *product_Item_ServiceClient) Update(ctx context.Context, in *UpdateProductItemRequest, opts ...grpc.CallOption) (*OKResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(OKResp) - err := c.cc.Invoke(ctx, Product_Update_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Product_Item_Service_Update_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *productClient) UpdateStatus(ctx context.Context, in *UpdateStatusRequest, opts ...grpc.CallOption) (*OKResp, error) { +func (c *product_Item_ServiceClient) UpdateStatus(ctx context.Context, in *UpdateStatusRequest, opts ...grpc.CallOption) (*OKResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(OKResp) - err := c.cc.Invoke(ctx, Product_UpdateStatus_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Product_Item_Service_UpdateStatus_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -// ProductServer is the server API for Product service. -// All implementations must embed UnimplementedProductServer +// Product_Item_ServiceServer is the server API for Product_Item_Service service. +// All implementations must embed UnimplementedProduct_Item_ServiceServer // for forward compatibility. -type ProductServer interface { - // ====================== Category Service Start ====================== - // CreateCategory 建立 product 分類 - CreateCategory(context.Context, *CreateCategoryReq) (*OKResp, error) - // ModifyCategory 修改 product 分類名稱 - ModifyCategory(context.Context, *ModifyCategoryReq) (*OKResp, error) - // DeleteCategory 刪除 product 分類 - DeleteCategory(context.Context, *CategoryReq) (*OKResp, error) - // GetCategory 取得 product 分類 - GetCategory(context.Context, *CategoryReq) (*Category, error) - // ListCategory 建立 product 分類 - ListCategory(context.Context, *ListCategoryReq) (*ListCategoryResp, error) - // ====================== Category Service End ====================== - // ====================== Tags Service Start ====================== - // CreateTags 建立 tags - CreateTags(context.Context, *CreateTagsReq) (*OKResp, error) - // ModifyTags 修改 tags - ModifyTags(context.Context, *ModifyTagsReq) (*OKResp, error) - // DeleteTags 刪除tags - DeleteTags(context.Context, *TagsReq) (*OKResp, error) - // GetTags 取得 tags - GetTags(context.Context, *TagsReq) (*Tags, error) - // ListTags 建立 tags - ListTags(context.Context, *ListTagsReq) (*ListTagsResp, error) - // ====================== Tags Service End ====================== - // ====================== Know You Customer Service Start ====================== - // CreateKYC 建立 KYC 資料 - CreateKYC(context.Context, *CreateKYCReq) (*OKResp, error) - // FindLatestKYCByUID 根據使用者 UID 查詢最新 KYC 紀錄 - FindLatestKYCByUID(context.Context, *FindLatestKYCByUIDReq) (*KYC, error) - // FindKYCByID 根據 KYC ID 查詢 - FindKYCByID(context.Context, *FindKYCByIDReq) (*KYC, error) - // ListKYC 分頁查詢 KYC 清單(後台審核用) - ListKYC(context.Context, *ListKYCReq) (*ListKYCResp, error) - // UpdateKYCStatus 更新 KYC 審核狀態與原因 - UpdateKYCStatus(context.Context, *UpdateKYCStatusReq) (*OKResp, error) - // UpdateKYCInfo 更新使用者的 KYC(尚未審核) - UpdateKYCInfo(context.Context, *UpdateKYCInfoReq) (*OKResp, error) - // ====================== Know You Customer Service End ====================== - // ====================== ProductItem Service Start ====================== - // CreateItem 建立 ProductItem - CreateItem(context.Context, *CreateProductItemRequest) (*OKResp, error) +type Product_Item_ServiceServer interface { + // Create 建立 ProductItem + Create(context.Context, *CreateProductItemRequest) (*OKResp, error) // GetProductItem 取得 ProductItem - GetProductItem(context.Context, *GetProductItemRequest) (*ProductItem, error) - // GetProductItemsByProductID 使用 ProductID 取得 ProductItems - GetProductItemsByProductID(context.Context, *ListProductItemRequest) (*ListProductItemResponse, error) - // DeleteProductItems 刪除 Delete Product Item - DeleteProductItems(context.Context, *DeleteProductItemRequest) (*OKResp, error) - // DeleteProductItemsByReferenceID 使用 ProductID 刪除所有 Item - DeleteProductItemsByReferenceID(context.Context, *DeleteProductItemsByReferenceIDReq) (*OKResp, error) + Get(context.Context, *GetProductItemRequest) (*ProductItem, error) + // ListByProductId 使用 ProductID 取得 ProductItems + ListByProductId(context.Context, *ListProductItemRequest) (*ListProductItemResponse, error) + // Delete 刪除 Delete Product Item + Delete(context.Context, *DeleteProductItemRequest) (*OKResp, error) + // DeleteByReferenceId 使用 ProductID 刪除所有 Item + DeleteByReferenceId(context.Context, *DeleteProductItemsByReferenceIDReq) (*OKResp, error) // IncSalesCount 增加賣出數量 IncSalesCount(context.Context, *IncDecSalesCountRequest) (*OKResp, error) // DecSalesCount 減少賣出數量 @@ -428,668 +1006,268 @@ type ProductServer interface { Update(context.Context, *UpdateProductItemRequest) (*OKResp, error) // UpdateStatus 更新 Item status UpdateStatus(context.Context, *UpdateStatusRequest) (*OKResp, error) - mustEmbedUnimplementedProductServer() + mustEmbedUnimplementedProduct_Item_ServiceServer() } -// UnimplementedProductServer must be embedded to have +// UnimplementedProduct_Item_ServiceServer must be embedded to have // forward compatible implementations. // // NOTE: this should be embedded by value instead of pointer to avoid a nil // pointer dereference when methods are called. -type UnimplementedProductServer struct{} +type UnimplementedProduct_Item_ServiceServer struct{} -func (UnimplementedProductServer) CreateCategory(context.Context, *CreateCategoryReq) (*OKResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateCategory not implemented") +func (UnimplementedProduct_Item_ServiceServer) Create(context.Context, *CreateProductItemRequest) (*OKResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") } -func (UnimplementedProductServer) ModifyCategory(context.Context, *ModifyCategoryReq) (*OKResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModifyCategory not implemented") +func (UnimplementedProduct_Item_ServiceServer) Get(context.Context, *GetProductItemRequest) (*ProductItem, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") } -func (UnimplementedProductServer) DeleteCategory(context.Context, *CategoryReq) (*OKResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteCategory not implemented") +func (UnimplementedProduct_Item_ServiceServer) ListByProductId(context.Context, *ListProductItemRequest) (*ListProductItemResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListByProductId not implemented") } -func (UnimplementedProductServer) GetCategory(context.Context, *CategoryReq) (*Category, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetCategory not implemented") +func (UnimplementedProduct_Item_ServiceServer) Delete(context.Context, *DeleteProductItemRequest) (*OKResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") } -func (UnimplementedProductServer) ListCategory(context.Context, *ListCategoryReq) (*ListCategoryResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListCategory not implemented") +func (UnimplementedProduct_Item_ServiceServer) DeleteByReferenceId(context.Context, *DeleteProductItemsByReferenceIDReq) (*OKResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteByReferenceId not implemented") } -func (UnimplementedProductServer) CreateTags(context.Context, *CreateTagsReq) (*OKResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateTags not implemented") -} -func (UnimplementedProductServer) ModifyTags(context.Context, *ModifyTagsReq) (*OKResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModifyTags not implemented") -} -func (UnimplementedProductServer) DeleteTags(context.Context, *TagsReq) (*OKResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteTags not implemented") -} -func (UnimplementedProductServer) GetTags(context.Context, *TagsReq) (*Tags, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetTags not implemented") -} -func (UnimplementedProductServer) ListTags(context.Context, *ListTagsReq) (*ListTagsResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListTags not implemented") -} -func (UnimplementedProductServer) CreateKYC(context.Context, *CreateKYCReq) (*OKResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateKYC not implemented") -} -func (UnimplementedProductServer) FindLatestKYCByUID(context.Context, *FindLatestKYCByUIDReq) (*KYC, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindLatestKYCByUID not implemented") -} -func (UnimplementedProductServer) FindKYCByID(context.Context, *FindKYCByIDReq) (*KYC, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindKYCByID not implemented") -} -func (UnimplementedProductServer) ListKYC(context.Context, *ListKYCReq) (*ListKYCResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListKYC not implemented") -} -func (UnimplementedProductServer) UpdateKYCStatus(context.Context, *UpdateKYCStatusReq) (*OKResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateKYCStatus not implemented") -} -func (UnimplementedProductServer) UpdateKYCInfo(context.Context, *UpdateKYCInfoReq) (*OKResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateKYCInfo not implemented") -} -func (UnimplementedProductServer) CreateItem(context.Context, *CreateProductItemRequest) (*OKResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateItem not implemented") -} -func (UnimplementedProductServer) GetProductItem(context.Context, *GetProductItemRequest) (*ProductItem, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetProductItem not implemented") -} -func (UnimplementedProductServer) GetProductItemsByProductID(context.Context, *ListProductItemRequest) (*ListProductItemResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetProductItemsByProductID not implemented") -} -func (UnimplementedProductServer) DeleteProductItems(context.Context, *DeleteProductItemRequest) (*OKResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteProductItems not implemented") -} -func (UnimplementedProductServer) DeleteProductItemsByReferenceID(context.Context, *DeleteProductItemsByReferenceIDReq) (*OKResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteProductItemsByReferenceID not implemented") -} -func (UnimplementedProductServer) IncSalesCount(context.Context, *IncDecSalesCountRequest) (*OKResp, error) { +func (UnimplementedProduct_Item_ServiceServer) IncSalesCount(context.Context, *IncDecSalesCountRequest) (*OKResp, error) { return nil, status.Errorf(codes.Unimplemented, "method IncSalesCount not implemented") } -func (UnimplementedProductServer) DecSalesCount(context.Context, *IncDecSalesCountRequest) (*OKResp, error) { +func (UnimplementedProduct_Item_ServiceServer) DecSalesCount(context.Context, *IncDecSalesCountRequest) (*OKResp, error) { return nil, status.Errorf(codes.Unimplemented, "method DecSalesCount not implemented") } -func (UnimplementedProductServer) Update(context.Context, *UpdateProductItemRequest) (*OKResp, error) { +func (UnimplementedProduct_Item_ServiceServer) Update(context.Context, *UpdateProductItemRequest) (*OKResp, error) { return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") } -func (UnimplementedProductServer) UpdateStatus(context.Context, *UpdateStatusRequest) (*OKResp, error) { +func (UnimplementedProduct_Item_ServiceServer) UpdateStatus(context.Context, *UpdateStatusRequest) (*OKResp, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateStatus not implemented") } -func (UnimplementedProductServer) mustEmbedUnimplementedProductServer() {} -func (UnimplementedProductServer) testEmbeddedByValue() {} +func (UnimplementedProduct_Item_ServiceServer) mustEmbedUnimplementedProduct_Item_ServiceServer() {} +func (UnimplementedProduct_Item_ServiceServer) testEmbeddedByValue() {} -// UnsafeProductServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ProductServer will +// UnsafeProduct_Item_ServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to Product_Item_ServiceServer will // result in compilation errors. -type UnsafeProductServer interface { - mustEmbedUnimplementedProductServer() +type UnsafeProduct_Item_ServiceServer interface { + mustEmbedUnimplementedProduct_Item_ServiceServer() } -func RegisterProductServer(s grpc.ServiceRegistrar, srv ProductServer) { - // If the following call pancis, it indicates UnimplementedProductServer was +func RegisterProduct_Item_ServiceServer(s grpc.ServiceRegistrar, srv Product_Item_ServiceServer) { + // If the following call pancis, it indicates UnimplementedProduct_Item_ServiceServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { t.testEmbeddedByValue() } - s.RegisterService(&Product_ServiceDesc, srv) + s.RegisterService(&Product_Item_Service_ServiceDesc, srv) } -func _Product_CreateCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateCategoryReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProductServer).CreateCategory(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Product_CreateCategory_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).CreateCategory(ctx, req.(*CreateCategoryReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Product_ModifyCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModifyCategoryReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProductServer).ModifyCategory(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Product_ModifyCategory_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).ModifyCategory(ctx, req.(*ModifyCategoryReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Product_DeleteCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CategoryReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProductServer).DeleteCategory(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Product_DeleteCategory_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).DeleteCategory(ctx, req.(*CategoryReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Product_GetCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CategoryReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProductServer).GetCategory(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Product_GetCategory_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).GetCategory(ctx, req.(*CategoryReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Product_ListCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListCategoryReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProductServer).ListCategory(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Product_ListCategory_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).ListCategory(ctx, req.(*ListCategoryReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Product_CreateTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateTagsReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProductServer).CreateTags(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Product_CreateTags_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).CreateTags(ctx, req.(*CreateTagsReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Product_ModifyTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModifyTagsReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProductServer).ModifyTags(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Product_ModifyTags_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).ModifyTags(ctx, req.(*ModifyTagsReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Product_DeleteTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TagsReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProductServer).DeleteTags(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Product_DeleteTags_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).DeleteTags(ctx, req.(*TagsReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Product_GetTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TagsReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProductServer).GetTags(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Product_GetTags_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).GetTags(ctx, req.(*TagsReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Product_ListTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListTagsReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProductServer).ListTags(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Product_ListTags_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).ListTags(ctx, req.(*ListTagsReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Product_CreateKYC_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateKYCReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProductServer).CreateKYC(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Product_CreateKYC_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).CreateKYC(ctx, req.(*CreateKYCReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Product_FindLatestKYCByUID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FindLatestKYCByUIDReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProductServer).FindLatestKYCByUID(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Product_FindLatestKYCByUID_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).FindLatestKYCByUID(ctx, req.(*FindLatestKYCByUIDReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Product_FindKYCByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FindKYCByIDReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProductServer).FindKYCByID(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Product_FindKYCByID_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).FindKYCByID(ctx, req.(*FindKYCByIDReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Product_ListKYC_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListKYCReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProductServer).ListKYC(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Product_ListKYC_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).ListKYC(ctx, req.(*ListKYCReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Product_UpdateKYCStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateKYCStatusReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProductServer).UpdateKYCStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Product_UpdateKYCStatus_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).UpdateKYCStatus(ctx, req.(*UpdateKYCStatusReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Product_UpdateKYCInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateKYCInfoReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProductServer).UpdateKYCInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Product_UpdateKYCInfo_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).UpdateKYCInfo(ctx, req.(*UpdateKYCInfoReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Product_CreateItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Product_Item_Service_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateProductItemRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ProductServer).CreateItem(ctx, in) + return srv.(Product_Item_ServiceServer).Create(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Product_CreateItem_FullMethodName, + FullMethod: Product_Item_Service_Create_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).CreateItem(ctx, req.(*CreateProductItemRequest)) + return srv.(Product_Item_ServiceServer).Create(ctx, req.(*CreateProductItemRequest)) } return interceptor(ctx, in, info, handler) } -func _Product_GetProductItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Product_Item_Service_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetProductItemRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ProductServer).GetProductItem(ctx, in) + return srv.(Product_Item_ServiceServer).Get(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Product_GetProductItem_FullMethodName, + FullMethod: Product_Item_Service_Get_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).GetProductItem(ctx, req.(*GetProductItemRequest)) + return srv.(Product_Item_ServiceServer).Get(ctx, req.(*GetProductItemRequest)) } return interceptor(ctx, in, info, handler) } -func _Product_GetProductItemsByProductID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Product_Item_Service_ListByProductId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListProductItemRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ProductServer).GetProductItemsByProductID(ctx, in) + return srv.(Product_Item_ServiceServer).ListByProductId(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Product_GetProductItemsByProductID_FullMethodName, + FullMethod: Product_Item_Service_ListByProductId_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).GetProductItemsByProductID(ctx, req.(*ListProductItemRequest)) + return srv.(Product_Item_ServiceServer).ListByProductId(ctx, req.(*ListProductItemRequest)) } return interceptor(ctx, in, info, handler) } -func _Product_DeleteProductItems_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Product_Item_Service_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteProductItemRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ProductServer).DeleteProductItems(ctx, in) + return srv.(Product_Item_ServiceServer).Delete(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Product_DeleteProductItems_FullMethodName, + FullMethod: Product_Item_Service_Delete_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).DeleteProductItems(ctx, req.(*DeleteProductItemRequest)) + return srv.(Product_Item_ServiceServer).Delete(ctx, req.(*DeleteProductItemRequest)) } return interceptor(ctx, in, info, handler) } -func _Product_DeleteProductItemsByReferenceID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Product_Item_Service_DeleteByReferenceId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteProductItemsByReferenceIDReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ProductServer).DeleteProductItemsByReferenceID(ctx, in) + return srv.(Product_Item_ServiceServer).DeleteByReferenceId(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Product_DeleteProductItemsByReferenceID_FullMethodName, + FullMethod: Product_Item_Service_DeleteByReferenceId_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).DeleteProductItemsByReferenceID(ctx, req.(*DeleteProductItemsByReferenceIDReq)) + return srv.(Product_Item_ServiceServer).DeleteByReferenceId(ctx, req.(*DeleteProductItemsByReferenceIDReq)) } return interceptor(ctx, in, info, handler) } -func _Product_IncSalesCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Product_Item_Service_IncSalesCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(IncDecSalesCountRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ProductServer).IncSalesCount(ctx, in) + return srv.(Product_Item_ServiceServer).IncSalesCount(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Product_IncSalesCount_FullMethodName, + FullMethod: Product_Item_Service_IncSalesCount_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).IncSalesCount(ctx, req.(*IncDecSalesCountRequest)) + return srv.(Product_Item_ServiceServer).IncSalesCount(ctx, req.(*IncDecSalesCountRequest)) } return interceptor(ctx, in, info, handler) } -func _Product_DecSalesCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Product_Item_Service_DecSalesCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(IncDecSalesCountRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ProductServer).DecSalesCount(ctx, in) + return srv.(Product_Item_ServiceServer).DecSalesCount(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Product_DecSalesCount_FullMethodName, + FullMethod: Product_Item_Service_DecSalesCount_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).DecSalesCount(ctx, req.(*IncDecSalesCountRequest)) + return srv.(Product_Item_ServiceServer).DecSalesCount(ctx, req.(*IncDecSalesCountRequest)) } return interceptor(ctx, in, info, handler) } -func _Product_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Product_Item_Service_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateProductItemRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ProductServer).Update(ctx, in) + return srv.(Product_Item_ServiceServer).Update(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Product_Update_FullMethodName, + FullMethod: Product_Item_Service_Update_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).Update(ctx, req.(*UpdateProductItemRequest)) + return srv.(Product_Item_ServiceServer).Update(ctx, req.(*UpdateProductItemRequest)) } return interceptor(ctx, in, info, handler) } -func _Product_UpdateStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Product_Item_Service_UpdateStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateStatusRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ProductServer).UpdateStatus(ctx, in) + return srv.(Product_Item_ServiceServer).UpdateStatus(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Product_UpdateStatus_FullMethodName, + FullMethod: Product_Item_Service_UpdateStatus_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductServer).UpdateStatus(ctx, req.(*UpdateStatusRequest)) + return srv.(Product_Item_ServiceServer).UpdateStatus(ctx, req.(*UpdateStatusRequest)) } return interceptor(ctx, in, info, handler) } -// Product_ServiceDesc is the grpc.ServiceDesc for Product service. +// Product_Item_Service_ServiceDesc is the grpc.ServiceDesc for Product_Item_Service service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) -var Product_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "product.Product", - HandlerType: (*ProductServer)(nil), +var Product_Item_Service_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "product.Product_Item_Service", + HandlerType: (*Product_Item_ServiceServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "CreateCategory", - Handler: _Product_CreateCategory_Handler, + MethodName: "Create", + Handler: _Product_Item_Service_Create_Handler, }, { - MethodName: "ModifyCategory", - Handler: _Product_ModifyCategory_Handler, + MethodName: "Get", + Handler: _Product_Item_Service_Get_Handler, }, { - MethodName: "DeleteCategory", - Handler: _Product_DeleteCategory_Handler, + MethodName: "ListByProductId", + Handler: _Product_Item_Service_ListByProductId_Handler, }, { - MethodName: "GetCategory", - Handler: _Product_GetCategory_Handler, + MethodName: "Delete", + Handler: _Product_Item_Service_Delete_Handler, }, { - MethodName: "ListCategory", - Handler: _Product_ListCategory_Handler, - }, - { - MethodName: "CreateTags", - Handler: _Product_CreateTags_Handler, - }, - { - MethodName: "ModifyTags", - Handler: _Product_ModifyTags_Handler, - }, - { - MethodName: "DeleteTags", - Handler: _Product_DeleteTags_Handler, - }, - { - MethodName: "GetTags", - Handler: _Product_GetTags_Handler, - }, - { - MethodName: "ListTags", - Handler: _Product_ListTags_Handler, - }, - { - MethodName: "CreateKYC", - Handler: _Product_CreateKYC_Handler, - }, - { - MethodName: "FindLatestKYCByUID", - Handler: _Product_FindLatestKYCByUID_Handler, - }, - { - MethodName: "FindKYCByID", - Handler: _Product_FindKYCByID_Handler, - }, - { - MethodName: "ListKYC", - Handler: _Product_ListKYC_Handler, - }, - { - MethodName: "UpdateKYCStatus", - Handler: _Product_UpdateKYCStatus_Handler, - }, - { - MethodName: "UpdateKYCInfo", - Handler: _Product_UpdateKYCInfo_Handler, - }, - { - MethodName: "CreateItem", - Handler: _Product_CreateItem_Handler, - }, - { - MethodName: "GetProductItem", - Handler: _Product_GetProductItem_Handler, - }, - { - MethodName: "GetProductItemsByProductID", - Handler: _Product_GetProductItemsByProductID_Handler, - }, - { - MethodName: "DeleteProductItems", - Handler: _Product_DeleteProductItems_Handler, - }, - { - MethodName: "DeleteProductItemsByReferenceID", - Handler: _Product_DeleteProductItemsByReferenceID_Handler, + MethodName: "DeleteByReferenceId", + Handler: _Product_Item_Service_DeleteByReferenceId_Handler, }, { MethodName: "IncSalesCount", - Handler: _Product_IncSalesCount_Handler, + Handler: _Product_Item_Service_IncSalesCount_Handler, }, { MethodName: "DecSalesCount", - Handler: _Product_DecSalesCount_Handler, + Handler: _Product_Item_Service_DecSalesCount_Handler, }, { MethodName: "Update", - Handler: _Product_Update_Handler, + Handler: _Product_Item_Service_Update_Handler, }, { MethodName: "UpdateStatus", - Handler: _Product_UpdateStatus_Handler, + Handler: _Product_Item_Service_UpdateStatus_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/generate/protobuf/product.proto b/generate/protobuf/product.proto index f14fd1b..239c896 100644 --- a/generate/protobuf/product.proto +++ b/generate/protobuf/product.proto @@ -9,7 +9,7 @@ message OKResp {} // NoneReq message NoneReq {} -// ====================== Category Param ====================== +// ====================== Category ====================== message CreateCategoryReq { string name = 1; } @@ -41,20 +41,35 @@ message ListCategoryResp { repeated Category data=3; } +service Category_Service { + // Create 建立 product 分類 + rpc Create(CreateCategoryReq) returns(OKResp); + // Modify 修改 product 分類名稱 + rpc Modify(ModifyCategoryReq) returns(OKResp); + // Delete 刪除 product 分類 + rpc Delete(CategoryReq) returns(OKResp); + // Get 取得 product 分類 + rpc Get(CategoryReq) returns(Category); + // List 建立 product 分類 + rpc List(ListCategoryReq) returns(ListCategoryResp); +} + + + // ====================== Tags Param ====================== message CreateTagsReq{ - int32 types=1; + string types=1; string name=2; - int64 show_type=3; + string show_type=3; optional string cover=4; } message ModifyTagsReq{ string id=1; - optional int32 types=2; + optional string types=2; optional string name=3; - optional int64 show_type=4; + optional string show_type=4; optional string cover=5; } @@ -64,9 +79,9 @@ message TagsReq { message Tags{ string id=1; - int32 types=2; + string types=2; string name=3; - int64 show_type=4; + string show_type=4; string cover=5; int64 update_at=6; int64 created_at=7; @@ -77,8 +92,8 @@ message ListTagsReq { int64 page_size =2; repeated string ids=3; optional string name=4; - optional int32 types=5; - optional int64 show_type=6; + optional string types=5; + optional string show_type=6; } message ListTagsResp { @@ -86,8 +101,21 @@ message ListTagsResp { repeated Tags data=3; } +service Tag_Service { + // CreateTags 建立 tags + rpc Create(CreateTagsReq) returns(OKResp); + // ModifyTags 修改 tags + rpc Modify(ModifyTagsReq) returns(OKResp); + // DeleteTags 刪除tags + rpc Delete(TagsReq) returns(OKResp); + // GetTags 取得 tags + rpc Get(TagsReq) returns(Tags); + // ListTags 建立 tags + rpc List(ListTagsReq) returns(ListTagsResp); +} + // ====================== KYC Param ====================== -message KYC { +message Kyc { string id = 1; // MongoDB ObjectID 字串格式 string uid = 2; // 驗證人 UID string country_region = 3; // 地區(例如 "TW", "JP", "US"...) @@ -110,7 +138,7 @@ message KYC { int64 created_at = 20; // 建立時間(timestamp) } -message CreateKYCReq { +message CreateKycReq { string uid = 1; string country_region = 2; string name = 3; @@ -128,15 +156,15 @@ message CreateKYCReq { string bank_account = 15; } -message FindLatestKYCByUIDReq { +message FindLatestKycByUIDReq { string uid = 1; } -message FindKYCByIDReq { +message FindKycByIDReq { string id = 1; } -message ListKYCReq { +message ListKycReq { optional string uid = 1; optional string country = 2; optional string status = 3; // 可改 enum @@ -145,18 +173,18 @@ message ListKYCReq { bool sort_by_date = 6; } -message ListKYCResp { - repeated KYC list = 1; +message ListKycResp { + repeated Kyc list = 1; int64 total = 2; } -message UpdateKYCStatusReq { +message UpdateKycStatusReq { string id = 1; string status = 2; // 可改 enum:PENDING, APPROVED, REJECTED optional string reason = 3; } -message UpdateKYCInfoReq { +message UpdateKycInfoReq { string id = 1; optional string name = 2; @@ -174,6 +202,20 @@ message UpdateKYCInfoReq { optional string bank_account = 14; } +service Kyc_Service{ + // Create 建立 KYC 資料 + rpc Create (CreateKycReq) returns (OKResp); + // FindLatestByUID 根據使用者 UID 查詢最新 KYC 紀錄 + rpc FindLatestByUid (FindLatestKycByUIDReq) returns (Kyc); + // FindByID 根據 KYC ID 查詢 + rpc FindById (FindKycByIDReq) returns (Kyc); + // List 分頁查詢 Kyc 清單(後台審核用) + rpc List (ListKycReq) returns (ListKycResp); + // UpdateStatus 更新 Kyc 審核狀態與原因 + rpc UpdateStatus (UpdateKycStatusReq) returns (OKResp); + // Update 更新使用者的 Kyc(尚未審核) + rpc Update (UpdateKycInfoReq) returns (OKResp); +} // ====================== Product Item Param ====================== message ProductItem { @@ -193,8 +235,8 @@ message ProductItem { repeated CustomField freight = 14; repeated CustomField custom_fields = 15; uint64 sales_count = 16; - optional string updated_at = 17; - optional string created_at = 18; + optional int64 updated_at = 17; + optional int64 created_at = 18; } message Media { @@ -265,56 +307,17 @@ message UpdateStatusRequest { } -service Product { - // ====================== Category Service Start ====================== - // CreateCategory 建立 product 分類 - rpc CreateCategory(CreateCategoryReq) returns(OKResp); - // ModifyCategory 修改 product 分類名稱 - rpc ModifyCategory(ModifyCategoryReq) returns(OKResp); - // DeleteCategory 刪除 product 分類 - rpc DeleteCategory(CategoryReq) returns(OKResp); - // GetCategory 取得 product 分類 - rpc GetCategory(CategoryReq) returns(Category); - // ListCategory 建立 product 分類 - rpc ListCategory(ListCategoryReq) returns(ListCategoryResp); - // ====================== Category Service End ====================== - // ====================== Tags Service Start ====================== - // CreateTags 建立 tags - rpc CreateTags(CreateTagsReq) returns(OKResp); - // ModifyTags 修改 tags - rpc ModifyTags(ModifyTagsReq) returns(OKResp); - // DeleteTags 刪除tags - rpc DeleteTags(TagsReq) returns(OKResp); - // GetTags 取得 tags - rpc GetTags(TagsReq) returns(Tags); - // ListTags 建立 tags - rpc ListTags(ListTagsReq) returns(ListTagsResp); - // ====================== Tags Service End ====================== - // ====================== Know You Customer Service Start ====================== - // CreateKYC 建立 KYC 資料 - rpc CreateKYC (CreateKYCReq) returns (OKResp); - // FindLatestKYCByUID 根據使用者 UID 查詢最新 KYC 紀錄 - rpc FindLatestKYCByUID (FindLatestKYCByUIDReq) returns (KYC); - // FindKYCByID 根據 KYC ID 查詢 - rpc FindKYCByID (FindKYCByIDReq) returns (KYC); - // ListKYC 分頁查詢 KYC 清單(後台審核用) - rpc ListKYC (ListKYCReq) returns (ListKYCResp); - // UpdateKYCStatus 更新 KYC 審核狀態與原因 - rpc UpdateKYCStatus (UpdateKYCStatusReq) returns (OKResp); - // UpdateKYCInfo 更新使用者的 KYC(尚未審核) - rpc UpdateKYCInfo (UpdateKYCInfoReq) returns (OKResp); - // ====================== Know You Customer Service End ====================== - // ====================== ProductItem Service Start ====================== - // CreateItem 建立 ProductItem - rpc CreateItem(CreateProductItemRequest) returns (OKResp); +service Product_Item_Service { + // Create 建立 ProductItem + rpc Create(CreateProductItemRequest) returns (OKResp); // GetProductItem 取得 ProductItem - rpc GetProductItem(GetProductItemRequest) returns (ProductItem); - // GetProductItemsByProductID 使用 ProductID 取得 ProductItems - rpc GetProductItemsByProductID(ListProductItemRequest) returns (ListProductItemResponse); - // DeleteProductItems 刪除 Delete Product Item - rpc DeleteProductItems(DeleteProductItemRequest) returns (OKResp); - // DeleteProductItemsByReferenceID 使用 ProductID 刪除所有 Item - rpc DeleteProductItemsByReferenceID(DeleteProductItemsByReferenceIDReq) returns (OKResp); + rpc Get(GetProductItemRequest) returns (ProductItem); + // ListByProductId 使用 ProductID 取得 ProductItems + rpc ListByProductId(ListProductItemRequest) returns (ListProductItemResponse); + // Delete 刪除 Delete Product Item + rpc Delete(DeleteProductItemRequest) returns (OKResp); + // DeleteByReferenceId 使用 ProductID 刪除所有 Item + rpc DeleteByReferenceId(DeleteProductItemsByReferenceIDReq) returns (OKResp); // IncSalesCount 增加賣出數量 rpc IncSalesCount(IncDecSalesCountRequest) returns (OKResp); // DecSalesCount 減少賣出數量 @@ -323,5 +326,4 @@ service Product { rpc Update(UpdateProductItemRequest) returns (OKResp); // UpdateStatus 更新 Item status rpc UpdateStatus(UpdateStatusRequest) returns (OKResp); - // ====================== ProductItem Service End ====================== } diff --git a/internal/logic/product/create_category_logic.go b/internal/logic/category_service/create_logic.go similarity index 63% rename from internal/logic/product/create_category_logic.go rename to internal/logic/category_service/create_logic.go index 0b74e4e..04c19b5 100644 --- a/internal/logic/product/create_category_logic.go +++ b/internal/logic/category_service/create_logic.go @@ -1,4 +1,4 @@ -package productlogic +package categoryservicelogic import ( "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/entity" @@ -10,22 +10,22 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type CreateCategoryLogic struct { +type CreateLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewCreateCategoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateCategoryLogic { - return &CreateCategoryLogic{ +func NewCreateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateLogic { + return &CreateLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -// CreateCategory 建立 product 分類 -func (l *CreateCategoryLogic) CreateCategory(in *product.CreateCategoryReq) (*product.OKResp, error) { +// Create 建立 product 分類 +func (l *CreateLogic) Create(in *product.CreateCategoryReq) (*product.OKResp, error) { err := l.svcCtx.CategoryUseCase.Insert(l.ctx, &entity.Category{ Name: in.GetName(), }) diff --git a/internal/logic/product/delete_category_logic.go b/internal/logic/category_service/delete_logic.go similarity index 59% rename from internal/logic/product/delete_category_logic.go rename to internal/logic/category_service/delete_logic.go index 2bd9a08..593c3dc 100644 --- a/internal/logic/product/delete_category_logic.go +++ b/internal/logic/category_service/delete_logic.go @@ -1,4 +1,4 @@ -package productlogic +package categoryservicelogic import ( "context" @@ -9,22 +9,22 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type DeleteCategoryLogic struct { +type DeleteLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewDeleteCategoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteCategoryLogic { - return &DeleteCategoryLogic{ +func NewDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteLogic { + return &DeleteLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -// DeleteCategory 刪除 product 分類 -func (l *DeleteCategoryLogic) DeleteCategory(in *product.CategoryReq) (*product.OKResp, error) { +// Delete 刪除 product 分類 +func (l *DeleteLogic) Delete(in *product.CategoryReq) (*product.OKResp, error) { err := l.svcCtx.CategoryUseCase.Delete(l.ctx, in.GetId()) if err != nil { return nil, err diff --git a/internal/logic/product/get_category_logic.go b/internal/logic/category_service/get_logic.go similarity index 67% rename from internal/logic/product/get_category_logic.go rename to internal/logic/category_service/get_logic.go index ed4f020..4b6ce53 100644 --- a/internal/logic/product/get_category_logic.go +++ b/internal/logic/category_service/get_logic.go @@ -1,4 +1,4 @@ -package productlogic +package categoryservicelogic import ( "context" @@ -9,22 +9,22 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type GetCategoryLogic struct { +type GetLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewGetCategoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetCategoryLogic { - return &GetCategoryLogic{ +func NewGetLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetLogic { + return &GetLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -// GetCategory 取得 product 分類 -func (l *GetCategoryLogic) GetCategory(in *product.CategoryReq) (*product.Category, error) { +// Get 取得 product 分類 +func (l *GetLogic) Get(in *product.CategoryReq) (*product.Category, error) { category, err := l.svcCtx.CategoryUseCase.FindOneByID(l.ctx, in.GetId()) if err != nil { return nil, err diff --git a/internal/logic/product/list_category_logic.go b/internal/logic/category_service/list_logic.go similarity index 54% rename from internal/logic/product/list_category_logic.go rename to internal/logic/category_service/list_logic.go index 272cf52..e09b277 100644 --- a/internal/logic/product/list_category_logic.go +++ b/internal/logic/category_service/list_logic.go @@ -1,4 +1,4 @@ -package productlogic +package categoryservicelogic import ( "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase" @@ -10,22 +10,22 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type ListCategoryLogic struct { +type ListLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewListCategoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListCategoryLogic { - return &ListCategoryLogic{ +func NewListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListLogic { + return &ListLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -// ListCategory 建立 product 分類 -func (l *ListCategoryLogic) ListCategory(in *product.ListCategoryReq) (*product.ListCategoryResp, error) { +// List 建立 product 分類 +func (l *ListLogic) List(in *product.ListCategoryReq) (*product.ListCategoryResp, error) { q := usecase.CategoryQueryParams{ PageSize: in.GetPageSize(), PageIndex: in.GetPageIndex(), @@ -35,18 +35,18 @@ func (l *ListCategoryLogic) ListCategory(in *product.ListCategoryReq) (*product. q.ID = in.GetIds() } - categorys, total, err := l.svcCtx.CategoryUseCase.ListCategory(l.ctx, q) + category, total, err := l.svcCtx.CategoryUseCase.ListCategory(l.ctx, q) if err != nil { return nil, err } - res := make([]*product.Category, 0, len(categorys)) - for _, category := range categorys { + res := make([]*product.Category, 0, len(category)) + for _, c := range category { res = append(res, &product.Category{ - Id: category.ID.Hex(), - Name: category.Name, - CreateTime: category.CreatedAt, - UpdateTime: category.UpdatedAt, + Id: c.ID.Hex(), + Name: c.Name, + CreateTime: c.CreatedAt, + UpdateTime: c.UpdatedAt, }) } diff --git a/internal/logic/product/modify_category_logic.go b/internal/logic/category_service/modify_logic.go similarity index 63% rename from internal/logic/product/modify_category_logic.go rename to internal/logic/category_service/modify_logic.go index 3e215bc..8714324 100644 --- a/internal/logic/product/modify_category_logic.go +++ b/internal/logic/category_service/modify_logic.go @@ -1,4 +1,4 @@ -package productlogic +package categoryservicelogic import ( "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/entity" @@ -10,22 +10,22 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type ModifyCategoryLogic struct { +type ModifyLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewModifyCategoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ModifyCategoryLogic { - return &ModifyCategoryLogic{ +func NewModifyLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ModifyLogic { + return &ModifyLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -// ModifyCategory 修改 product 分類名稱 -func (l *ModifyCategoryLogic) ModifyCategory(in *product.ModifyCategoryReq) (*product.OKResp, error) { +// Modify 修改 product 分類名稱 +func (l *ModifyLogic) Modify(in *product.ModifyCategoryReq) (*product.OKResp, error) { err := l.svcCtx.CategoryUseCase.Update(l.ctx, in.GetId(), &entity.Category{Name: in.GetName()}) if err != nil { return nil, err diff --git a/internal/logic/product/create_k_y_c_logic.go b/internal/logic/kyc_service/create_logic.go similarity index 83% rename from internal/logic/product/create_k_y_c_logic.go rename to internal/logic/kyc_service/create_logic.go index 5cb98d7..77362dd 100644 --- a/internal/logic/product/create_k_y_c_logic.go +++ b/internal/logic/kyc_service/create_logic.go @@ -1,30 +1,32 @@ -package productlogic +package kycservicelogic import ( - "code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product" - "code.30cm.net/digimon/app-cloudep-product-service/internal/svc" "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/entity" "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/kyc" "context" + "code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product" + "code.30cm.net/digimon/app-cloudep-product-service/internal/svc" + "github.com/zeromicro/go-zero/core/logx" ) -type CreateKYCLogic struct { +type CreateLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewCreateKYCLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateKYCLogic { - return &CreateKYCLogic{ +func NewCreateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateLogic { + return &CreateLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -func (l *CreateKYCLogic) CreateKYC(in *product.CreateKYCReq) (*product.OKResp, error) { +// Create 建立 KYC 資料 +func (l *CreateLogic) Create(in *product.CreateKycReq) (*product.OKResp, error) { err := l.svcCtx.KYCUseCase.Create(l.ctx, &entity.KYC{ UID: in.GetUid(), CountryRegion: in.GetCountryRegion(), diff --git a/internal/logic/product/find_k_y_c_by_i_d_logic.go b/internal/logic/kyc_service/find_by_id_logic.go similarity index 80% rename from internal/logic/product/find_k_y_c_by_i_d_logic.go rename to internal/logic/kyc_service/find_by_id_logic.go index 1dfcc1a..151cb85 100644 --- a/internal/logic/product/find_k_y_c_by_i_d_logic.go +++ b/internal/logic/kyc_service/find_by_id_logic.go @@ -1,4 +1,4 @@ -package productlogic +package kycservicelogic import ( "context" @@ -9,28 +9,28 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type FindKYCByIDLogic struct { +type FindByIdLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewFindKYCByIDLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FindKYCByIDLogic { - return &FindKYCByIDLogic{ +func NewFindByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FindByIdLogic { + return &FindByIdLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -// FindKYCByID 根據 KYC ID 查詢 -func (l *FindKYCByIDLogic) FindKYCByID(in *product.FindKYCByIDReq) (*product.KYC, error) { +// FindById 根據 KYC ID 查詢 +func (l *FindByIdLogic) FindById(in *product.FindKycByIDReq) (*product.Kyc, error) { kycInfo, err := l.svcCtx.KYCUseCase.FindByID(l.ctx, in.GetId()) if err != nil { return nil, err } - return &product.KYC{ + return &product.Kyc{ Id: kycInfo.ID.Hex(), Uid: kycInfo.UID, CountryRegion: kycInfo.CountryRegion, diff --git a/internal/logic/product/find_latest_k_y_c_by_u_i_d_logic.go b/internal/logic/kyc_service/find_latest_by_uid_logic.go similarity index 77% rename from internal/logic/product/find_latest_k_y_c_by_u_i_d_logic.go rename to internal/logic/kyc_service/find_latest_by_uid_logic.go index 2c4edff..d63f1b7 100644 --- a/internal/logic/product/find_latest_k_y_c_by_u_i_d_logic.go +++ b/internal/logic/kyc_service/find_latest_by_uid_logic.go @@ -1,4 +1,4 @@ -package productlogic +package kycservicelogic import ( "context" @@ -9,28 +9,28 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type FindLatestKYCByUIDLogic struct { +type FindLatestByUidLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewFindLatestKYCByUIDLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FindLatestKYCByUIDLogic { - return &FindLatestKYCByUIDLogic{ +func NewFindLatestByUidLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FindLatestByUidLogic { + return &FindLatestByUidLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -// FindLatestKYCByUID 根據使用者 UID 查詢最新 KYC 紀錄 -func (l *FindLatestKYCByUIDLogic) FindLatestKYCByUID(in *product.FindLatestKYCByUIDReq) (*product.KYC, error) { +// FindLatestByUid 根據使用者 UID 查詢最新 KYC 紀錄 +func (l *FindLatestByUidLogic) FindLatestByUid(in *product.FindLatestKycByUIDReq) (*product.Kyc, error) { kycInfo, err := l.svcCtx.KYCUseCase.FindLatestByUID(l.ctx, in.GetUid()) if err != nil { return nil, err } - return &product.KYC{ + return &product.Kyc{ Id: kycInfo.ID.Hex(), Uid: kycInfo.UID, CountryRegion: kycInfo.CountryRegion, diff --git a/internal/logic/product/list_k_y_c_logic.go b/internal/logic/kyc_service/list_logic.go similarity index 79% rename from internal/logic/product/list_k_y_c_logic.go rename to internal/logic/kyc_service/list_logic.go index d2bad49..b913082 100644 --- a/internal/logic/product/list_k_y_c_logic.go +++ b/internal/logic/kyc_service/list_logic.go @@ -1,4 +1,4 @@ -package productlogic +package kycservicelogic import ( "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase" @@ -10,22 +10,22 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type ListKYCLogic struct { +type ListLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewListKYCLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListKYCLogic { - return &ListKYCLogic{ +func NewListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListLogic { + return &ListLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -// ListKYC 分頁查詢 KYC 清單(後台審核用) -func (l *ListKYCLogic) ListKYC(in *product.ListKYCReq) (*product.ListKYCResp, error) { +// List 分頁查詢 Kyc 清單(後台審核用) +func (l *ListLogic) List(in *product.ListKycReq) (*product.ListKycResp, error) { filter := usecase.KYCQueryParams{ UID: in.Uid, Country: in.Country, @@ -39,9 +39,9 @@ func (l *ListKYCLogic) ListKYC(in *product.ListKYCReq) (*product.ListKYCResp, er return nil, err } - result := make([]*product.KYC, 0, len(list)) + result := make([]*product.Kyc, 0, len(list)) for _, kycInfo := range list { - result = append(result, &product.KYC{ + result = append(result, &product.Kyc{ Id: kycInfo.ID.Hex(), Uid: kycInfo.UID, CountryRegion: kycInfo.CountryRegion, @@ -65,7 +65,7 @@ func (l *ListKYCLogic) ListKYC(in *product.ListKYCReq) (*product.ListKYCResp, er }) } - return &product.ListKYCResp{ + return &product.ListKycResp{ Total: total, List: result, }, nil diff --git a/internal/logic/product/update_k_y_c_info_logic.go b/internal/logic/kyc_service/update_logic.go similarity index 80% rename from internal/logic/product/update_k_y_c_info_logic.go rename to internal/logic/kyc_service/update_logic.go index 0f0e96c..4c6f0a6 100644 --- a/internal/logic/product/update_k_y_c_info_logic.go +++ b/internal/logic/kyc_service/update_logic.go @@ -1,4 +1,4 @@ -package productlogic +package kycservicelogic import ( "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase" @@ -11,22 +11,22 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type UpdateKYCInfoLogic struct { +type UpdateLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewUpdateKYCInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateKYCInfoLogic { - return &UpdateKYCInfoLogic{ +func NewUpdateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateLogic { + return &UpdateLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -// UpdateKYCInfo 更新使用者的 KYC(尚未審核) -func (l *UpdateKYCInfoLogic) UpdateKYCInfo(in *product.UpdateKYCInfoReq) (*product.OKResp, error) { +// Update 更新使用者的 Kyc(尚未審核) +func (l *UpdateLogic) Update(in *product.UpdateKycInfoReq) (*product.OKResp, error) { // 如果已完成應該不能 err := l.svcCtx.KYCUseCase.UpdateKYCInfo(l.ctx, in.GetId(), &usecase.KYCUpdateParams{ Name: proto.String(in.GetName()), diff --git a/internal/logic/product/update_k_y_c_status_logic.go b/internal/logic/kyc_service/update_status_logic.go similarity index 59% rename from internal/logic/product/update_k_y_c_status_logic.go rename to internal/logic/kyc_service/update_status_logic.go index 10f9dbc..a4a65e3 100644 --- a/internal/logic/product/update_k_y_c_status_logic.go +++ b/internal/logic/kyc_service/update_status_logic.go @@ -1,4 +1,4 @@ -package productlogic +package kycservicelogic import ( "context" @@ -9,22 +9,22 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type UpdateKYCStatusLogic struct { +type UpdateStatusLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewUpdateKYCStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateKYCStatusLogic { - return &UpdateKYCStatusLogic{ +func NewUpdateStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateStatusLogic { + return &UpdateStatusLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -// UpdateKYCStatus 更新 KYC 審核狀態與原因 -func (l *UpdateKYCStatusLogic) UpdateKYCStatus(in *product.UpdateKYCStatusReq) (*product.OKResp, error) { +// UpdateStatus 更新 Kyc 審核狀態與原因 +func (l *UpdateStatusLogic) UpdateStatus(in *product.UpdateKycStatusReq) (*product.OKResp, error) { err := l.svcCtx.KYCUseCase.UpdateStatus(l.ctx, in.GetId(), in.GetStatus(), in.GetReason()) if err != nil { return nil, err diff --git a/internal/logic/product/list_tags_logic.go b/internal/logic/product/list_tags_logic.go deleted file mode 100644 index 0d5f9f0..0000000 --- a/internal/logic/product/list_tags_logic.go +++ /dev/null @@ -1,85 +0,0 @@ -package productlogic - -import ( - "code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product" - "code.30cm.net/digimon/app-cloudep-product-service/internal/svc" - "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/entity" - domain "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/product" - "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase" - "context" - "github.com/zeromicro/go-zero/core/logx" -) - -type ListTagsLogic struct { - ctx context.Context - svcCtx *svc.ServiceContext - logx.Logger -} - -func NewListTagsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListTagsLogic { - return &ListTagsLogic{ - ctx: ctx, - svcCtx: svcCtx, - Logger: logx.WithContext(ctx), - } -} - -// ListTags 建立 tags -func (l *ListTagsLogic) ListTags(in *product.ListTagsReq) (*product.ListTagsResp, error) { - tags := make([]*entity.Tags, 0) - var err error - var total int64 - - if len(in.GetIds()) > 0 { - tags, err = l.svcCtx.TagsUseCase.GetByIDs(l.ctx, in.GetIds()) - if err != nil { - return nil, err - } - total = int64(len(tags)) - } else { - q := usecase.TagQueryParams{ - PageSize: in.GetPageSize(), - PageIndex: in.GetPageIndex(), - } - if in.Name != nil { - q.Name = in.Name - } - if in.Types != nil { - t, err := safeItemType(*in.Types) - if err != nil { - return nil, err - } - q.Types = &t - } - if in.ShowType != nil { - st := domain.ShowType(*in.ShowType) - q.ShowType = &st - } - - tags, total, err = l.svcCtx.TagsUseCase.List(l.ctx, q) - if err != nil { - return nil, err - } - } - - result := make([]*product.Tags, 0, len(tags)) - for _, tag := range tags { - r := &product.Tags{Id: tag.ID.Hex(), - Types: int32(tag.Types), - Name: tag.Name, - ShowType: int64(tag.ShowType), - UpdateAt: tag.UpdatedAt, - CreatedAt: tag.CreatedAt, - } - if tag.Cover != nil { - r.Cover = *tag.Cover - } - - result = append(result, r) - } - - return &product.ListTagsResp{ - Total: total, - Data: result, - }, nil -} diff --git a/internal/logic/product/update_logic.go b/internal/logic/product/update_logic.go deleted file mode 100644 index 604998a..0000000 --- a/internal/logic/product/update_logic.go +++ /dev/null @@ -1,37 +0,0 @@ -package productlogic - -import ( - "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase" - "context" - - "code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product" - "code.30cm.net/digimon/app-cloudep-product-service/internal/svc" - - "github.com/zeromicro/go-zero/core/logx" -) - -type UpdateLogic struct { - ctx context.Context - svcCtx *svc.ServiceContext - logx.Logger -} - -func NewUpdateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateLogic { - return &UpdateLogic{ - ctx: ctx, - svcCtx: svcCtx, - Logger: logx.WithContext(ctx), - } -} - -// Update 更新 Item -func (l *UpdateLogic) Update(in *product.UpdateProductItemRequest) (*product.OKResp, error) { - update := &usecase.UpdateProductItems{} - - err := l.svcCtx.ProductItemUseCase.Update(l.ctx, in.GetId(), update) - if err != nil { - return nil, err - } - - return &product.OKResp{}, nil -} diff --git a/internal/logic/product/create_item_logic.go b/internal/logic/product_item_service/create_logic.go similarity index 89% rename from internal/logic/product/create_item_logic.go rename to internal/logic/product_item_service/create_logic.go index d8c0b92..3c56a90 100644 --- a/internal/logic/product/create_item_logic.go +++ b/internal/logic/product_item_service/create_logic.go @@ -1,4 +1,4 @@ -package productlogic +package productitemservicelogic import ( "code.30cm.net/digimon/app-cloudep-product-service/internal/utils" @@ -13,21 +13,22 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type CreateItemLogic struct { +type CreateLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewCreateItemLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateItemLogic { - return &CreateItemLogic{ +func NewCreateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateLogic { + return &CreateLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -func (l *CreateItemLogic) CreateItem(in *PB.CreateProductItemRequest) (*PB.OKResp, error) { +// Create 建立 ProductItem +func (l *CreateLogic) Create(in *PB.CreateProductItemRequest) (*PB.OKResp, error) { insert := &usecase.ProductItems{ ReferenceID: in.GetItem().ReferenceId, // 對應的專案 ID Name: in.GetItem().Name, // 名稱 @@ -43,8 +44,9 @@ func (l *CreateItemLogic) CreateItem(in *PB.CreateProductItemRequest) (*PB.OKRes if len(in.GetItem().Media) > 0 { // 專案動態內容(圖片或者影片) m := make([]usecase.Media, 0, len(in.GetItem().Media)) - for _, item := range in.GetItem().Media { + for i, item := range in.GetItem().Media { m = append(m, usecase.Media{ + Sort: uint64(i), URL: item.Url, Type: item.Type, }) diff --git a/internal/logic/product/dec_sales_count_logic.go b/internal/logic/product_item_service/dec_sales_count_logic.go similarity index 96% rename from internal/logic/product/dec_sales_count_logic.go rename to internal/logic/product_item_service/dec_sales_count_logic.go index ef88d04..67ef0ba 100644 --- a/internal/logic/product/dec_sales_count_logic.go +++ b/internal/logic/product_item_service/dec_sales_count_logic.go @@ -1,4 +1,4 @@ -package productlogic +package productitemservicelogic import ( "context" diff --git a/internal/logic/product/delete_product_items_by_reference_i_d_logic.go b/internal/logic/product_item_service/delete_by_reference_id_logic.go similarity index 50% rename from internal/logic/product/delete_product_items_by_reference_i_d_logic.go rename to internal/logic/product_item_service/delete_by_reference_id_logic.go index 1087f77..52bf59c 100644 --- a/internal/logic/product/delete_product_items_by_reference_i_d_logic.go +++ b/internal/logic/product_item_service/delete_by_reference_id_logic.go @@ -1,4 +1,4 @@ -package productlogic +package productitemservicelogic import ( "context" @@ -9,22 +9,22 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type DeleteProductItemsByReferenceIDLogic struct { +type DeleteByReferenceIdLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewDeleteProductItemsByReferenceIDLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteProductItemsByReferenceIDLogic { - return &DeleteProductItemsByReferenceIDLogic{ +func NewDeleteByReferenceIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteByReferenceIdLogic { + return &DeleteByReferenceIdLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -// DeleteProductItemsByReferenceID 使用 ProductID 刪除所有 Item -func (l *DeleteProductItemsByReferenceIDLogic) DeleteProductItemsByReferenceID(in *product.DeleteProductItemsByReferenceIDReq) (*product.OKResp, error) { +// DeleteByReferenceId 使用 ProductID 刪除所有 Item +func (l *DeleteByReferenceIdLogic) DeleteByReferenceId(in *product.DeleteProductItemsByReferenceIDReq) (*product.OKResp, error) { err := l.svcCtx.ProductItemUseCase.DeleteByReferenceID(l.ctx, in.GetId()) if err != nil { return nil, err diff --git a/internal/logic/product/delete_product_items_logic.go b/internal/logic/product_item_service/delete_logic.go similarity index 56% rename from internal/logic/product/delete_product_items_logic.go rename to internal/logic/product_item_service/delete_logic.go index 45fa1a2..3b0a469 100644 --- a/internal/logic/product/delete_product_items_logic.go +++ b/internal/logic/product_item_service/delete_logic.go @@ -1,4 +1,4 @@ -package productlogic +package productitemservicelogic import ( "context" @@ -9,22 +9,22 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type DeleteProductItemsLogic struct { +type DeleteLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewDeleteProductItemsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteProductItemsLogic { - return &DeleteProductItemsLogic{ +func NewDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteLogic { + return &DeleteLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -// DeleteProductItems 刪除 Delete Product Item -func (l *DeleteProductItemsLogic) DeleteProductItems(in *product.DeleteProductItemRequest) (*product.OKResp, error) { +// Delete 刪除 Delete Product Item +func (l *DeleteLogic) Delete(in *product.DeleteProductItemRequest) (*product.OKResp, error) { err := l.svcCtx.ProductItemUseCase.Delete(l.ctx, in.GetId()) if err != nil { return nil, err diff --git a/internal/logic/product/get_product_item_logic.go b/internal/logic/product_item_service/get_logic.go similarity index 80% rename from internal/logic/product/get_product_item_logic.go rename to internal/logic/product_item_service/get_logic.go index d7cfdbe..4b64b46 100644 --- a/internal/logic/product/get_product_item_logic.go +++ b/internal/logic/product_item_service/get_logic.go @@ -1,4 +1,4 @@ -package productlogic +package productitemservicelogic import ( "code.30cm.net/digimon/app-cloudep-product-service/internal/utils" @@ -11,22 +11,22 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type GetProductItemLogic struct { +type GetLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewGetProductItemLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetProductItemLogic { - return &GetProductItemLogic{ +func NewGetLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetLogic { + return &GetLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -// GetProductItem 取得 ProductItem -func (l *GetProductItemLogic) GetProductItem(in *product.GetProductItemRequest) (*product.ProductItem, error) { +// Get 取得 ProductItem +func (l *GetLogic) Get(in *product.GetProductItemRequest) (*product.ProductItem, error) { item, err := l.svcCtx.ProductItemUseCase.Get(l.ctx, in.GetId()) if err != nil { return nil, err @@ -46,8 +46,8 @@ func (l *GetProductItemLogic) GetProductItem(in *product.GetProductItemRequest) TimeSeries: item.TimeSeries.ToString(), SalesCount: item.SalesCount, Status: item.Status.ToString(), - UpdatedAt: proto.String(item.UpdatedAt), - CreatedAt: proto.String(item.CreatedAt), + UpdatedAt: &item.UpdatedAt, + CreatedAt: &item.CreatedAt, } media := make([]*product.Media, 0, len(item.Media)) for _, pi := range item.Media { diff --git a/internal/logic/product/inc_sales_count_logic.go b/internal/logic/product_item_service/inc_sales_count_logic.go similarity index 96% rename from internal/logic/product/inc_sales_count_logic.go rename to internal/logic/product_item_service/inc_sales_count_logic.go index afab98f..1417e6b 100644 --- a/internal/logic/product/inc_sales_count_logic.go +++ b/internal/logic/product_item_service/inc_sales_count_logic.go @@ -1,4 +1,4 @@ -package productlogic +package productitemservicelogic import ( "context" @@ -30,6 +30,6 @@ func (l *IncSalesCountLogic) IncSalesCount(in *product.IncDecSalesCountRequest) if err != nil { return nil, err } - + return &product.OKResp{}, nil } diff --git a/internal/logic/product/get_product_items_by_product_i_d_logic.go b/internal/logic/product_item_service/list_by_product_id_logic.go similarity index 83% rename from internal/logic/product/get_product_items_by_product_i_d_logic.go rename to internal/logic/product_item_service/list_by_product_id_logic.go index 26a209b..c892704 100644 --- a/internal/logic/product/get_product_items_by_product_i_d_logic.go +++ b/internal/logic/product_item_service/list_by_product_id_logic.go @@ -1,4 +1,4 @@ -package productlogic +package productitemservicelogic import ( "code.30cm.net/digimon/app-cloudep-product-service/internal/utils" @@ -14,22 +14,22 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type GetProductItemsByProductIDLogic struct { +type ListByProductIdLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewGetProductItemsByProductIDLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetProductItemsByProductIDLogic { - return &GetProductItemsByProductIDLogic{ +func NewListByProductIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListByProductIdLogic { + return &ListByProductIdLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -// GetProductItemsByProductID 使用 ProductID 取得 ProductItems -func (l *GetProductItemsByProductIDLogic) GetProductItemsByProductID(in *PB.ListProductItemRequest) (*PB.ListProductItemResponse, error) { +// ListByProductId 使用 ProductID 取得 ProductItems +func (l *ListByProductIdLogic) ListByProductId(in *PB.ListProductItemRequest) (*PB.ListProductItemResponse, error) { filter := usecase.QueryProductItemParam{ PageSize: in.GetPageSize(), PageIndex: in.GetPageIndex(), @@ -70,8 +70,8 @@ func (l *GetProductItemsByProductIDLogic) GetProductItemsByProductID(in *PB.List TimeSeries: item.TimeSeries.ToString(), SalesCount: item.SalesCount, Status: item.Status.ToString(), - UpdatedAt: proto.String(item.UpdatedAt), - CreatedAt: proto.String(item.CreatedAt), + UpdatedAt: &item.UpdatedAt, + CreatedAt: &item.CreatedAt, } media := make([]*PB.Media, 0, len(item.Media)) diff --git a/internal/logic/product_item_service/update_logic.go b/internal/logic/product_item_service/update_logic.go new file mode 100644 index 0000000..0c24dac --- /dev/null +++ b/internal/logic/product_item_service/update_logic.go @@ -0,0 +1,88 @@ +package productitemservicelogic + +import ( + "code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product" + "code.30cm.net/digimon/app-cloudep-product-service/internal/svc" + domain "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/product" + "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase" + "code.30cm.net/digimon/library-go/errs" + "context" + + "github.com/zeromicro/go-zero/core/logx" +) + +type UpdateLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewUpdateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateLogic { + return &UpdateLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +// Update 更新 Item +func (l *UpdateLogic) Update(in *product.UpdateProductItemRequest) (*product.OKResp, error) { + update := &usecase.UpdateProductItems{ + Name: in.Name, + Description: in.Description, + ShortDescription: in.ShortDescription, + IsUnLimit: in.IsUnLimit, + IsFree: in.IsFree, + Stock: in.Stock, + Price: in.Price, + SKU: in.Sku, + } + if in.TimeSeries != nil { + ts, status := domain.StringToTimeSeries(in.GetTimeSeries()) + if !status { + return nil, errs.InvalidFormat("timeSeries") + } + update.TimeSeries = &ts + } + if len(in.GetMedia()) > 0 { + // 專案動態內容(圖片或者影片) + m := make([]usecase.Media, 0, len(in.GetMedia())) + for _, item := range in.GetMedia() { + m = append(m, usecase.Media{ + Sort: *item.Sort, + URL: item.Url, + Type: item.Type, + }) + } + update.Media = m + } + if len(in.GetCustomFields()) > 0 { + // 自定義屬性 + c := make([]usecase.CustomFields, 0, len(in.GetCustomFields())) + for _, cItem := range in.GetCustomFields() { + c = append(c, usecase.CustomFields{ + Key: cItem.Key, + Value: cItem.Value, + }) + } + update.CustomFields = c + } + if len(in.GetFreight()) > 0 { + // 運費 + f := make([]usecase.CustomFields, 0, len(in.GetFreight())) + for _, fItem := range in.GetFreight() { + f = append(f, usecase.CustomFields{ + Key: fItem.Key, + Value: fItem.Value, + }) + } + update.Freight = f + } + + err := l.svcCtx.ProductItemUseCase.Update(l.ctx, in.GetId(), update) + if err != nil { + return nil, err + } + + return &product.OKResp{}, nil +} diff --git a/internal/logic/product/update_status_logic.go b/internal/logic/product_item_service/update_status_logic.go similarity index 97% rename from internal/logic/product/update_status_logic.go rename to internal/logic/product_item_service/update_status_logic.go index 423ff5d..a06f142 100644 --- a/internal/logic/product/update_status_logic.go +++ b/internal/logic/product_item_service/update_status_logic.go @@ -1,4 +1,4 @@ -package productlogic +package productitemservicelogic import ( "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/product" diff --git a/internal/logic/product/create_tags_logic.go b/internal/logic/tag_service/create_logic.go similarity index 51% rename from internal/logic/product/create_tags_logic.go rename to internal/logic/tag_service/create_logic.go index e406737..e7b062f 100644 --- a/internal/logic/product/create_tags_logic.go +++ b/internal/logic/tag_service/create_logic.go @@ -1,59 +1,55 @@ -package productlogic +package tagservicelogic import ( + "code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product" + "code.30cm.net/digimon/app-cloudep-product-service/internal/svc" "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/entity" domainProduct "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/product" "code.30cm.net/digimon/library-go/errs" "context" - "fmt" - - "code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product" - "code.30cm.net/digimon/app-cloudep-product-service/internal/svc" "github.com/zeromicro/go-zero/core/logx" ) -type CreateTagsLogic struct { +type CreateLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewCreateTagsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateTagsLogic { - return &CreateTagsLogic{ +func NewCreateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateLogic { + return &CreateLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -func (l *CreateTagsLogic) CreateTags(in *product.CreateTagsReq) (*product.OKResp, error) { - t, err := safeItemType(in.GetTypes()) - if err != nil { - return nil, errs.InvalidFormat("failed to validate item type") +// Create 建立 tags +func (l *CreateLogic) Create(in *product.CreateTagsReq) (*product.OKResp, error) { + showType, status := domainProduct.StringToShowType(in.GetShowType()) + if !status { + return nil, errs.InvalidFormat("failed to convert show types") } + itemTypes, itemStatus := domainProduct.StringToItemType(in.GetTypes()) + if !itemStatus { + return nil, errs.InvalidFormat("failed to convert types") + } insert := &entity.Tags{ - Types: t, + Types: itemTypes, Name: in.GetName(), - ShowType: domainProduct.ShowType(in.GetShowType()), + ShowType: showType, } if in.Cover != nil { insert.Cover = in.Cover } - err = l.svcCtx.TagsUseCase.Create(l.ctx, insert) + err := l.svcCtx.TagsUseCase.Create(l.ctx, insert) if err != nil { return nil, err } return &product.OKResp{}, nil } - -func safeItemType(t int32) (domainProduct.ItemType, error) { - if t < -128 || t > 127 { - return 0, fmt.Errorf("invalid ItemType value: %d", t) - } - return domainProduct.ItemType(t), nil -} diff --git a/internal/logic/product/delete_tags_logic.go b/internal/logic/tag_service/delete_logic.go similarity index 62% rename from internal/logic/product/delete_tags_logic.go rename to internal/logic/tag_service/delete_logic.go index 3ed1f14..7957452 100644 --- a/internal/logic/product/delete_tags_logic.go +++ b/internal/logic/tag_service/delete_logic.go @@ -1,4 +1,4 @@ -package productlogic +package tagservicelogic import ( "context" @@ -9,26 +9,26 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type DeleteTagsLogic struct { +type DeleteLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewDeleteTagsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteTagsLogic { - return &DeleteTagsLogic{ +func NewDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteLogic { + return &DeleteLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -// DeleteTags 刪除tags -func (l *DeleteTagsLogic) DeleteTags(in *product.TagsReq) (*product.OKResp, error) { +// Delete 刪除tags +func (l *DeleteLogic) Delete(in *product.TagsReq) (*product.OKResp, error) { err := l.svcCtx.TagsUseCase.Delete(l.ctx, in.GetId()) if err != nil { return nil, err } - + return &product.OKResp{}, nil } diff --git a/internal/logic/product/get_tags_logic.go b/internal/logic/tag_service/get_logic.go similarity index 66% rename from internal/logic/product/get_tags_logic.go rename to internal/logic/tag_service/get_logic.go index 915724c..0f228d1 100644 --- a/internal/logic/product/get_tags_logic.go +++ b/internal/logic/tag_service/get_logic.go @@ -1,4 +1,4 @@ -package productlogic +package tagservicelogic import ( "context" @@ -9,31 +9,31 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type GetTagsLogic struct { +type GetLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewGetTagsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetTagsLogic { - return &GetTagsLogic{ +func NewGetLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetLogic { + return &GetLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -// GetTags 取得 tags -func (l *GetTagsLogic) GetTags(in *product.TagsReq) (*product.Tags, error) { +// Get 取得 tags +func (l *GetLogic) Get(in *product.TagsReq) (*product.Tags, error) { tag, err := l.svcCtx.TagsUseCase.GetByID(l.ctx, in.GetId()) if err != nil { return nil, err } result := &product.Tags{Id: tag.ID.Hex(), - Types: int32(tag.Types), + Types: tag.Types.ToString(), Name: tag.Name, - ShowType: int64(tag.ShowType), + ShowType: tag.ShowType.ToString(), UpdateAt: tag.UpdatedAt, CreatedAt: tag.CreatedAt, } diff --git a/internal/logic/tag_service/list_logic.go b/internal/logic/tag_service/list_logic.go new file mode 100644 index 0000000..3febc64 --- /dev/null +++ b/internal/logic/tag_service/list_logic.go @@ -0,0 +1,91 @@ +package tagservicelogic + +import ( + "code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product" + "code.30cm.net/digimon/app-cloudep-product-service/internal/svc" + "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/entity" + domain "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/product" + "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase" + "code.30cm.net/digimon/library-go/errs" + "context" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ListLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListLogic { + return &ListLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *ListLogic) List(in *product.ListTagsReq) (*product.ListTagsResp, error) { + if len(in.GetIds()) > 0 { + tags, err := l.svcCtx.TagsUseCase.GetByIDs(l.ctx, in.GetIds()) + if err != nil { + return nil, err + } + return buildTagResp(tags, int64(len(tags))), nil + } + + // 查詢條件轉換 + q := usecase.TagQueryParams{ + PageSize: in.GetPageSize(), + PageIndex: in.GetPageIndex(), + } + + if in.Name != nil { + q.Name = in.Name + } + if in.Types != nil { + itemTypes, ok := domain.StringToItemType(in.GetTypes()) + if !ok { + return nil, errs.InvalidFormat("failed to convert types") + } + q.Types = &itemTypes + } + if in.ShowType != nil { + showType, ok := domain.StringToShowType(in.GetShowType()) + if !ok { + return nil, errs.InvalidFormat("failed to convert show types") + } + q.ShowType = &showType + } + + tags, total, err := l.svcCtx.TagsUseCase.List(l.ctx, q) + if err != nil { + return nil, err + } + + return buildTagResp(tags, total), nil +} + +func buildTagResp(tags []*entity.Tags, total int64) *product.ListTagsResp { + result := make([]*product.Tags, 0, len(tags)) + for _, tag := range tags { + r := &product.Tags{ + Id: tag.ID.Hex(), + Types: tag.Types.ToString(), + Name: tag.Name, + ShowType: tag.ShowType.ToString(), + UpdateAt: tag.UpdatedAt, + CreatedAt: tag.CreatedAt, + } + if tag.Cover != nil { + r.Cover = *tag.Cover + } + result = append(result, r) + } + + return &product.ListTagsResp{ + Total: total, + Data: result, + } +} diff --git a/internal/logic/product/modify_tags_logic.go b/internal/logic/tag_service/modify_logic.go similarity index 58% rename from internal/logic/product/modify_tags_logic.go rename to internal/logic/tag_service/modify_logic.go index 3b9a4c8..060c228 100644 --- a/internal/logic/product/modify_tags_logic.go +++ b/internal/logic/tag_service/modify_logic.go @@ -1,8 +1,9 @@ -package productlogic +package tagservicelogic import ( domain "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/product" "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase" + "code.30cm.net/digimon/library-go/errs" "context" "code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product" @@ -11,44 +12,42 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type ModifyTagsLogic struct { +type ModifyLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewModifyTagsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ModifyTagsLogic { - return &ModifyTagsLogic{ +func NewModifyLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ModifyLogic { + return &ModifyLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -// ModifyTags 修改 tags -func (l *ModifyTagsLogic) ModifyTags(in *product.ModifyTagsReq) (*product.OKResp, error) { +// Modify 修改 tags +func (l *ModifyLogic) Modify(in *product.ModifyTagsReq) (*product.OKResp, error) { var params usecase.TagModifyParams - // 處理 types(int32 → ItemType) if in.Types != nil { - t, err := safeItemType(*in.Types) - if err != nil { - return nil, err + itemTypes, ok := domain.StringToItemType(in.GetTypes()) + if !ok { + return nil, errs.InvalidFormat("failed to convert types") } - params.Types = &t + params.Types = &itemTypes + } + if in.ShowType != nil { + showType, ok := domain.StringToShowType(in.GetShowType()) + if !ok { + return nil, errs.InvalidFormat("failed to convert show types") + } + params.ShowType = &showType } - // 處理 name if in.Name != nil { params.Name = in.Name } - - // 處理 show_type(int64 → ShowType) - if in.ShowType != nil { - st := domain.ShowType(*in.ShowType) - params.ShowType = &st - } - // 處理 cover if in.Cover != nil { params.Cover = in.Cover diff --git a/internal/server/category_service/category_service_server.go b/internal/server/category_service/category_service_server.go new file mode 100644 index 0000000..8c17628 --- /dev/null +++ b/internal/server/category_service/category_service_server.go @@ -0,0 +1,54 @@ +// 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/category_service" + "code.30cm.net/digimon/app-cloudep-product-service/internal/svc" +) + +type CategoryServiceServer struct { + svcCtx *svc.ServiceContext + product.UnimplementedCategory_ServiceServer +} + +func NewCategoryServiceServer(svcCtx *svc.ServiceContext) *CategoryServiceServer { + return &CategoryServiceServer{ + svcCtx: svcCtx, + } +} + +// Create 建立 product 分類 +func (s *CategoryServiceServer) Create(ctx context.Context, in *product.CreateCategoryReq) (*product.OKResp, error) { + l := categoryservicelogic.NewCreateLogic(ctx, s.svcCtx) + return l.Create(in) +} + +// Modify 修改 product 分類名稱 +func (s *CategoryServiceServer) Modify(ctx context.Context, in *product.ModifyCategoryReq) (*product.OKResp, error) { + l := categoryservicelogic.NewModifyLogic(ctx, s.svcCtx) + return l.Modify(in) +} + +// Delete 刪除 product 分類 +func (s *CategoryServiceServer) Delete(ctx context.Context, in *product.CategoryReq) (*product.OKResp, error) { + l := categoryservicelogic.NewDeleteLogic(ctx, s.svcCtx) + return l.Delete(in) +} + +// Get 取得 product 分類 +func (s *CategoryServiceServer) Get(ctx context.Context, in *product.CategoryReq) (*product.Category, error) { + l := categoryservicelogic.NewGetLogic(ctx, s.svcCtx) + return l.Get(in) +} + +// List 建立 product 分類 +func (s *CategoryServiceServer) List(ctx context.Context, in *product.ListCategoryReq) (*product.ListCategoryResp, error) { + l := categoryservicelogic.NewListLogic(ctx, s.svcCtx) + return l.List(in) +} diff --git a/internal/server/kyc_service/kyc_service_server.go b/internal/server/kyc_service/kyc_service_server.go new file mode 100644 index 0000000..c130fd8 --- /dev/null +++ b/internal/server/kyc_service/kyc_service_server.go @@ -0,0 +1,60 @@ +// 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/kyc_service" + "code.30cm.net/digimon/app-cloudep-product-service/internal/svc" +) + +type KycServiceServer struct { + svcCtx *svc.ServiceContext + product.UnimplementedKyc_ServiceServer +} + +func NewKycServiceServer(svcCtx *svc.ServiceContext) *KycServiceServer { + return &KycServiceServer{ + svcCtx: svcCtx, + } +} + +// Create 建立 KYC 資料 +func (s *KycServiceServer) Create(ctx context.Context, in *product.CreateKycReq) (*product.OKResp, error) { + l := kycservicelogic.NewCreateLogic(ctx, s.svcCtx) + return l.Create(in) +} + +// FindLatestByUID 根據使用者 UID 查詢最新 KYC 紀錄 +func (s *KycServiceServer) FindLatestByUid(ctx context.Context, in *product.FindLatestKycByUIDReq) (*product.Kyc, error) { + l := kycservicelogic.NewFindLatestByUidLogic(ctx, s.svcCtx) + return l.FindLatestByUid(in) +} + +// FindByID 根據 KYC ID 查詢 +func (s *KycServiceServer) FindById(ctx context.Context, in *product.FindKycByIDReq) (*product.Kyc, error) { + l := kycservicelogic.NewFindByIdLogic(ctx, s.svcCtx) + return l.FindById(in) +} + +// List 分頁查詢 Kyc 清單(後台審核用) +func (s *KycServiceServer) List(ctx context.Context, in *product.ListKycReq) (*product.ListKycResp, error) { + l := kycservicelogic.NewListLogic(ctx, s.svcCtx) + return l.List(in) +} + +// UpdateStatus 更新 Kyc 審核狀態與原因 +func (s *KycServiceServer) UpdateStatus(ctx context.Context, in *product.UpdateKycStatusReq) (*product.OKResp, error) { + l := kycservicelogic.NewUpdateStatusLogic(ctx, s.svcCtx) + return l.UpdateStatus(in) +} + +// Update 更新使用者的 Kyc(尚未審核) +func (s *KycServiceServer) Update(ctx context.Context, in *product.UpdateKycInfoReq) (*product.OKResp, error) { + l := kycservicelogic.NewUpdateLogic(ctx, s.svcCtx) + return l.Update(in) +} diff --git a/internal/server/product/product_server.go b/internal/server/product/product_server.go deleted file mode 100644 index a6a8b64..0000000 --- a/internal/server/product/product_server.go +++ /dev/null @@ -1,174 +0,0 @@ -// 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) -} diff --git a/internal/server/product_item_service/product_item_service_server.go b/internal/server/product_item_service/product_item_service_server.go new file mode 100644 index 0000000..ced85db --- /dev/null +++ b/internal/server/product_item_service/product_item_service_server.go @@ -0,0 +1,78 @@ +// 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_item_service" + "code.30cm.net/digimon/app-cloudep-product-service/internal/svc" +) + +type ProductItemServiceServer struct { + svcCtx *svc.ServiceContext + product.UnimplementedProduct_Item_ServiceServer +} + +func NewProductItemServiceServer(svcCtx *svc.ServiceContext) *ProductItemServiceServer { + return &ProductItemServiceServer{ + svcCtx: svcCtx, + } +} + +// Create 建立 ProductItem +func (s *ProductItemServiceServer) Create(ctx context.Context, in *product.CreateProductItemRequest) (*product.OKResp, error) { + l := productitemservicelogic.NewCreateLogic(ctx, s.svcCtx) + return l.Create(in) +} + +// GetProductItem 取得 ProductItem +func (s *ProductItemServiceServer) Get(ctx context.Context, in *product.GetProductItemRequest) (*product.ProductItem, error) { + l := productitemservicelogic.NewGetLogic(ctx, s.svcCtx) + return l.Get(in) +} + +// ListByProductId 使用 ProductID 取得 ProductItems +func (s *ProductItemServiceServer) ListByProductId(ctx context.Context, in *product.ListProductItemRequest) (*product.ListProductItemResponse, error) { + l := productitemservicelogic.NewListByProductIdLogic(ctx, s.svcCtx) + return l.ListByProductId(in) +} + +// Delete 刪除 Delete Product Item +func (s *ProductItemServiceServer) Delete(ctx context.Context, in *product.DeleteProductItemRequest) (*product.OKResp, error) { + l := productitemservicelogic.NewDeleteLogic(ctx, s.svcCtx) + return l.Delete(in) +} + +// DeleteByReferenceId 使用 ProductID 刪除所有 Item +func (s *ProductItemServiceServer) DeleteByReferenceId(ctx context.Context, in *product.DeleteProductItemsByReferenceIDReq) (*product.OKResp, error) { + l := productitemservicelogic.NewDeleteByReferenceIdLogic(ctx, s.svcCtx) + return l.DeleteByReferenceId(in) +} + +// IncSalesCount 增加賣出數量 +func (s *ProductItemServiceServer) IncSalesCount(ctx context.Context, in *product.IncDecSalesCountRequest) (*product.OKResp, error) { + l := productitemservicelogic.NewIncSalesCountLogic(ctx, s.svcCtx) + return l.IncSalesCount(in) +} + +// DecSalesCount 減少賣出數量 +func (s *ProductItemServiceServer) DecSalesCount(ctx context.Context, in *product.IncDecSalesCountRequest) (*product.OKResp, error) { + l := productitemservicelogic.NewDecSalesCountLogic(ctx, s.svcCtx) + return l.DecSalesCount(in) +} + +// Update 更新 Item +func (s *ProductItemServiceServer) Update(ctx context.Context, in *product.UpdateProductItemRequest) (*product.OKResp, error) { + l := productitemservicelogic.NewUpdateLogic(ctx, s.svcCtx) + return l.Update(in) +} + +// UpdateStatus 更新 Item status +func (s *ProductItemServiceServer) UpdateStatus(ctx context.Context, in *product.UpdateStatusRequest) (*product.OKResp, error) { + l := productitemservicelogic.NewUpdateStatusLogic(ctx, s.svcCtx) + return l.UpdateStatus(in) +} diff --git a/internal/server/tag_service/tag_service_server.go b/internal/server/tag_service/tag_service_server.go new file mode 100644 index 0000000..6bb7273 --- /dev/null +++ b/internal/server/tag_service/tag_service_server.go @@ -0,0 +1,54 @@ +// 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/tag_service" + "code.30cm.net/digimon/app-cloudep-product-service/internal/svc" +) + +type TagServiceServer struct { + svcCtx *svc.ServiceContext + product.UnimplementedTag_ServiceServer +} + +func NewTagServiceServer(svcCtx *svc.ServiceContext) *TagServiceServer { + return &TagServiceServer{ + svcCtx: svcCtx, + } +} + +// CreateTags 建立 tags +func (s *TagServiceServer) Create(ctx context.Context, in *product.CreateTagsReq) (*product.OKResp, error) { + l := tagservicelogic.NewCreateLogic(ctx, s.svcCtx) + return l.Create(in) +} + +// ModifyTags 修改 tags +func (s *TagServiceServer) Modify(ctx context.Context, in *product.ModifyTagsReq) (*product.OKResp, error) { + l := tagservicelogic.NewModifyLogic(ctx, s.svcCtx) + return l.Modify(in) +} + +// DeleteTags 刪除tags +func (s *TagServiceServer) Delete(ctx context.Context, in *product.TagsReq) (*product.OKResp, error) { + l := tagservicelogic.NewDeleteLogic(ctx, s.svcCtx) + return l.Delete(in) +} + +// GetTags 取得 tags +func (s *TagServiceServer) Get(ctx context.Context, in *product.TagsReq) (*product.Tags, error) { + l := tagservicelogic.NewGetLogic(ctx, s.svcCtx) + return l.Get(in) +} + +// ListTags 建立 tags +func (s *TagServiceServer) List(ctx context.Context, in *product.ListTagsReq) (*product.ListTagsResp, error) { + l := tagservicelogic.NewListLogic(ctx, s.svcCtx) + return l.List(in) +} diff --git a/pkg/domain/product/item_types.go b/pkg/domain/product/item_types.go index e4fb565..d5040d9 100644 --- a/pkg/domain/product/item_types.go +++ b/pkg/domain/product/item_types.go @@ -8,3 +8,41 @@ const ( ItemTypeSkill // 技能專用 tag ItemTypeProduct // 專案用 ) + +func (t *ItemType) ToString() string { + s, _ := ItemTypeToString(*t) + return s +} + +const ( + ItemTypeUnknownStr = "unknown" + ItemTypeNormalStr = "normal" + ItemTypeSkillStr = "skill" + ItemTypeProductStr = "product" +) + +var itemTypeToStringMap = map[ItemType]string{ + ItemTypeUnknown: ItemTypeUnknownStr, + ItemTypeNormal: ItemTypeNormalStr, + ItemTypeSkill: ItemTypeSkillStr, + ItemTypeProduct: ItemTypeProductStr, +} + +var stringToItemTypeMap = map[string]ItemType{ + ItemTypeUnknownStr: ItemTypeUnknown, + ItemTypeNormalStr: ItemTypeNormal, + ItemTypeSkillStr: ItemTypeSkill, + ItemTypeProductStr: ItemTypeProduct, +} + +// ItemTypeToString 將 ItemType 轉換為字串 +func ItemTypeToString(it ItemType) (string, bool) { + str, ok := itemTypeToStringMap[it] + return str, ok +} + +// StringToItemType 將字串轉換為 ItemType +func StringToItemType(str string) (ItemType, bool) { + it, ok := stringToItemTypeMap[str] + return it, ok +} diff --git a/pkg/domain/product/show_type.go b/pkg/domain/product/show_type.go index b88639a..d755d08 100644 --- a/pkg/domain/product/show_type.go +++ b/pkg/domain/product/show_type.go @@ -5,3 +5,32 @@ type ShowType int64 const ( ShowTypeNormal ShowType = iota // 沒有任何外匡 ) + +func (s *ShowType) ToString() string { + str, _ := ShowTypeToString(*s) + return str +} + +const ( + ShowTypeNormalStr = "normal" +) + +var showTypeToStringMap = map[ShowType]string{ + ShowTypeNormal: ShowTypeNormalStr, +} + +var stringToShowTypeMap = map[string]ShowType{ + ShowTypeNormalStr: ShowTypeNormal, +} + +// ShowTypeToString 將 ShowType 轉換為字串 +func ShowTypeToString(st ShowType) (string, bool) { + str, ok := showTypeToStringMap[st] + return str, ok +} + +// StringToShowType 將字串轉換為 ShowType +func StringToShowType(str string) (ShowType, bool) { + st, ok := stringToShowTypeMap[str] + return st, ok +} diff --git a/pkg/domain/usecase/product_item.go b/pkg/domain/usecase/product_item.go index 91f865b..a7bada1 100644 --- a/pkg/domain/usecase/product_item.go +++ b/pkg/domain/usecase/product_item.go @@ -44,8 +44,8 @@ type ProductItems struct { Freight []CustomFields `json:"freight,omitempty"` // 運費 CustomFields []CustomFields `json:"custom_fields,omitempty"` // 自定義屬性 SalesCount uint64 `json:"sales_count" ` // 已賣出數量(相反,減到零就不能在賣) - UpdatedAt string `json:"updated_at"` // 更新時間 - CreatedAt string `json:"created_at"` // 創建時間 + UpdatedAt int64 `json:"updated_at"` // 更新時間 + CreatedAt int64 `json:"created_at"` // 創建時間 } type UpdateProductItems struct { diff --git a/pkg/usecase/product_item.go b/pkg/usecase/product_item.go index 1abc796..b29b133 100644 --- a/pkg/usecase/product_item.go +++ b/pkg/usecase/product_item.go @@ -8,7 +8,6 @@ import ( "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/product" "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/repository" "code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/usecase" - "code.30cm.net/digimon/app-cloudep-product-service/pkg/utils" "code.30cm.net/digimon/library-go/errs" "github.com/shopspring/decimal" "github.com/zeromicro/go-zero/core/logx" @@ -77,8 +76,8 @@ func fromEntity(e *entity.ProductItems) *usecase.ProductItems { Freight: convertEntityCustomFields(e.Freight), CustomFields: convertEntityCustomFields(e.CustomFields), SalesCount: e.SalesCount, - UpdatedAt: utils.UnixToRfc3339(e.UpdatedAt), - CreatedAt: utils.UnixToRfc3339(e.CreatedAt), + UpdatedAt: e.UpdatedAt, + CreatedAt: e.CreatedAt, } } diff --git a/product.go b/product.go index b8679d6..5b13787 100644 --- a/product.go +++ b/product.go @@ -2,12 +2,14 @@ package main import ( "flag" - - "github.com/zeromicro/go-zero/core/logx" + "fmt" "code.30cm.net/digimon/app-cloudep-product-service/gen_result/pb/product" "code.30cm.net/digimon/app-cloudep-product-service/internal/config" - productServer "code.30cm.net/digimon/app-cloudep-product-service/internal/server/product" + category_serviceServer "code.30cm.net/digimon/app-cloudep-product-service/internal/server/category_service" + kyc_serviceServer "code.30cm.net/digimon/app-cloudep-product-service/internal/server/kyc_service" + product_item_serviceServer "code.30cm.net/digimon/app-cloudep-product-service/internal/server/product_item_service" + tag_serviceServer "code.30cm.net/digimon/app-cloudep-product-service/internal/server/tag_service" "code.30cm.net/digimon/app-cloudep-product-service/internal/svc" "github.com/zeromicro/go-zero/core/conf" @@ -27,7 +29,10 @@ func main() { ctx := svc.NewServiceContext(c) s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { - product.RegisterProductServer(grpcServer, productServer.NewProductServer(ctx)) + product.RegisterCategory_ServiceServer(grpcServer, category_serviceServer.NewCategoryServiceServer(ctx)) + product.RegisterTag_ServiceServer(grpcServer, tag_serviceServer.NewTagServiceServer(ctx)) + product.RegisterKyc_ServiceServer(grpcServer, kyc_serviceServer.NewKycServiceServer(ctx)) + product.RegisterProduct_Item_ServiceServer(grpcServer, product_item_serviceServer.NewProductItemServiceServer(ctx)) if c.Mode == service.DevMode || c.Mode == service.TestMode { reflection.Register(grpcServer) @@ -35,6 +40,6 @@ func main() { }) defer s.Stop() - logx.Infof("Starting rpc server at %s...\n", c.ListenOn) + fmt.Printf("Starting rpc server at %s...\n", c.ListenOn) s.Start() }