getbasegoodsstandclassifylogic.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package logic
  2. import (
  3. "context"
  4. "fmt"
  5. "bp.jydev.jianyu360.cn/BaseService/goodsCenter/rpc/pb"
  6. "bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
  7. "bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
  8. . "bp.jydev.jianyu360.cn/BaseService/goodsCenter/public/service"
  9. "github.com/zeromicro/go-zero/core/logx"
  10. )
  11. type GetBaseGoodsStandClassifyLogic struct {
  12. logx.Logger
  13. ctx context.Context
  14. svcCtx *svc.ServiceContext
  15. }
  16. func NewGetBaseGoodsStandClassifyLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetBaseGoodsStandClassifyLogic {
  17. return &GetBaseGoodsStandClassifyLogic{
  18. Logger: logx.WithContext(ctx),
  19. ctx: ctx,
  20. svcCtx: svcCtx,
  21. }
  22. }
  23. func (l *GetBaseGoodsStandClassifyLogic) GetBaseGoodsStandClassify(req *types.BaseGoodsClassifyReq) (resp *types.Reply, err error) {
  24. // todo: add your logic here and delete this line
  25. resp = &types.Reply{}
  26. list, err := GoodsCenterRpc.GetBaseGoodsStandClassify(l.ctx, &pb.ClassifyReq{
  27. Appid: req.AppId,
  28. })
  29. if err != nil {
  30. resp.Error_msg = err.Error()
  31. resp.Error_code = 0
  32. l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
  33. }
  34. resp.Error_code = 1
  35. resp.Data = list
  36. return
  37. }