newestBiddingLogic.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. PositionType: req.PositionType,
  35. })
  36. if err0 != nil {
  37. return &types.CommonRes{
  38. Err_code: -1,
  39. Err_msg: "错误",
  40. Data: nil,
  41. }, nil
  42. }
  43. return &types.CommonRes{
  44. Err_code: common.IntAll(res.ErrCode),
  45. Err_msg: res.ErrMsg,
  46. Data: res.Data,
  47. }, nil
  48. }