refactor: localize protobuf definitions
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
package mall
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -50,47 +49,47 @@ const (
|
||||
// 产品相关
|
||||
type ProductClient interface {
|
||||
// 获取产品列表
|
||||
ItemFetch(ctx context.Context, in *protobuf.MallFetchRequest, opts ...grpc.CallOption) (*ListReply, error)
|
||||
ItemFetch(ctx context.Context, in *MallFetchRequest, opts ...grpc.CallOption) (*ListReply, error)
|
||||
// 获取产品详情
|
||||
ItemDetail(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*ProductItem, error)
|
||||
ItemDetail(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*ProductItem, error)
|
||||
// 通过产品序列获取产品详情
|
||||
ItemDetailBySerial(ctx context.Context, in *protobuf.StoreSerialRequest, opts ...grpc.CallOption) (*ListReply, error)
|
||||
ItemDetailBySerial(ctx context.Context, in *StoreSerialRequest, opts ...grpc.CallOption) (*ListReply, error)
|
||||
// 通过规格编号获取产品详情
|
||||
ItemDetailBySpec(ctx context.Context, in *DetailBySpecRequest, opts ...grpc.CallOption) (*ListItem, error)
|
||||
// 添加产品
|
||||
ItemCreate(ctx context.Context, in *ProductItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
ItemCreate(ctx context.Context, in *ProductItem, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 删除产品
|
||||
ItemDelete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
ItemDelete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 发布/取消发布 产品
|
||||
ItemModify(ctx context.Context, in *ModifyRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
ItemModify(ctx context.Context, in *ModifyRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 批量操作
|
||||
ItemBatchOp(ctx context.Context, in *OpRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
ItemBatchOp(ctx context.Context, in *OpRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 产品规格列表
|
||||
SpecFetch(ctx context.Context, in *protobuf.MallFetchRequest, opts ...grpc.CallOption) (*SpecReply, error)
|
||||
SpecFetch(ctx context.Context, in *MallFetchRequest, opts ...grpc.CallOption) (*SpecReply, error)
|
||||
// 添加产品规格
|
||||
SpecCreate(ctx context.Context, in *SpecItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
SpecCreate(ctx context.Context, in *SpecItem, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 修改产品规格
|
||||
SpecModify(ctx context.Context, in *SpecItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
SpecModify(ctx context.Context, in *SpecItem, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 删除产品规格
|
||||
SpecDelete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
SpecDelete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 产品详情
|
||||
SpecDetail(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*SpecItem, error)
|
||||
SpecDetail(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*SpecItem, error)
|
||||
// 添加产品图片
|
||||
PhotoCreate(ctx context.Context, in *PhotoItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
PhotoCreate(ctx context.Context, in *PhotoItem, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 删除产品图片
|
||||
PhotoDelete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
PhotoDelete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 产品图片列表
|
||||
PhotoList(ctx context.Context, in *PhotoItem, opts ...grpc.CallOption) (*PhotoReply, error)
|
||||
// 产品的评论列表
|
||||
CommentFetch(ctx context.Context, in *protobuf.MallFetchRequest, opts ...grpc.CallOption) (*CommentListReply, error)
|
||||
CommentFetch(ctx context.Context, in *MallFetchRequest, opts ...grpc.CallOption) (*CommentListReply, error)
|
||||
// 评论
|
||||
CommentCreate(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
CommentCreate(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 回复评论
|
||||
CommentRe(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
CommentRe(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 删除评论
|
||||
CommentDelete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
CommentDelete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
// 修改评论
|
||||
CommentModify(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error)
|
||||
CommentModify(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*IdentityStatusReply, error)
|
||||
}
|
||||
|
||||
type productClient struct {
|
||||
@@ -101,7 +100,7 @@ func NewProductClient(cc grpc.ClientConnInterface) ProductClient {
|
||||
return &productClient{cc}
|
||||
}
|
||||
|
||||
func (c *productClient) ItemFetch(ctx context.Context, in *protobuf.MallFetchRequest, opts ...grpc.CallOption) (*ListReply, error) {
|
||||
func (c *productClient) ItemFetch(ctx context.Context, in *MallFetchRequest, opts ...grpc.CallOption) (*ListReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListReply)
|
||||
err := c.cc.Invoke(ctx, Product_ItemFetch_FullMethodName, in, out, cOpts...)
|
||||
@@ -111,7 +110,7 @@ func (c *productClient) ItemFetch(ctx context.Context, in *protobuf.MallFetchReq
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *productClient) ItemDetail(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*ProductItem, error) {
|
||||
func (c *productClient) ItemDetail(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*ProductItem, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ProductItem)
|
||||
err := c.cc.Invoke(ctx, Product_ItemDetail_FullMethodName, in, out, cOpts...)
|
||||
@@ -121,7 +120,7 @@ func (c *productClient) ItemDetail(ctx context.Context, in *protobuf.IdentReques
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *productClient) ItemDetailBySerial(ctx context.Context, in *protobuf.StoreSerialRequest, opts ...grpc.CallOption) (*ListReply, error) {
|
||||
func (c *productClient) ItemDetailBySerial(ctx context.Context, in *StoreSerialRequest, opts ...grpc.CallOption) (*ListReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListReply)
|
||||
err := c.cc.Invoke(ctx, Product_ItemDetailBySerial_FullMethodName, in, out, cOpts...)
|
||||
@@ -141,9 +140,9 @@ func (c *productClient) ItemDetailBySpec(ctx context.Context, in *DetailBySpecRe
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *productClient) ItemCreate(ctx context.Context, in *ProductItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *productClient) ItemCreate(ctx context.Context, in *ProductItem, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Product_ItemCreate_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -151,9 +150,9 @@ func (c *productClient) ItemCreate(ctx context.Context, in *ProductItem, opts ..
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *productClient) ItemDelete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *productClient) ItemDelete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Product_ItemDelete_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -161,9 +160,9 @@ func (c *productClient) ItemDelete(ctx context.Context, in *protobuf.IdentReques
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *productClient) ItemModify(ctx context.Context, in *ModifyRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *productClient) ItemModify(ctx context.Context, in *ModifyRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Product_ItemModify_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -171,9 +170,9 @@ func (c *productClient) ItemModify(ctx context.Context, in *ModifyRequest, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *productClient) ItemBatchOp(ctx context.Context, in *OpRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *productClient) ItemBatchOp(ctx context.Context, in *OpRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Product_ItemBatchOp_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -181,7 +180,7 @@ func (c *productClient) ItemBatchOp(ctx context.Context, in *OpRequest, opts ...
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *productClient) SpecFetch(ctx context.Context, in *protobuf.MallFetchRequest, opts ...grpc.CallOption) (*SpecReply, error) {
|
||||
func (c *productClient) SpecFetch(ctx context.Context, in *MallFetchRequest, opts ...grpc.CallOption) (*SpecReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SpecReply)
|
||||
err := c.cc.Invoke(ctx, Product_SpecFetch_FullMethodName, in, out, cOpts...)
|
||||
@@ -191,9 +190,9 @@ func (c *productClient) SpecFetch(ctx context.Context, in *protobuf.MallFetchReq
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *productClient) SpecCreate(ctx context.Context, in *SpecItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *productClient) SpecCreate(ctx context.Context, in *SpecItem, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Product_SpecCreate_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -201,9 +200,9 @@ func (c *productClient) SpecCreate(ctx context.Context, in *SpecItem, opts ...gr
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *productClient) SpecModify(ctx context.Context, in *SpecItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *productClient) SpecModify(ctx context.Context, in *SpecItem, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Product_SpecModify_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -211,9 +210,9 @@ func (c *productClient) SpecModify(ctx context.Context, in *SpecItem, opts ...gr
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *productClient) SpecDelete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *productClient) SpecDelete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Product_SpecDelete_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -221,7 +220,7 @@ func (c *productClient) SpecDelete(ctx context.Context, in *protobuf.IdentReques
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *productClient) SpecDetail(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*SpecItem, error) {
|
||||
func (c *productClient) SpecDetail(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*SpecItem, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SpecItem)
|
||||
err := c.cc.Invoke(ctx, Product_SpecDetail_FullMethodName, in, out, cOpts...)
|
||||
@@ -231,9 +230,9 @@ func (c *productClient) SpecDetail(ctx context.Context, in *protobuf.IdentReques
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *productClient) PhotoCreate(ctx context.Context, in *PhotoItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *productClient) PhotoCreate(ctx context.Context, in *PhotoItem, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Product_PhotoCreate_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -241,9 +240,9 @@ func (c *productClient) PhotoCreate(ctx context.Context, in *PhotoItem, opts ...
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *productClient) PhotoDelete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *productClient) PhotoDelete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Product_PhotoDelete_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -261,7 +260,7 @@ func (c *productClient) PhotoList(ctx context.Context, in *PhotoItem, opts ...gr
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *productClient) CommentFetch(ctx context.Context, in *protobuf.MallFetchRequest, opts ...grpc.CallOption) (*CommentListReply, error) {
|
||||
func (c *productClient) CommentFetch(ctx context.Context, in *MallFetchRequest, opts ...grpc.CallOption) (*CommentListReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CommentListReply)
|
||||
err := c.cc.Invoke(ctx, Product_CommentFetch_FullMethodName, in, out, cOpts...)
|
||||
@@ -271,9 +270,9 @@ func (c *productClient) CommentFetch(ctx context.Context, in *protobuf.MallFetch
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *productClient) CommentCreate(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *productClient) CommentCreate(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Product_CommentCreate_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -281,9 +280,9 @@ func (c *productClient) CommentCreate(ctx context.Context, in *CommentItem, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *productClient) CommentRe(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *productClient) CommentRe(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Product_CommentRe_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -291,9 +290,9 @@ func (c *productClient) CommentRe(ctx context.Context, in *CommentItem, opts ...
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *productClient) CommentDelete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *productClient) CommentDelete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Product_CommentDelete_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -301,9 +300,9 @@ func (c *productClient) CommentDelete(ctx context.Context, in *protobuf.IdentReq
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *productClient) CommentModify(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*protobuf.IdentityStatusReply, error) {
|
||||
func (c *productClient) CommentModify(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*IdentityStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.IdentityStatusReply)
|
||||
out := new(IdentityStatusReply)
|
||||
err := c.cc.Invoke(ctx, Product_CommentModify_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -318,47 +317,47 @@ func (c *productClient) CommentModify(ctx context.Context, in *CommentItem, opts
|
||||
// 产品相关
|
||||
type ProductServer interface {
|
||||
// 获取产品列表
|
||||
ItemFetch(context.Context, *protobuf.MallFetchRequest) (*ListReply, error)
|
||||
ItemFetch(context.Context, *MallFetchRequest) (*ListReply, error)
|
||||
// 获取产品详情
|
||||
ItemDetail(context.Context, *protobuf.IdentRequest) (*ProductItem, error)
|
||||
ItemDetail(context.Context, *IdentRequest) (*ProductItem, error)
|
||||
// 通过产品序列获取产品详情
|
||||
ItemDetailBySerial(context.Context, *protobuf.StoreSerialRequest) (*ListReply, error)
|
||||
ItemDetailBySerial(context.Context, *StoreSerialRequest) (*ListReply, error)
|
||||
// 通过规格编号获取产品详情
|
||||
ItemDetailBySpec(context.Context, *DetailBySpecRequest) (*ListItem, error)
|
||||
// 添加产品
|
||||
ItemCreate(context.Context, *ProductItem) (*protobuf.IdentityStatusReply, error)
|
||||
ItemCreate(context.Context, *ProductItem) (*IdentityStatusReply, error)
|
||||
// 删除产品
|
||||
ItemDelete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error)
|
||||
ItemDelete(context.Context, *IdentRequest) (*IdentityStatusReply, error)
|
||||
// 发布/取消发布 产品
|
||||
ItemModify(context.Context, *ModifyRequest) (*protobuf.IdentityStatusReply, error)
|
||||
ItemModify(context.Context, *ModifyRequest) (*IdentityStatusReply, error)
|
||||
// 批量操作
|
||||
ItemBatchOp(context.Context, *OpRequest) (*protobuf.IdentityStatusReply, error)
|
||||
ItemBatchOp(context.Context, *OpRequest) (*IdentityStatusReply, error)
|
||||
// 产品规格列表
|
||||
SpecFetch(context.Context, *protobuf.MallFetchRequest) (*SpecReply, error)
|
||||
SpecFetch(context.Context, *MallFetchRequest) (*SpecReply, error)
|
||||
// 添加产品规格
|
||||
SpecCreate(context.Context, *SpecItem) (*protobuf.IdentityStatusReply, error)
|
||||
SpecCreate(context.Context, *SpecItem) (*IdentityStatusReply, error)
|
||||
// 修改产品规格
|
||||
SpecModify(context.Context, *SpecItem) (*protobuf.IdentityStatusReply, error)
|
||||
SpecModify(context.Context, *SpecItem) (*IdentityStatusReply, error)
|
||||
// 删除产品规格
|
||||
SpecDelete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error)
|
||||
SpecDelete(context.Context, *IdentRequest) (*IdentityStatusReply, error)
|
||||
// 产品详情
|
||||
SpecDetail(context.Context, *protobuf.IdentRequest) (*SpecItem, error)
|
||||
SpecDetail(context.Context, *IdentRequest) (*SpecItem, error)
|
||||
// 添加产品图片
|
||||
PhotoCreate(context.Context, *PhotoItem) (*protobuf.IdentityStatusReply, error)
|
||||
PhotoCreate(context.Context, *PhotoItem) (*IdentityStatusReply, error)
|
||||
// 删除产品图片
|
||||
PhotoDelete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error)
|
||||
PhotoDelete(context.Context, *IdentRequest) (*IdentityStatusReply, error)
|
||||
// 产品图片列表
|
||||
PhotoList(context.Context, *PhotoItem) (*PhotoReply, error)
|
||||
// 产品的评论列表
|
||||
CommentFetch(context.Context, *protobuf.MallFetchRequest) (*CommentListReply, error)
|
||||
CommentFetch(context.Context, *MallFetchRequest) (*CommentListReply, error)
|
||||
// 评论
|
||||
CommentCreate(context.Context, *CommentItem) (*protobuf.IdentityStatusReply, error)
|
||||
CommentCreate(context.Context, *CommentItem) (*IdentityStatusReply, error)
|
||||
// 回复评论
|
||||
CommentRe(context.Context, *CommentItem) (*protobuf.IdentityStatusReply, error)
|
||||
CommentRe(context.Context, *CommentItem) (*IdentityStatusReply, error)
|
||||
// 删除评论
|
||||
CommentDelete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error)
|
||||
CommentDelete(context.Context, *IdentRequest) (*IdentityStatusReply, error)
|
||||
// 修改评论
|
||||
CommentModify(context.Context, *CommentItem) (*protobuf.IdentityStatusReply, error)
|
||||
CommentModify(context.Context, *CommentItem) (*IdentityStatusReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedProductServer should be embedded to have
|
||||
@@ -368,67 +367,67 @@ type ProductServer interface {
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedProductServer struct{}
|
||||
|
||||
func (UnimplementedProductServer) ItemFetch(context.Context, *protobuf.MallFetchRequest) (*ListReply, error) {
|
||||
func (UnimplementedProductServer) ItemFetch(context.Context, *MallFetchRequest) (*ListReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ItemFetch not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) ItemDetail(context.Context, *protobuf.IdentRequest) (*ProductItem, error) {
|
||||
func (UnimplementedProductServer) ItemDetail(context.Context, *IdentRequest) (*ProductItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ItemDetail not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) ItemDetailBySerial(context.Context, *protobuf.StoreSerialRequest) (*ListReply, error) {
|
||||
func (UnimplementedProductServer) ItemDetailBySerial(context.Context, *StoreSerialRequest) (*ListReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ItemDetailBySerial not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) ItemDetailBySpec(context.Context, *DetailBySpecRequest) (*ListItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ItemDetailBySpec not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) ItemCreate(context.Context, *ProductItem) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedProductServer) ItemCreate(context.Context, *ProductItem) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ItemCreate not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) ItemDelete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedProductServer) ItemDelete(context.Context, *IdentRequest) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ItemDelete not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) ItemModify(context.Context, *ModifyRequest) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedProductServer) ItemModify(context.Context, *ModifyRequest) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ItemModify not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) ItemBatchOp(context.Context, *OpRequest) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedProductServer) ItemBatchOp(context.Context, *OpRequest) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ItemBatchOp not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) SpecFetch(context.Context, *protobuf.MallFetchRequest) (*SpecReply, error) {
|
||||
func (UnimplementedProductServer) SpecFetch(context.Context, *MallFetchRequest) (*SpecReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SpecFetch not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) SpecCreate(context.Context, *SpecItem) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedProductServer) SpecCreate(context.Context, *SpecItem) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SpecCreate not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) SpecModify(context.Context, *SpecItem) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedProductServer) SpecModify(context.Context, *SpecItem) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SpecModify not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) SpecDelete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedProductServer) SpecDelete(context.Context, *IdentRequest) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SpecDelete not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) SpecDetail(context.Context, *protobuf.IdentRequest) (*SpecItem, error) {
|
||||
func (UnimplementedProductServer) SpecDetail(context.Context, *IdentRequest) (*SpecItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SpecDetail not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) PhotoCreate(context.Context, *PhotoItem) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedProductServer) PhotoCreate(context.Context, *PhotoItem) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method PhotoCreate not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) PhotoDelete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedProductServer) PhotoDelete(context.Context, *IdentRequest) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method PhotoDelete not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) PhotoList(context.Context, *PhotoItem) (*PhotoReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method PhotoList not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) CommentFetch(context.Context, *protobuf.MallFetchRequest) (*CommentListReply, error) {
|
||||
func (UnimplementedProductServer) CommentFetch(context.Context, *MallFetchRequest) (*CommentListReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CommentFetch not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) CommentCreate(context.Context, *CommentItem) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedProductServer) CommentCreate(context.Context, *CommentItem) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CommentCreate not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) CommentRe(context.Context, *CommentItem) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedProductServer) CommentRe(context.Context, *CommentItem) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CommentRe not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) CommentDelete(context.Context, *protobuf.IdentRequest) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedProductServer) CommentDelete(context.Context, *IdentRequest) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CommentDelete not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) CommentModify(context.Context, *CommentItem) (*protobuf.IdentityStatusReply, error) {
|
||||
func (UnimplementedProductServer) CommentModify(context.Context, *CommentItem) (*IdentityStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CommentModify not implemented")
|
||||
}
|
||||
func (UnimplementedProductServer) testEmbeddedByValue() {}
|
||||
@@ -452,7 +451,7 @@ func RegisterProductServer(s grpc.ServiceRegistrar, srv ProductServer) {
|
||||
}
|
||||
|
||||
func _Product_ItemFetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.MallFetchRequest)
|
||||
in := new(MallFetchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -464,13 +463,13 @@ func _Product_ItemFetch_Handler(srv interface{}, ctx context.Context, dec func(i
|
||||
FullMethod: Product_ItemFetch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ProductServer).ItemFetch(ctx, req.(*protobuf.MallFetchRequest))
|
||||
return srv.(ProductServer).ItemFetch(ctx, req.(*MallFetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Product_ItemDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -482,13 +481,13 @@ func _Product_ItemDetail_Handler(srv interface{}, ctx context.Context, dec func(
|
||||
FullMethod: Product_ItemDetail_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ProductServer).ItemDetail(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(ProductServer).ItemDetail(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Product_ItemDetailBySerial_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.StoreSerialRequest)
|
||||
in := new(StoreSerialRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -500,7 +499,7 @@ func _Product_ItemDetailBySerial_Handler(srv interface{}, ctx context.Context, d
|
||||
FullMethod: Product_ItemDetailBySerial_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ProductServer).ItemDetailBySerial(ctx, req.(*protobuf.StoreSerialRequest))
|
||||
return srv.(ProductServer).ItemDetailBySerial(ctx, req.(*StoreSerialRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -542,7 +541,7 @@ func _Product_ItemCreate_Handler(srv interface{}, ctx context.Context, dec func(
|
||||
}
|
||||
|
||||
func _Product_ItemDelete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -554,7 +553,7 @@ func _Product_ItemDelete_Handler(srv interface{}, ctx context.Context, dec func(
|
||||
FullMethod: Product_ItemDelete_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ProductServer).ItemDelete(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(ProductServer).ItemDelete(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -596,7 +595,7 @@ func _Product_ItemBatchOp_Handler(srv interface{}, ctx context.Context, dec func
|
||||
}
|
||||
|
||||
func _Product_SpecFetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.MallFetchRequest)
|
||||
in := new(MallFetchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -608,7 +607,7 @@ func _Product_SpecFetch_Handler(srv interface{}, ctx context.Context, dec func(i
|
||||
FullMethod: Product_SpecFetch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ProductServer).SpecFetch(ctx, req.(*protobuf.MallFetchRequest))
|
||||
return srv.(ProductServer).SpecFetch(ctx, req.(*MallFetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -650,7 +649,7 @@ func _Product_SpecModify_Handler(srv interface{}, ctx context.Context, dec func(
|
||||
}
|
||||
|
||||
func _Product_SpecDelete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -662,13 +661,13 @@ func _Product_SpecDelete_Handler(srv interface{}, ctx context.Context, dec func(
|
||||
FullMethod: Product_SpecDelete_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ProductServer).SpecDelete(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(ProductServer).SpecDelete(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Product_SpecDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -680,7 +679,7 @@ func _Product_SpecDetail_Handler(srv interface{}, ctx context.Context, dec func(
|
||||
FullMethod: Product_SpecDetail_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ProductServer).SpecDetail(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(ProductServer).SpecDetail(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -704,7 +703,7 @@ func _Product_PhotoCreate_Handler(srv interface{}, ctx context.Context, dec func
|
||||
}
|
||||
|
||||
func _Product_PhotoDelete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -716,7 +715,7 @@ func _Product_PhotoDelete_Handler(srv interface{}, ctx context.Context, dec func
|
||||
FullMethod: Product_PhotoDelete_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ProductServer).PhotoDelete(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(ProductServer).PhotoDelete(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -740,7 +739,7 @@ func _Product_PhotoList_Handler(srv interface{}, ctx context.Context, dec func(i
|
||||
}
|
||||
|
||||
func _Product_CommentFetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.MallFetchRequest)
|
||||
in := new(MallFetchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -752,7 +751,7 @@ func _Product_CommentFetch_Handler(srv interface{}, ctx context.Context, dec fun
|
||||
FullMethod: Product_CommentFetch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ProductServer).CommentFetch(ctx, req.(*protobuf.MallFetchRequest))
|
||||
return srv.(ProductServer).CommentFetch(ctx, req.(*MallFetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -794,7 +793,7 @@ func _Product_CommentRe_Handler(srv interface{}, ctx context.Context, dec func(i
|
||||
}
|
||||
|
||||
func _Product_CommentDelete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -806,7 +805,7 @@ func _Product_CommentDelete_Handler(srv interface{}, ctx context.Context, dec fu
|
||||
FullMethod: Product_CommentDelete_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ProductServer).CommentDelete(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(ProductServer).CommentDelete(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user