app-cloudep-product-service/gen_result/pb/product/product_grpc.pb.go

1276 lines
50 KiB
Go
Raw Normal View History

2025-03-12 14:05:38 +00:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v3.19.4
// source: generate/protobuf/product.proto
package product
import (
2025-04-08 00:51:58 +00:00
context "context"
2025-03-12 14:05:38 +00:00
grpc "google.golang.org/grpc"
2025-04-08 00:51:58 +00:00
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
2025-03-12 14:05:38 +00:00
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
2025-04-08 00:51:58 +00:00
const (
2025-04-09 14:46:53 +00:00
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"
2025-04-08 00:51:58 +00:00
)
2025-04-09 14:46:53 +00:00
// Category_ServiceClient is the client API for Category_Service service.
2025-03-12 14:05:38 +00:00
//
// 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.
2025-04-09 14:46:53 +00:00
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)
2025-03-12 14:05:38 +00:00
}
2025-04-09 14:46:53 +00:00
type category_ServiceClient struct {
2025-03-12 14:05:38 +00:00
cc grpc.ClientConnInterface
}
2025-04-09 14:46:53 +00:00
func NewCategory_ServiceClient(cc grpc.ClientConnInterface) Category_ServiceClient {
return &category_ServiceClient{cc}
2025-03-12 14:05:38 +00:00
}
2025-04-09 14:46:53 +00:00
func (c *category_ServiceClient) Create(ctx context.Context, in *CreateCategoryReq, opts ...grpc.CallOption) (*OKResp, error) {
2025-04-08 00:51:58 +00:00
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp)
2025-04-09 14:46:53 +00:00
err := c.cc.Invoke(ctx, Category_Service_Create_FullMethodName, in, out, cOpts...)
2025-04-08 00:51:58 +00:00
if err != nil {
return nil, err
}
return out, nil
}
2025-04-09 14:46:53 +00:00
func (c *category_ServiceClient) Modify(ctx context.Context, in *ModifyCategoryReq, opts ...grpc.CallOption) (*OKResp, error) {
2025-04-08 02:06:40 +00:00
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp)
2025-04-09 14:46:53 +00:00
err := c.cc.Invoke(ctx, Category_Service_Modify_FullMethodName, in, out, cOpts...)
2025-04-08 02:06:40 +00:00
if err != nil {
return nil, err
}
return out, nil
}
2025-04-09 14:46:53 +00:00
func (c *category_ServiceClient) Delete(ctx context.Context, in *CategoryReq, opts ...grpc.CallOption) (*OKResp, error) {
2025-04-08 02:06:40 +00:00
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp)
2025-04-09 14:46:53 +00:00
err := c.cc.Invoke(ctx, Category_Service_Delete_FullMethodName, in, out, cOpts...)
2025-04-08 02:06:40 +00:00
if err != nil {
return nil, err
}
return out, nil
}
2025-04-09 14:46:53 +00:00
func (c *category_ServiceClient) Get(ctx context.Context, in *CategoryReq, opts ...grpc.CallOption) (*Category, error) {
2025-04-08 02:06:40 +00:00
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Category)
2025-04-09 14:46:53 +00:00
err := c.cc.Invoke(ctx, Category_Service_Get_FullMethodName, in, out, cOpts...)
2025-04-08 02:06:40 +00:00
if err != nil {
return nil, err
}
return out, nil
}
2025-04-09 14:46:53 +00:00
func (c *category_ServiceClient) List(ctx context.Context, in *ListCategoryReq, opts ...grpc.CallOption) (*ListCategoryResp, error) {
2025-04-08 02:06:40 +00:00
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListCategoryResp)
2025-04-09 14:46:53 +00:00
err := c.cc.Invoke(ctx, Category_Service_List_FullMethodName, in, out, cOpts...)
2025-04-08 02:06:40 +00:00
if err != nil {
return nil, err
}
return out, nil
}
2025-04-09 14:46:53 +00:00
// 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 {
2025-04-08 03:49:07 +00:00
return nil, err
}
2025-04-09 14:46:53 +00:00
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)
2025-04-08 03:49:07 +00:00
}
2025-04-09 14:46:53 +00:00
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 {
2025-04-08 03:49:07 +00:00
return nil, err
}
2025-04-09 14:46:53 +00:00
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)
2025-04-08 03:49:07 +00:00
}
2025-04-09 14:46:53 +00:00
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 {
2025-04-08 03:49:07 +00:00
return nil, err
}
2025-04-09 14:46:53 +00:00
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)
2025-04-08 03:49:07 +00:00
}
2025-04-09 14:46:53 +00:00
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 {
2025-04-08 03:49:07 +00:00
return nil, err
}
2025-04-09 14:46:53 +00:00
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)
2025-04-08 03:49:07 +00:00
}
2025-04-09 14:46:53 +00:00
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 {
2025-04-08 03:49:07 +00:00
return nil, err
}
2025-04-09 14:46:53 +00:00
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",
2025-04-08 03:49:07 +00:00
}
2025-04-09 14:46:53 +00:00
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
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)
}
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) {
2025-04-08 09:20:34 +00:00
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp)
2025-04-09 14:46:53 +00:00
err := c.cc.Invoke(ctx, Tag_Service_Create_FullMethodName, in, out, cOpts...)
2025-04-08 09:20:34 +00:00
if err != nil {
return nil, err
}
return out, nil
}
2025-04-09 14:46:53 +00:00
func (c *tag_ServiceClient) Modify(ctx context.Context, in *ModifyTagsReq, opts ...grpc.CallOption) (*OKResp, error) {
2025-04-08 09:20:34 +00:00
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
2025-04-09 14:46:53 +00:00
out := new(OKResp)
err := c.cc.Invoke(ctx, Tag_Service_Modify_FullMethodName, in, out, cOpts...)
2025-04-08 09:20:34 +00:00
if err != nil {
return nil, err
}
return out, nil
}
2025-04-09 14:46:53 +00:00
func (c *tag_ServiceClient) Delete(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*OKResp, error) {
2025-04-08 09:20:34 +00:00
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
2025-04-09 14:46:53 +00:00
out := new(OKResp)
err := c.cc.Invoke(ctx, Tag_Service_Delete_FullMethodName, in, out, cOpts...)
2025-04-08 09:20:34 +00:00
if err != nil {
return nil, err
}
return out, nil
}
2025-04-09 14:46:53 +00:00
func (c *tag_ServiceClient) Get(ctx context.Context, in *TagsReq, opts ...grpc.CallOption) (*Tags, error) {
2025-04-08 09:20:34 +00:00
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
2025-04-09 14:46:53 +00:00
out := new(Tags)
err := c.cc.Invoke(ctx, Tag_Service_Get_FullMethodName, in, out, cOpts...)
2025-04-08 09:20:34 +00:00
if err != nil {
return nil, err
}
return out, nil
}
2025-04-09 14:46:53 +00:00
func (c *tag_ServiceClient) List(ctx context.Context, in *ListTagsReq, opts ...grpc.CallOption) (*ListTagsResp, error) {
2025-04-08 09:20:34 +00:00
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
2025-04-09 14:46:53 +00:00
out := new(ListTagsResp)
err := c.cc.Invoke(ctx, Tag_Service_List_FullMethodName, in, out, cOpts...)
2025-04-08 09:20:34 +00:00
if err != nil {
return nil, err
}
return out, nil
}
2025-04-09 14:46:53 +00:00
// 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 {
2025-04-08 09:20:34 +00:00
return nil, err
}
2025-04-09 14:46:53 +00:00
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)
2025-04-08 09:20:34 +00:00
}
2025-04-09 14:46:53 +00:00
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 {
2025-04-09 09:29:56 +00:00
return nil, err
}
2025-04-09 14:46:53 +00:00
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)
2025-04-09 09:29:56 +00:00
}
2025-04-09 14:46:53 +00:00
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 {
2025-04-09 09:29:56 +00:00
return nil, err
}
2025-04-09 14:46:53 +00:00
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)
2025-04-09 09:29:56 +00:00
}
2025-04-09 14:46:53 +00:00
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 {
2025-04-09 09:29:56 +00:00
return nil, err
}
2025-04-09 14:46:53 +00:00
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)
2025-04-09 09:29:56 +00:00
}
2025-04-09 14:46:53 +00:00
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) {
2025-04-09 09:29:56 +00:00
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp)
2025-04-09 14:46:53 +00:00
err := c.cc.Invoke(ctx, Kyc_Service_Create_FullMethodName, in, out, cOpts...)
2025-04-09 09:29:56 +00:00
if err != nil {
return nil, err
}
return out, nil
}
2025-04-09 14:46:53 +00:00
func (c *kyc_ServiceClient) FindLatestByUid(ctx context.Context, in *FindLatestKycByUIDReq, opts ...grpc.CallOption) (*Kyc, error) {
2025-04-09 09:29:56 +00:00
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
2025-04-09 14:46:53 +00:00
out := new(Kyc)
err := c.cc.Invoke(ctx, Kyc_Service_FindLatestByUid_FullMethodName, in, out, cOpts...)
2025-04-09 09:29:56 +00:00
if err != nil {
return nil, err
}
return out, nil
}
2025-04-09 14:46:53 +00:00
func (c *kyc_ServiceClient) FindById(ctx context.Context, in *FindKycByIDReq, opts ...grpc.CallOption) (*Kyc, error) {
2025-04-09 09:29:56 +00:00
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
2025-04-09 14:46:53 +00:00
out := new(Kyc)
err := c.cc.Invoke(ctx, Kyc_Service_FindById_FullMethodName, in, out, cOpts...)
2025-04-09 09:29:56 +00:00
if err != nil {
return nil, err
}
return out, nil
}
2025-04-09 14:46:53 +00:00
func (c *kyc_ServiceClient) List(ctx context.Context, in *ListKycReq, opts ...grpc.CallOption) (*ListKycResp, error) {
2025-04-09 09:29:56 +00:00
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
2025-04-09 14:46:53 +00:00
out := new(ListKycResp)
err := c.cc.Invoke(ctx, Kyc_Service_List_FullMethodName, in, out, cOpts...)
2025-04-09 09:29:56 +00:00
if err != nil {
return nil, err
}
return out, nil
}
2025-04-09 14:46:53 +00:00
func (c *kyc_ServiceClient) UpdateStatus(ctx context.Context, in *UpdateKycStatusReq, opts ...grpc.CallOption) (*OKResp, error) {
2025-04-09 09:29:56 +00:00
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp)
2025-04-09 14:46:53 +00:00
err := c.cc.Invoke(ctx, Kyc_Service_UpdateStatus_FullMethodName, in, out, cOpts...)
2025-04-09 09:29:56 +00:00
if err != nil {
return nil, err
}
return out, nil
}
2025-04-09 14:46:53 +00:00
func (c *kyc_ServiceClient) Update(ctx context.Context, in *UpdateKycInfoReq, opts ...grpc.CallOption) (*OKResp, error) {
2025-04-09 09:29:56 +00:00
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OKResp)
2025-04-09 14:46:53 +00:00
err := c.cc.Invoke(ctx, Kyc_Service_Update_FullMethodName, in, out, cOpts...)
2025-04-09 09:29:56 +00:00
if err != nil {
return nil, err
}
return out, nil
}
2025-04-09 14:46:53 +00:00
// Kyc_ServiceServer is the server API for Kyc_Service service.
// All implementations must embed UnimplementedKyc_ServiceServer
2025-03-12 14:05:38 +00:00
// for forward compatibility.
2025-04-09 14:46:53 +00:00
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()
2025-03-12 14:05:38 +00:00
}
2025-04-09 14:46:53 +00:00
// UnimplementedKyc_ServiceServer must be embedded to have
2025-03-12 14:05:38 +00:00
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
2025-04-09 14:46:53 +00:00
type UnimplementedKyc_ServiceServer struct{}
2025-03-12 14:05:38 +00:00
2025-04-09 14:46:53 +00:00
func (UnimplementedKyc_ServiceServer) Create(context.Context, *CreateKycReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
2025-04-09 09:29:56 +00:00
}
2025-04-09 14:46:53 +00:00
func (UnimplementedKyc_ServiceServer) FindLatestByUid(context.Context, *FindLatestKycByUIDReq) (*Kyc, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindLatestByUid not implemented")
2025-04-09 09:29:56 +00:00
}
2025-04-09 14:46:53 +00:00
func (UnimplementedKyc_ServiceServer) FindById(context.Context, *FindKycByIDReq) (*Kyc, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindById not implemented")
2025-04-09 09:29:56 +00:00
}
2025-04-09 14:46:53 +00:00
func (UnimplementedKyc_ServiceServer) List(context.Context, *ListKycReq) (*ListKycResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
2025-04-09 09:29:56 +00:00
}
2025-04-09 14:46:53 +00:00
func (UnimplementedKyc_ServiceServer) UpdateStatus(context.Context, *UpdateKycStatusReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateStatus not implemented")
2025-04-09 09:29:56 +00:00
}
2025-04-09 14:46:53 +00:00
func (UnimplementedKyc_ServiceServer) Update(context.Context, *UpdateKycInfoReq) (*OKResp, error) {
2025-04-09 09:29:56 +00:00
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
}
2025-04-09 14:46:53 +00:00
func (UnimplementedKyc_ServiceServer) mustEmbedUnimplementedKyc_ServiceServer() {}
func (UnimplementedKyc_ServiceServer) testEmbeddedByValue() {}
2025-03-12 14:05:38 +00:00
2025-04-09 14:46:53 +00:00
// 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
2025-03-12 14:05:38 +00:00
// result in compilation errors.
2025-04-09 14:46:53 +00:00
type UnsafeKyc_ServiceServer interface {
mustEmbedUnimplementedKyc_ServiceServer()
2025-03-12 14:05:38 +00:00
}
2025-04-09 14:46:53 +00:00
func RegisterKyc_ServiceServer(s grpc.ServiceRegistrar, srv Kyc_ServiceServer) {
// If the following call pancis, it indicates UnimplementedKyc_ServiceServer was
2025-03-12 14:05:38 +00:00
// 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()
}
2025-04-09 14:46:53 +00:00
s.RegisterService(&Kyc_Service_ServiceDesc, srv)
2025-03-12 14:05:38 +00:00
}
2025-04-09 14:46:53 +00:00
func _Kyc_Service_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateKycReq)
2025-04-08 00:51:58 +00:00
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
2025-04-09 14:46:53 +00:00
return srv.(Kyc_ServiceServer).Create(ctx, in)
2025-04-08 00:51:58 +00:00
}
info := &grpc.UnaryServerInfo{
Server: srv,
2025-04-09 14:46:53 +00:00
FullMethod: Kyc_Service_Create_FullMethodName,
2025-04-08 00:51:58 +00:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
2025-04-09 14:46:53 +00:00
return srv.(Kyc_ServiceServer).Create(ctx, req.(*CreateKycReq))
2025-04-08 00:51:58 +00:00
}
return interceptor(ctx, in, info, handler)
}
2025-04-09 14:46:53 +00:00
func _Kyc_Service_FindLatestByUid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FindLatestKycByUIDReq)
2025-04-08 02:06:40 +00:00
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
2025-04-09 14:46:53 +00:00
return srv.(Kyc_ServiceServer).FindLatestByUid(ctx, in)
2025-04-08 02:06:40 +00:00
}
info := &grpc.UnaryServerInfo{
Server: srv,
2025-04-09 14:46:53 +00:00
FullMethod: Kyc_Service_FindLatestByUid_FullMethodName,
2025-04-08 02:06:40 +00:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
2025-04-09 14:46:53 +00:00
return srv.(Kyc_ServiceServer).FindLatestByUid(ctx, req.(*FindLatestKycByUIDReq))
2025-04-08 02:06:40 +00:00
}
return interceptor(ctx, in, info, handler)
}
2025-04-09 14:46:53 +00:00
func _Kyc_Service_FindById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FindKycByIDReq)
2025-04-08 02:06:40 +00:00
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
2025-04-09 14:46:53 +00:00
return srv.(Kyc_ServiceServer).FindById(ctx, in)
2025-04-08 02:06:40 +00:00
}
info := &grpc.UnaryServerInfo{
Server: srv,
2025-04-09 14:46:53 +00:00
FullMethod: Kyc_Service_FindById_FullMethodName,
2025-04-08 02:06:40 +00:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
2025-04-09 14:46:53 +00:00
return srv.(Kyc_ServiceServer).FindById(ctx, req.(*FindKycByIDReq))
2025-04-08 02:06:40 +00:00
}
return interceptor(ctx, in, info, handler)
}
2025-04-09 14:46:53 +00:00
func _Kyc_Service_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListKycReq)
2025-04-08 02:06:40 +00:00
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
2025-04-09 14:46:53 +00:00
return srv.(Kyc_ServiceServer).List(ctx, in)
2025-04-08 02:06:40 +00:00
}
info := &grpc.UnaryServerInfo{
Server: srv,
2025-04-09 14:46:53 +00:00
FullMethod: Kyc_Service_List_FullMethodName,
2025-04-08 02:06:40 +00:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
2025-04-09 14:46:53 +00:00
return srv.(Kyc_ServiceServer).List(ctx, req.(*ListKycReq))
2025-04-08 02:06:40 +00:00
}
return interceptor(ctx, in, info, handler)
}
2025-04-09 14:46:53 +00:00
func _Kyc_Service_UpdateStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateKycStatusReq)
2025-04-08 02:06:40 +00:00
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
2025-04-09 14:46:53 +00:00
return srv.(Kyc_ServiceServer).UpdateStatus(ctx, in)
2025-04-08 02:06:40 +00:00
}
info := &grpc.UnaryServerInfo{
Server: srv,
2025-04-09 14:46:53 +00:00
FullMethod: Kyc_Service_UpdateStatus_FullMethodName,
2025-04-08 02:06:40 +00:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
2025-04-09 14:46:53 +00:00
return srv.(Kyc_ServiceServer).UpdateStatus(ctx, req.(*UpdateKycStatusReq))
2025-04-08 02:06:40 +00:00
}
return interceptor(ctx, in, info, handler)
}
2025-04-09 14:46:53 +00:00
func _Kyc_Service_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateKycInfoReq)
2025-04-08 03:49:07 +00:00
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
2025-04-09 14:46:53 +00:00
return srv.(Kyc_ServiceServer).Update(ctx, in)
2025-04-08 03:49:07 +00:00
}
info := &grpc.UnaryServerInfo{
Server: srv,
2025-04-09 14:46:53 +00:00
FullMethod: Kyc_Service_Update_FullMethodName,
2025-04-08 03:49:07 +00:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
2025-04-09 14:46:53 +00:00
return srv.(Kyc_ServiceServer).Update(ctx, req.(*UpdateKycInfoReq))
2025-04-08 03:49:07 +00:00
}
return interceptor(ctx, in, info, handler)
}
2025-04-09 14:46:53 +00:00
// 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",
2025-04-08 03:49:07 +00:00
}
2025-04-09 14:46:53 +00:00
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
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)
}
type product_Item_ServiceClient struct {
cc grpc.ClientConnInterface
}
func NewProduct_Item_ServiceClient(cc grpc.ClientConnInterface) Product_Item_ServiceClient {
return &product_Item_ServiceClient{cc}
}
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_Item_Service_Create_FullMethodName, in, out, cOpts...)
if err != nil {
2025-04-08 03:49:07 +00:00
return nil, err
}
2025-04-09 14:46:53 +00:00
return out, nil
2025-04-08 03:49:07 +00:00
}
2025-04-09 14:46:53 +00:00
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_Item_Service_Get_FullMethodName, in, out, cOpts...)
if err != nil {
2025-04-08 03:49:07 +00:00
return nil, err
}
2025-04-09 14:46:53 +00:00
return out, nil
2025-04-08 03:49:07 +00:00
}
2025-04-09 14:46:53 +00:00
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_Item_Service_ListByProductId_FullMethodName, in, out, cOpts...)
if err != nil {
2025-04-08 03:49:07 +00:00
return nil, err
}
2025-04-09 14:46:53 +00:00
return out, nil
2025-04-08 03:49:07 +00:00
}
2025-04-09 14:46:53 +00:00
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_Item_Service_Delete_FullMethodName, in, out, cOpts...)
if err != nil {
2025-04-08 09:20:34 +00:00
return nil, err
}
2025-04-09 14:46:53 +00:00
return out, nil
2025-04-08 09:20:34 +00:00
}
2025-04-09 14:46:53 +00:00
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_Item_Service_DeleteByReferenceId_FullMethodName, in, out, cOpts...)
if err != nil {
2025-04-08 09:20:34 +00:00
return nil, err
}
2025-04-09 14:46:53 +00:00
return out, nil
2025-04-08 09:20:34 +00:00
}
2025-04-09 14:46:53 +00:00
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_Item_Service_IncSalesCount_FullMethodName, in, out, cOpts...)
if err != nil {
2025-04-08 09:20:34 +00:00
return nil, err
}
2025-04-09 14:46:53 +00:00
return out, nil
2025-04-08 09:20:34 +00:00
}
2025-04-09 14:46:53 +00:00
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_Item_Service_DecSalesCount_FullMethodName, in, out, cOpts...)
if err != nil {
2025-04-08 09:20:34 +00:00
return nil, err
}
2025-04-09 14:46:53 +00:00
return out, nil
2025-04-08 09:20:34 +00:00
}
2025-04-09 14:46:53 +00:00
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_Item_Service_Update_FullMethodName, in, out, cOpts...)
if err != nil {
2025-04-08 09:20:34 +00:00
return nil, err
}
2025-04-09 14:46:53 +00:00
return out, nil
2025-04-08 09:20:34 +00:00
}
2025-04-09 14:46:53 +00:00
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_Item_Service_UpdateStatus_FullMethodName, in, out, cOpts...)
if err != nil {
2025-04-08 09:20:34 +00:00
return nil, err
}
2025-04-09 14:46:53 +00:00
return out, nil
}
// Product_Item_ServiceServer is the server API for Product_Item_Service service.
// All implementations must embed UnimplementedProduct_Item_ServiceServer
// for forward compatibility.
type Product_Item_ServiceServer interface {
// Create 建立 ProductItem
Create(context.Context, *CreateProductItemRequest) (*OKResp, error)
// GetProductItem 取得 ProductItem
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 減少賣出數量
DecSalesCount(context.Context, *IncDecSalesCountRequest) (*OKResp, error)
// Update 更新 Item
Update(context.Context, *UpdateProductItemRequest) (*OKResp, error)
// UpdateStatus 更新 Item status
UpdateStatus(context.Context, *UpdateStatusRequest) (*OKResp, error)
mustEmbedUnimplementedProduct_Item_ServiceServer()
}
// 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 UnimplementedProduct_Item_ServiceServer struct{}
func (UnimplementedProduct_Item_ServiceServer) Create(context.Context, *CreateProductItemRequest) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedProduct_Item_ServiceServer) Get(context.Context, *GetProductItemRequest) (*ProductItem, error) {
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedProduct_Item_ServiceServer) ListByProductId(context.Context, *ListProductItemRequest) (*ListProductItemResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListByProductId not implemented")
}
func (UnimplementedProduct_Item_ServiceServer) Delete(context.Context, *DeleteProductItemRequest) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedProduct_Item_ServiceServer) DeleteByReferenceId(context.Context, *DeleteProductItemsByReferenceIDReq) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteByReferenceId not implemented")
}
func (UnimplementedProduct_Item_ServiceServer) IncSalesCount(context.Context, *IncDecSalesCountRequest) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method IncSalesCount not implemented")
}
func (UnimplementedProduct_Item_ServiceServer) DecSalesCount(context.Context, *IncDecSalesCountRequest) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method DecSalesCount not implemented")
}
func (UnimplementedProduct_Item_ServiceServer) Update(context.Context, *UpdateProductItemRequest) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
}
func (UnimplementedProduct_Item_ServiceServer) UpdateStatus(context.Context, *UpdateStatusRequest) (*OKResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateStatus not implemented")
}
func (UnimplementedProduct_Item_ServiceServer) mustEmbedUnimplementedProduct_Item_ServiceServer() {}
func (UnimplementedProduct_Item_ServiceServer) testEmbeddedByValue() {}
// 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 UnsafeProduct_Item_ServiceServer interface {
mustEmbedUnimplementedProduct_Item_ServiceServer()
}
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()
2025-04-08 09:20:34 +00:00
}
2025-04-09 14:46:53 +00:00
s.RegisterService(&Product_Item_Service_ServiceDesc, srv)
2025-04-08 09:20:34 +00:00
}
2025-04-09 14:46:53 +00:00
func _Product_Item_Service_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
2025-04-09 09:29:56 +00:00
in := new(CreateProductItemRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
2025-04-09 14:46:53 +00:00
return srv.(Product_Item_ServiceServer).Create(ctx, in)
2025-04-09 09:29:56 +00:00
}
info := &grpc.UnaryServerInfo{
Server: srv,
2025-04-09 14:46:53 +00:00
FullMethod: Product_Item_Service_Create_FullMethodName,
2025-04-09 09:29:56 +00:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
2025-04-09 14:46:53 +00:00
return srv.(Product_Item_ServiceServer).Create(ctx, req.(*CreateProductItemRequest))
2025-04-09 09:29:56 +00:00
}
return interceptor(ctx, in, info, handler)
}
2025-04-09 14:46:53 +00:00
func _Product_Item_Service_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
2025-04-09 09:29:56 +00:00
in := new(GetProductItemRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
2025-04-09 14:46:53 +00:00
return srv.(Product_Item_ServiceServer).Get(ctx, in)
2025-04-09 09:29:56 +00:00
}
info := &grpc.UnaryServerInfo{
Server: srv,
2025-04-09 14:46:53 +00:00
FullMethod: Product_Item_Service_Get_FullMethodName,
2025-04-09 09:29:56 +00:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
2025-04-09 14:46:53 +00:00
return srv.(Product_Item_ServiceServer).Get(ctx, req.(*GetProductItemRequest))
2025-04-09 09:29:56 +00:00
}
return interceptor(ctx, in, info, handler)
}
2025-04-09 14:46:53 +00:00
func _Product_Item_Service_ListByProductId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
2025-04-09 09:29:56 +00:00
in := new(ListProductItemRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
2025-04-09 14:46:53 +00:00
return srv.(Product_Item_ServiceServer).ListByProductId(ctx, in)
2025-04-09 09:29:56 +00:00
}
info := &grpc.UnaryServerInfo{
Server: srv,
2025-04-09 14:46:53 +00:00
FullMethod: Product_Item_Service_ListByProductId_FullMethodName,
2025-04-09 09:29:56 +00:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
2025-04-09 14:46:53 +00:00
return srv.(Product_Item_ServiceServer).ListByProductId(ctx, req.(*ListProductItemRequest))
2025-04-09 09:29:56 +00:00
}
return interceptor(ctx, in, info, handler)
}
2025-04-09 14:46:53 +00:00
func _Product_Item_Service_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
2025-04-09 09:29:56 +00:00
in := new(DeleteProductItemRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
2025-04-09 14:46:53 +00:00
return srv.(Product_Item_ServiceServer).Delete(ctx, in)
2025-04-09 09:29:56 +00:00
}
info := &grpc.UnaryServerInfo{
Server: srv,
2025-04-09 14:46:53 +00:00
FullMethod: Product_Item_Service_Delete_FullMethodName,
2025-04-09 09:29:56 +00:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
2025-04-09 14:46:53 +00:00
return srv.(Product_Item_ServiceServer).Delete(ctx, req.(*DeleteProductItemRequest))
2025-04-09 09:29:56 +00:00
}
return interceptor(ctx, in, info, handler)
}
2025-04-09 14:46:53 +00:00
func _Product_Item_Service_DeleteByReferenceId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
2025-04-09 09:29:56 +00:00
in := new(DeleteProductItemsByReferenceIDReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
2025-04-09 14:46:53 +00:00
return srv.(Product_Item_ServiceServer).DeleteByReferenceId(ctx, in)
2025-04-09 09:29:56 +00:00
}
info := &grpc.UnaryServerInfo{
Server: srv,
2025-04-09 14:46:53 +00:00
FullMethod: Product_Item_Service_DeleteByReferenceId_FullMethodName,
2025-04-09 09:29:56 +00:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
2025-04-09 14:46:53 +00:00
return srv.(Product_Item_ServiceServer).DeleteByReferenceId(ctx, req.(*DeleteProductItemsByReferenceIDReq))
2025-04-09 09:29:56 +00:00
}
return interceptor(ctx, in, info, handler)
}
2025-04-09 14:46:53 +00:00
func _Product_Item_Service_IncSalesCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
2025-04-09 09:29:56 +00:00
in := new(IncDecSalesCountRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
2025-04-09 14:46:53 +00:00
return srv.(Product_Item_ServiceServer).IncSalesCount(ctx, in)
2025-04-09 09:29:56 +00:00
}
info := &grpc.UnaryServerInfo{
Server: srv,
2025-04-09 14:46:53 +00:00
FullMethod: Product_Item_Service_IncSalesCount_FullMethodName,
2025-04-09 09:29:56 +00:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
2025-04-09 14:46:53 +00:00
return srv.(Product_Item_ServiceServer).IncSalesCount(ctx, req.(*IncDecSalesCountRequest))
2025-04-09 09:29:56 +00:00
}
return interceptor(ctx, in, info, handler)
}
2025-04-09 14:46:53 +00:00
func _Product_Item_Service_DecSalesCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
2025-04-09 09:29:56 +00:00
in := new(IncDecSalesCountRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
2025-04-09 14:46:53 +00:00
return srv.(Product_Item_ServiceServer).DecSalesCount(ctx, in)
2025-04-09 09:29:56 +00:00
}
info := &grpc.UnaryServerInfo{
Server: srv,
2025-04-09 14:46:53 +00:00
FullMethod: Product_Item_Service_DecSalesCount_FullMethodName,
2025-04-09 09:29:56 +00:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
2025-04-09 14:46:53 +00:00
return srv.(Product_Item_ServiceServer).DecSalesCount(ctx, req.(*IncDecSalesCountRequest))
2025-04-09 09:29:56 +00:00
}
return interceptor(ctx, in, info, handler)
}
2025-04-09 14:46:53 +00:00
func _Product_Item_Service_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
2025-04-09 09:29:56 +00:00
in := new(UpdateProductItemRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
2025-04-09 14:46:53 +00:00
return srv.(Product_Item_ServiceServer).Update(ctx, in)
2025-04-09 09:29:56 +00:00
}
info := &grpc.UnaryServerInfo{
Server: srv,
2025-04-09 14:46:53 +00:00
FullMethod: Product_Item_Service_Update_FullMethodName,
2025-04-09 09:29:56 +00:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
2025-04-09 14:46:53 +00:00
return srv.(Product_Item_ServiceServer).Update(ctx, req.(*UpdateProductItemRequest))
2025-04-09 09:29:56 +00:00
}
return interceptor(ctx, in, info, handler)
}
2025-04-09 14:46:53 +00:00
func _Product_Item_Service_UpdateStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
2025-04-09 09:29:56 +00:00
in := new(UpdateStatusRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
2025-04-09 14:46:53 +00:00
return srv.(Product_Item_ServiceServer).UpdateStatus(ctx, in)
2025-04-09 09:29:56 +00:00
}
info := &grpc.UnaryServerInfo{
Server: srv,
2025-04-09 14:46:53 +00:00
FullMethod: Product_Item_Service_UpdateStatus_FullMethodName,
2025-04-09 09:29:56 +00:00
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
2025-04-09 14:46:53 +00:00
return srv.(Product_Item_ServiceServer).UpdateStatus(ctx, req.(*UpdateStatusRequest))
2025-04-09 09:29:56 +00:00
}
return interceptor(ctx, in, info, handler)
}
2025-04-09 14:46:53 +00:00
// Product_Item_Service_ServiceDesc is the grpc.ServiceDesc for Product_Item_Service service.
2025-03-12 14:05:38 +00:00
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
2025-04-09 14:46:53 +00:00
var Product_Item_Service_ServiceDesc = grpc.ServiceDesc{
ServiceName: "product.Product_Item_Service",
HandlerType: (*Product_Item_ServiceServer)(nil),
2025-04-08 00:51:58 +00:00
Methods: []grpc.MethodDesc{
{
2025-04-09 14:46:53 +00:00
MethodName: "Create",
Handler: _Product_Item_Service_Create_Handler,
2025-04-09 09:29:56 +00:00
},
{
2025-04-09 14:46:53 +00:00
MethodName: "Get",
Handler: _Product_Item_Service_Get_Handler,
2025-04-09 09:29:56 +00:00
},
{
2025-04-09 14:46:53 +00:00
MethodName: "ListByProductId",
Handler: _Product_Item_Service_ListByProductId_Handler,
2025-04-09 09:29:56 +00:00
},
{
2025-04-09 14:46:53 +00:00
MethodName: "Delete",
Handler: _Product_Item_Service_Delete_Handler,
2025-04-09 09:29:56 +00:00
},
{
2025-04-09 14:46:53 +00:00
MethodName: "DeleteByReferenceId",
Handler: _Product_Item_Service_DeleteByReferenceId_Handler,
2025-04-09 09:29:56 +00:00
},
{
MethodName: "IncSalesCount",
2025-04-09 14:46:53 +00:00
Handler: _Product_Item_Service_IncSalesCount_Handler,
2025-04-09 09:29:56 +00:00
},
{
MethodName: "DecSalesCount",
2025-04-09 14:46:53 +00:00
Handler: _Product_Item_Service_DecSalesCount_Handler,
2025-04-09 09:29:56 +00:00
},
{
MethodName: "Update",
2025-04-09 14:46:53 +00:00
Handler: _Product_Item_Service_Update_Handler,
2025-04-09 09:29:56 +00:00
},
{
MethodName: "UpdateStatus",
2025-04-09 14:46:53 +00:00
Handler: _Product_Item_Service_UpdateStatus_Handler,
2025-04-09 09:29:56 +00:00
},
2025-04-08 00:51:58 +00:00
},
Streams: []grpc.StreamDesc{},
Metadata: "generate/protobuf/product.proto",
2025-03-12 14:05:38 +00:00
}