newestBiddingLogic.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jybase/common"
  4. "context"
  5. "jyBXBase/rpc/bxbase"
  6. "net/http"
  7. "jyBXBase/api/internal/svc"
  8. "jyBXBase/api/internal/types"
  9. "github.com/zeromicro/go-zero/core/logx"
  10. )
  11. type NewestBiddingLogic struct {
  12. logx.Logger
  13. ctx context.Context
  14. svcCtx *svc.ServiceContext
  15. r *http.Request
  16. }
  17. func NewNewestBiddingLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *NewestBiddingLogic {
  18. return &NewestBiddingLogic{
  19. Logger: logx.WithContext(ctx),
  20. ctx: ctx,
  21. svcCtx: svcCtx,
  22. r: r,
  23. }
  24. }
  25. func (l *NewestBiddingLogic) NewestBidding(req *types.NewestReq) (resp *types.CommonRes, err error) {
  26. res, err0 := l.svcCtx.Bxbase.NewestBidding(l.ctx, &bxbase.NewestBiddingReq{
  27. UserId: req.UserId,
  28. AppId: req.AppId,
  29. City: req.City,
  30. IsSearch: req.IsSearch,
  31. EntUserId: req.EntUserId,
  32. NewUserId: req.NewUserId,
  33. EntId: req.EntId,
  34. })
  35. if err0 != nil {
  36. return &types.CommonRes{
  37. Err_code: -1,
  38. Err_msg: "错误",
  39. Data: nil,
  40. }, nil
  41. }
  42. return &types.CommonRes{
  43. Err_code: common.IntAll(res.ErrCode),
  44. Err_msg: res.ErrMsg,
  45. Data: res.Data,
  46. }, nil
  47. }