1276 lines
50 KiB
Go
1276 lines
50 KiB
Go
// 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 (
|
||
context "context"
|
||
grpc "google.golang.org/grpc"
|
||
codes "google.golang.org/grpc/codes"
|
||
status "google.golang.org/grpc/status"
|
||
)
|
||
|
||
// 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
|
||
|
||
const (
|
||
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"
|
||
)
|
||
|
||
// 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 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
|
||
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) {
|
||
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
|
||
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 {
|
||
return nil, err
|
||
}
|
||
return out, nil
|
||
}
|
||
|
||
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 {
|
||
return nil, err
|
||
}
|
||
return out, nil
|
||
}
|
||
|
||
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 {
|
||
return nil, err
|
||
}
|
||
return out, nil
|
||
}
|
||
|
||
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 {
|
||
return nil, err
|
||
}
|
||
return out, nil
|
||
}
|
||
|
||
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 {
|
||
return nil, err
|
||
}
|
||
return out, nil
|
||
}
|
||
|
||
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 {
|
||
return nil, err
|
||
}
|
||
return out, nil
|
||
}
|
||
|
||
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 {
|
||
return nil, err
|
||
}
|
||
return out, nil
|
||
}
|
||
|
||
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 {
|
||
return nil, err
|
||
}
|
||
return out, nil
|
||
}
|
||
|
||
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 {
|
||
return nil, err
|
||
}
|
||
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()
|
||
}
|
||
s.RegisterService(&Product_Item_Service_ServiceDesc, srv)
|
||
}
|
||
|
||
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.(Product_Item_ServiceServer).Create(ctx, in)
|
||
}
|
||
info := &grpc.UnaryServerInfo{
|
||
Server: srv,
|
||
FullMethod: Product_Item_Service_Create_FullMethodName,
|
||
}
|
||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
return srv.(Product_Item_ServiceServer).Create(ctx, req.(*CreateProductItemRequest))
|
||
}
|
||
return interceptor(ctx, in, info, handler)
|
||
}
|
||
|
||
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.(Product_Item_ServiceServer).Get(ctx, in)
|
||
}
|
||
info := &grpc.UnaryServerInfo{
|
||
Server: srv,
|
||
FullMethod: Product_Item_Service_Get_FullMethodName,
|
||
}
|
||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
return srv.(Product_Item_ServiceServer).Get(ctx, req.(*GetProductItemRequest))
|
||
}
|
||
return interceptor(ctx, in, info, handler)
|
||
}
|
||
|
||
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.(Product_Item_ServiceServer).ListByProductId(ctx, in)
|
||
}
|
||
info := &grpc.UnaryServerInfo{
|
||
Server: srv,
|
||
FullMethod: Product_Item_Service_ListByProductId_FullMethodName,
|
||
}
|
||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
return srv.(Product_Item_ServiceServer).ListByProductId(ctx, req.(*ListProductItemRequest))
|
||
}
|
||
return interceptor(ctx, in, info, handler)
|
||
}
|
||
|
||
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.(Product_Item_ServiceServer).Delete(ctx, in)
|
||
}
|
||
info := &grpc.UnaryServerInfo{
|
||
Server: srv,
|
||
FullMethod: Product_Item_Service_Delete_FullMethodName,
|
||
}
|
||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
return srv.(Product_Item_ServiceServer).Delete(ctx, req.(*DeleteProductItemRequest))
|
||
}
|
||
return interceptor(ctx, in, info, handler)
|
||
}
|
||
|
||
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.(Product_Item_ServiceServer).DeleteByReferenceId(ctx, in)
|
||
}
|
||
info := &grpc.UnaryServerInfo{
|
||
Server: srv,
|
||
FullMethod: Product_Item_Service_DeleteByReferenceId_FullMethodName,
|
||
}
|
||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
return srv.(Product_Item_ServiceServer).DeleteByReferenceId(ctx, req.(*DeleteProductItemsByReferenceIDReq))
|
||
}
|
||
return interceptor(ctx, in, info, handler)
|
||
}
|
||
|
||
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.(Product_Item_ServiceServer).IncSalesCount(ctx, in)
|
||
}
|
||
info := &grpc.UnaryServerInfo{
|
||
Server: srv,
|
||
FullMethod: Product_Item_Service_IncSalesCount_FullMethodName,
|
||
}
|
||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
return srv.(Product_Item_ServiceServer).IncSalesCount(ctx, req.(*IncDecSalesCountRequest))
|
||
}
|
||
return interceptor(ctx, in, info, handler)
|
||
}
|
||
|
||
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.(Product_Item_ServiceServer).DecSalesCount(ctx, in)
|
||
}
|
||
info := &grpc.UnaryServerInfo{
|
||
Server: srv,
|
||
FullMethod: Product_Item_Service_DecSalesCount_FullMethodName,
|
||
}
|
||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
return srv.(Product_Item_ServiceServer).DecSalesCount(ctx, req.(*IncDecSalesCountRequest))
|
||
}
|
||
return interceptor(ctx, in, info, handler)
|
||
}
|
||
|
||
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.(Product_Item_ServiceServer).Update(ctx, in)
|
||
}
|
||
info := &grpc.UnaryServerInfo{
|
||
Server: srv,
|
||
FullMethod: Product_Item_Service_Update_FullMethodName,
|
||
}
|
||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
return srv.(Product_Item_ServiceServer).Update(ctx, req.(*UpdateProductItemRequest))
|
||
}
|
||
return interceptor(ctx, in, info, handler)
|
||
}
|
||
|
||
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.(Product_Item_ServiceServer).UpdateStatus(ctx, in)
|
||
}
|
||
info := &grpc.UnaryServerInfo{
|
||
Server: srv,
|
||
FullMethod: Product_Item_Service_UpdateStatus_FullMethodName,
|
||
}
|
||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
return srv.(Product_Item_ServiceServer).UpdateStatus(ctx, req.(*UpdateStatusRequest))
|
||
}
|
||
return interceptor(ctx, in, info, handler)
|
||
}
|
||
|
||
// 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_Item_Service_ServiceDesc = grpc.ServiceDesc{
|
||
ServiceName: "product.Product_Item_Service",
|
||
HandlerType: (*Product_Item_ServiceServer)(nil),
|
||
Methods: []grpc.MethodDesc{
|
||
{
|
||
MethodName: "Create",
|
||
Handler: _Product_Item_Service_Create_Handler,
|
||
},
|
||
{
|
||
MethodName: "Get",
|
||
Handler: _Product_Item_Service_Get_Handler,
|
||
},
|
||
{
|
||
MethodName: "ListByProductId",
|
||
Handler: _Product_Item_Service_ListByProductId_Handler,
|
||
},
|
||
{
|
||
MethodName: "Delete",
|
||
Handler: _Product_Item_Service_Delete_Handler,
|
||
},
|
||
{
|
||
MethodName: "DeleteByReferenceId",
|
||
Handler: _Product_Item_Service_DeleteByReferenceId_Handler,
|
||
},
|
||
{
|
||
MethodName: "IncSalesCount",
|
||
Handler: _Product_Item_Service_IncSalesCount_Handler,
|
||
},
|
||
{
|
||
MethodName: "DecSalesCount",
|
||
Handler: _Product_Item_Service_DecSalesCount_Handler,
|
||
},
|
||
{
|
||
MethodName: "Update",
|
||
Handler: _Product_Item_Service_Update_Handler,
|
||
},
|
||
{
|
||
MethodName: "UpdateStatus",
|
||
Handler: _Product_Item_Service_UpdateStatus_Handler,
|
||
},
|
||
},
|
||
Streams: []grpc.StreamDesc{},
|
||
Metadata: "generate/protobuf/product.proto",
|
||
}
|