refactor: localize protobuf definitions
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"bsm/full/module/ec/mall/internal/logic/product"
|
||||
pb "bsm/full/module/ec/mall/pb"
|
||||
"context"
|
||||
)
|
||||
|
||||
type ProductServer struct {
|
||||
@@ -16,7 +16,7 @@ func NewProductServer() *ProductServer {
|
||||
}
|
||||
|
||||
// 获取产品列表
|
||||
func (s *ProductServer) ItemFetch(ctx context.Context, in *pb.FetchRequest) (*pb.ListReply, error) {
|
||||
func (s *ProductServer) ItemFetch(ctx context.Context, in *pb.MallFetchRequest) (*pb.ListReply, error) {
|
||||
return product.ItemFetch(ctx, in)
|
||||
}
|
||||
|
||||
@@ -36,42 +36,42 @@ func (s *ProductServer) ItemDetailBySpec(ctx context.Context, in *pb.DetailBySpe
|
||||
}
|
||||
|
||||
// 添加产品
|
||||
func (s *ProductServer) ItemCreate(ctx context.Context, in *pb.ProductItem) (*pb.StatusReply, error) {
|
||||
func (s *ProductServer) ItemCreate(ctx context.Context, in *pb.ProductItem) (*pb.IdentityStatusReply, error) {
|
||||
return product.ItemCreate(ctx, in)
|
||||
}
|
||||
|
||||
// 删除产品
|
||||
func (s *ProductServer) ItemDelete(ctx context.Context, in *pb.IdentRequest) (*pb.StatusReply, error) {
|
||||
func (s *ProductServer) ItemDelete(ctx context.Context, in *pb.IdentRequest) (*pb.IdentityStatusReply, error) {
|
||||
return product.ItemDelete(ctx, in)
|
||||
}
|
||||
|
||||
// 发布/取消发布 产品
|
||||
func (s *ProductServer) ItemModify(ctx context.Context, in *pb.ModifyRequest) (*pb.StatusReply, error) {
|
||||
func (s *ProductServer) ItemModify(ctx context.Context, in *pb.ModifyRequest) (*pb.IdentityStatusReply, error) {
|
||||
return product.ItemModify(ctx, in)
|
||||
}
|
||||
|
||||
// 批量操作
|
||||
func (s *ProductServer) ItemBatchOp(ctx context.Context, in *pb.OpRequest) (*pb.StatusReply, error) {
|
||||
func (s *ProductServer) ItemBatchOp(ctx context.Context, in *pb.OpRequest) (*pb.IdentityStatusReply, error) {
|
||||
return product.ItemBatchOp(ctx, in)
|
||||
}
|
||||
|
||||
// 产品规格列表
|
||||
func (s *ProductServer) SpecFetch(ctx context.Context, in *pb.FetchRequest) (*pb.SpecReply, error) {
|
||||
func (s *ProductServer) SpecFetch(ctx context.Context, in *pb.MallFetchRequest) (*pb.SpecReply, error) {
|
||||
return product.SpecFetch(ctx, in)
|
||||
}
|
||||
|
||||
// 添加产品规格
|
||||
func (s *ProductServer) SpecCreate(ctx context.Context, in *pb.SpecItem) (*pb.StatusReply, error) {
|
||||
func (s *ProductServer) SpecCreate(ctx context.Context, in *pb.SpecItem) (*pb.IdentityStatusReply, error) {
|
||||
return product.SpecCreate(ctx, in)
|
||||
}
|
||||
|
||||
// 修改产品规格
|
||||
func (s *ProductServer) SpecModify(ctx context.Context, in *pb.SpecItem) (*pb.StatusReply, error) {
|
||||
func (s *ProductServer) SpecModify(ctx context.Context, in *pb.SpecItem) (*pb.IdentityStatusReply, error) {
|
||||
return product.SpecModify(ctx, in)
|
||||
}
|
||||
|
||||
// 删除产品规格
|
||||
func (s *ProductServer) SpecDelete(ctx context.Context, in *pb.IdentRequest) (*pb.StatusReply, error) {
|
||||
func (s *ProductServer) SpecDelete(ctx context.Context, in *pb.IdentRequest) (*pb.IdentityStatusReply, error) {
|
||||
return product.SpecDelete(ctx, in)
|
||||
}
|
||||
|
||||
@@ -81,12 +81,12 @@ func (s *ProductServer) SpecDetail(ctx context.Context, in *pb.IdentRequest) (*p
|
||||
}
|
||||
|
||||
// 添加产品图片
|
||||
func (s *ProductServer) PhotoCreate(ctx context.Context, in *pb.PhotoItem) (*pb.StatusReply, error) {
|
||||
func (s *ProductServer) PhotoCreate(ctx context.Context, in *pb.PhotoItem) (*pb.IdentityStatusReply, error) {
|
||||
return product.PhotoCreate(ctx, in)
|
||||
}
|
||||
|
||||
// 删除产品图片
|
||||
func (s *ProductServer) PhotoDelete(ctx context.Context, in *pb.IdentRequest) (*pb.StatusReply, error) {
|
||||
func (s *ProductServer) PhotoDelete(ctx context.Context, in *pb.IdentRequest) (*pb.IdentityStatusReply, error) {
|
||||
return product.PhotoDelete(ctx, in)
|
||||
}
|
||||
|
||||
@@ -96,26 +96,26 @@ func (s *ProductServer) PhotoList(ctx context.Context, in *pb.PhotoItem) (*pb.Ph
|
||||
}
|
||||
|
||||
// 产品的评论列表
|
||||
func (s *ProductServer) CommentFetch(ctx context.Context, in *pb.FetchRequest) (*pb.CommentListReply, error) {
|
||||
func (s *ProductServer) CommentFetch(ctx context.Context, in *pb.MallFetchRequest) (*pb.CommentListReply, error) {
|
||||
return product.CommentFetch(ctx, in)
|
||||
}
|
||||
|
||||
// 评论
|
||||
func (s *ProductServer) CommentCreate(ctx context.Context, in *pb.CommentItem) (*pb.StatusReply, error) {
|
||||
func (s *ProductServer) CommentCreate(ctx context.Context, in *pb.CommentItem) (*pb.IdentityStatusReply, error) {
|
||||
return product.CommentCreate(ctx, in)
|
||||
}
|
||||
|
||||
// 回复评论
|
||||
func (s *ProductServer) CommentRe(ctx context.Context, in *pb.CommentItem) (*pb.StatusReply, error) {
|
||||
func (s *ProductServer) CommentRe(ctx context.Context, in *pb.CommentItem) (*pb.IdentityStatusReply, error) {
|
||||
return product.CommentRe(ctx, in)
|
||||
}
|
||||
|
||||
// 删除评论
|
||||
func (s *ProductServer) CommentDelete(ctx context.Context, in *pb.IdentRequest) (*pb.StatusReply, error) {
|
||||
func (s *ProductServer) CommentDelete(ctx context.Context, in *pb.IdentRequest) (*pb.IdentityStatusReply, error) {
|
||||
return product.CommentDelete(ctx, in)
|
||||
}
|
||||
|
||||
// 修改评论
|
||||
func (s *ProductServer) CommentModify(ctx context.Context, in *pb.CommentItem) (*pb.StatusReply, error) {
|
||||
func (s *ProductServer) CommentModify(ctx context.Context, in *pb.CommentItem) (*pb.IdentityStatusReply, error) {
|
||||
return product.CommentModify(ctx, in)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user