package logic import ( "app.yhyue.com/moapp/jyInfo/api/internal/svc" "app.yhyue.com/moapp/jyInfo/api/internal/types" "app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerclient" "app.yhyue.com/moapp/jybase/common" "context" "github.com/zeromicro/go-zero/core/logx" ) type InfoFileDelLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewInfoFileDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *InfoFileDelLogic { return &InfoFileDelLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } func (l *InfoFileDelLogic) InfoFileDel(req *types.InfoFileDelReq) (resp *types.CommonRes, err error) { res, err0 := l.svcCtx.Consumer.InfoFileDel(l.ctx, &consumerclient.InfoFileDelReq{ Fid: req.FileId, Fname: req.FileName, }) if err0 != nil { return &types.CommonRes{ Err_code: -1, Err_msg: "错误", Data: err0, }, nil } return &types.CommonRes{ Err_code: common.IntAll(res.ErrCode), Err_msg: res.ErrMsg, }, nil }