123456789101112131415161718192021222324252627282930313233343536373839404142 |
- package logic
- import (
- "context"
- "fmt"
- "log"
- "bp.jydev.jianyu360.cn/BaseService/goodsCenter/public/entity"
- "bp.jydev.jianyu360.cn/BaseService/goodsCenter/rpc/internal/svc"
- "bp.jydev.jianyu360.cn/BaseService/goodsCenter/rpc/pb"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type GetBaseGoodsStandClassifyLogic struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- logx.Logger
- }
- func NewGetBaseGoodsStandClassifyLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetBaseGoodsStandClassifyLogic {
- return &GetBaseGoodsStandClassifyLogic{
- ctx: ctx,
- svcCtx: svcCtx,
- Logger: logx.WithContext(ctx),
- }
- }
- // 查看标准商品分类
- func (l *GetBaseGoodsStandClassifyLogic) GetBaseGoodsStandClassify(in *pb.ClassifyReq) (*pb.ClassifyResp, error) {
- // todo: add your logic here and delete this line
- resp := &pb.ClassifyResp{}
- if in.Appid == "" {
- l.Error(fmt.Sprintf("%+v", in), "无效的参数appid")
- return resp, nil
- }
- ret := entity.Base_goods_stand_classify.GetBaseGoodsStandClass(in.Appid)
- // resp.Classify = JsonUnmarshal(ret, []*pb.Classify{}).([]*pb.Classify)
- log.Println(ret)
- resp.Classify = ret
- return resp, nil
- }
|