123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- package logic
- import (
- "context"
- "fmt"
- "bp.jydev.jianyu360.cn/BaseService/goodsCenter/rpc/pb"
- "bp.jydev.jianyu360.cn/BaseService/goodsCenter/public/service"
- "bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
- "bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type GoodsUpdLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- func NewGoodsUpdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GoodsUpdLogic {
- return &GoodsUpdLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
- func (l *GoodsUpdLogic) GoodsUpd(req *types.GoodsUpdReq) (resp *types.Reply, err error) {
- // todo: add your logic here and delete this line
- resp = &types.Reply{}
- goodsResp, err := service.GoodsCenterRpc.GoodsUpd(l.ctx, &pb.GoodsAddReq{
- Id: req.Id,
- Appid: req.AppId,
- Name: req.Name,
- StandClassifyCode: req.Stand_classify_code,
- BusinessClassifyCode: req.Business_classify_code,
- BusinessId: req.Business_id,
- PcLandpage: req.Pc_landpage,
- WxLandpage: req.Wx_landpage,
- AppLandpage: req.App_landpage,
- Logo: req.Logo,
- IntroduceImg_1: req.Introduce_img_1,
- IntroduceImg_2: req.Introduce_img_2,
- IntroduceImg_3: req.Introduce_img_3,
- Detail: req.Detail,
- Status: req.Status,
- CreatePersion: req.Create_persion,
- UpdatePerson: req.Update_person,
- Describe: req.Describe,
- Label: req.Label,
- Attributes: req.Attributes,
- })
- if goodsResp.ErrorMsg != "" {
- resp.Error_msg = goodsResp.ErrorMsg
- resp.Error_code = -1
- l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
- }
- resp.Data = map[string]interface{}{
- "status": goodsResp.Status,
- }
- return
- }
|