infofiledellogic.go 1013 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jyInfo/api/internal/svc"
  4. "app.yhyue.com/moapp/jyInfo/api/internal/types"
  5. "app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerclient"
  6. "app.yhyue.com/moapp/jybase/common"
  7. "context"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type InfoFileDelLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. }
  15. func NewInfoFileDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *InfoFileDelLogic {
  16. return &InfoFileDelLogic{
  17. Logger: logx.WithContext(ctx),
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. }
  21. }
  22. func (l *InfoFileDelLogic) InfoFileDel(req *types.InfoFileDelReq) (resp *types.CommonRes, err error) {
  23. res, err0 := l.svcCtx.Consumer.InfoFileDel(l.ctx, &consumerclient.InfoFileDelReq{
  24. Fid: req.FileId,
  25. Fname: req.FileName,
  26. })
  27. if err0 != nil {
  28. return &types.CommonRes{
  29. Err_code: -1,
  30. Err_msg: "错误",
  31. Data: err0,
  32. }, nil
  33. }
  34. return &types.CommonRes{
  35. Err_code: common.IntAll(res.ErrCode),
  36. Err_msg: res.ErrMsg,
  37. }, nil
  38. }