participateActionLogic.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 ParticipateActionLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. r *http.Request
  15. }
  16. func NewParticipateActionLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *ParticipateActionLogic {
  17. return &ParticipateActionLogic{
  18. Logger: logx.WithContext(ctx),
  19. ctx: ctx,
  20. svcCtx: svcCtx,
  21. r: r,
  22. }
  23. }
  24. func (l *ParticipateActionLogic) ParticipateAction(req *types.ParticipateActionReq) (resp *types.CommonResp, err error) {
  25. res, err := l.svcCtx.BxCore.ParticipateAction(l.ctx, &bxcore.ParticipateActionReq{
  26. EntId: req.EntId,
  27. EntUserId: req.EntUserId,
  28. PositionId: req.PositionId,
  29. PositionType: req.PositionType,
  30. BidId: req.BidId,
  31. ToEntUserId: req.ToEntUserId,
  32. IsRetain: req.IsRetain,
  33. ActionType: req.ActionType,
  34. })
  35. if err != nil {
  36. return &types.CommonResp{
  37. Err_code: res.ErrCode,
  38. Err_msg: res.ErrMsg,
  39. Data: false,
  40. }, nil
  41. }
  42. return &types.CommonResp{
  43. Err_code: res.ErrCode,
  44. Err_msg: res.ErrMsg,
  45. Data: res.Data,
  46. }, nil
  47. return
  48. }