participateShowLogic.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 ParticipateShowLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. r *http.Request
  15. }
  16. func NewParticipateShowLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *ParticipateShowLogic {
  17. return &ParticipateShowLogic{
  18. Logger: logx.WithContext(ctx),
  19. ctx: ctx,
  20. svcCtx: svcCtx,
  21. r: r,
  22. }
  23. }
  24. func (l *ParticipateShowLogic) ParticipateShow(req *types.ParticipateShowReq) (resp *types.CommonResp, err error) {
  25. res, err := l.svcCtx.BxCore.ParticipateShow(l.ctx, &bxcore.ParticipateShowReq{
  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. Ids: req.Ids,
  36. })
  37. if err != nil {
  38. return &types.CommonResp{
  39. Err_code: -1,
  40. Err_msg: "查询失败",
  41. Data: []map[string]interface{}{},
  42. }, nil
  43. }
  44. return &types.CommonResp{
  45. Err_code: res.ErrCode,
  46. Err_msg: res.ErrMsg,
  47. Data: res.Data,
  48. }, nil
  49. }