updateBidStatusLogic.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jybase/common"
  4. "context"
  5. "jyBXCore/rpc/type/bxcore"
  6. "net/http"
  7. "jyBXCore/api/internal/svc"
  8. "jyBXCore/api/internal/types"
  9. "github.com/zeromicro/go-zero/core/logx"
  10. )
  11. type UpdateBidStatusLogic struct {
  12. logx.Logger
  13. ctx context.Context
  14. svcCtx *svc.ServiceContext
  15. r *http.Request
  16. }
  17. func NewUpdateBidStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *UpdateBidStatusLogic {
  18. return &UpdateBidStatusLogic{
  19. Logger: logx.WithContext(ctx),
  20. ctx: ctx,
  21. svcCtx: svcCtx,
  22. r: r,
  23. }
  24. }
  25. func (l *UpdateBidStatusLogic) UpdateBidStatus(req *types.UpdateBidStatusReq) (resp *types.CommonResp, err error) {
  26. defer common.Catch()
  27. res, err := l.svcCtx.BxCore.UpdateBidStatus(l.ctx, &bxcore.UpdateBidStatusReq{
  28. EntId: req.EntId,
  29. EntUserId: req.EntUserId,
  30. PositionId: req.PositionId,
  31. PositionType: req.PositionType,
  32. AppId: req.AppId,
  33. MgoUserId: req.MgoUserId,
  34. AccountId: req.AccountId,
  35. UserId: req.UserId,
  36. NewUserId: req.NewUserId,
  37. BidType: req.BidType,
  38. BidStage: req.BidStage,
  39. ChannelName: req.ChannelName,
  40. ChannelPerson: req.ChannelPerson,
  41. ChannelPhone: req.ChannelPhone,
  42. IsWin: req.IsWin,
  43. Winner: req.Winner,
  44. Sid: req.Sid,
  45. EntAccountId: req.EntAccountId,
  46. Phone: req.Phone,
  47. })
  48. if err != nil {
  49. return &types.CommonResp{
  50. Err_code: -1,
  51. Err_msg: "更新失败",
  52. Data: false,
  53. }, nil
  54. }
  55. return &types.CommonResp{
  56. Err_code: res.ErrCode,
  57. Err_msg: res.ErrMsg,
  58. Data: res.Data,
  59. }, nil
  60. }