updateBidStatusLogic.go 1.5 KB

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