newestBiddingLogic.go 1.1 KB

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