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 GoodsDelLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewGoodsDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GoodsDelLogic { return &GoodsDelLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } func (l *GoodsDelLogic) GoodsDel(req *types.GoodsIdReq) (resp *types.Reply, err error) { // todo: add your logic here and delete this line resp = &types.Reply{} goodsResp, err := service.GoodsCenterRpc.GoodsDel(l.ctx, &pb.GoodsDelReq{ Appid: req.AppId, Id: req.Id, }) 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 }