feat: product items info
This commit is contained in:
@@ -96,30 +96,42 @@ func (s *ProductServer) EditApplyPass(ctx context.Context, in *product.EditApply
|
||||
return l.EditApplyPass(in)
|
||||
}
|
||||
|
||||
// 增加库存
|
||||
func (s *ProductServer) NumberAdd(ctx context.Context, in *product.NumberAddReq) (*product.Response, error) {
|
||||
l := logic.NewNumberAddLogic(ctx, s.svcCtx)
|
||||
return l.NumberAdd(in)
|
||||
}
|
||||
|
||||
func (s *ProductServer) ApiItems(ctx context.Context, in *product.ApiItemsReq) (*product.Response, error) {
|
||||
l := logic.NewApiItemsLogic(ctx, s.svcCtx)
|
||||
return l.ApiItems(in)
|
||||
}
|
||||
|
||||
func (s *ProductServer) ApiInfo(ctx context.Context, in *product.ApiInfoReq) (*product.Response, error) {
|
||||
l := logic.NewApiInfoLogic(ctx, s.svcCtx)
|
||||
return l.ApiInfo(in)
|
||||
}
|
||||
|
||||
// 增减库存
|
||||
func (s *ProductServer) Number(ctx context.Context, in *product.NumberReq) (*emptypb.Empty, error) {
|
||||
l := logic.NewNumberLogic(ctx, s.svcCtx)
|
||||
return l.Number(in)
|
||||
}
|
||||
|
||||
// 批量增减库存(服务内按 id 排序后在同一事务中执行,防死锁)
|
||||
// 批量增减库存
|
||||
func (s *ProductServer) NumberItems(ctx context.Context, in *product.NumberItemsReq) (*emptypb.Empty, error) {
|
||||
l := logic.NewNumberItemsLogic(ctx, s.svcCtx)
|
||||
return l.NumberItems(in)
|
||||
}
|
||||
|
||||
// 获取单个产品详情
|
||||
func (s *ProductServer) InfoById(ctx context.Context, in *product.InfoByIdReq) (*product.Item, error) {
|
||||
l := logic.NewInfoByIdLogic(ctx, s.svcCtx)
|
||||
return l.InfoById(in)
|
||||
}
|
||||
|
||||
// 获取多个产品详情
|
||||
func (s *ProductServer) ItemsByIds(ctx context.Context, in *product.ItemsByIdsReq) (*product.ItemsByIdsData, error) {
|
||||
l := logic.NewItemsByIdsLogic(ctx, s.svcCtx)
|
||||
return l.ItemsByIds(in)
|
||||
}
|
||||
|
||||
// 增加库存
|
||||
func (s *ProductServer) NumberAdd(ctx context.Context, in *product.NumberAddReq) (*product.Response, error) {
|
||||
l := logic.NewNumberAddLogic(ctx, s.svcCtx)
|
||||
return l.NumberAdd(in)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user