newestBiddingLogic.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jybase/common"
  4. "context"
  5. "jyBXBase/api/internal/svc"
  6. "jyBXBase/api/internal/types"
  7. "jyBXBase/rpc/bxbase"
  8. "net/http"
  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. City: req.City,
  28. IsSearch: req.IsSearch,
  29. EntId: req.EntId,
  30. EntUserId: req.EntUserId,
  31. PositionId: req.PositionId,
  32. PositionType: req.PositionType,
  33. AppId: req.AppId,
  34. MgoUserId: req.MgoUserId,
  35. AccountId: req.AccountId,
  36. UserId: req.UserId,
  37. NewUserId: req.NewUserId,
  38. EntAccountId: req.EntAccountId,
  39. Phone: req.Phone,
  40. })
  41. if err0 != nil {
  42. return &types.CommonRes{
  43. Err_code: -1,
  44. Err_msg: "错误",
  45. Data: nil,
  46. }, nil
  47. }
  48. return &types.CommonRes{
  49. Err_code: common.IntAll(res.ErrCode),
  50. Err_msg: res.ErrMsg,
  51. Data: res.Data,
  52. }, nil
  53. }