participateShowLogic.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. EntAccountId: req.EntAccountId,
  37. })
  38. if err != nil {
  39. return &types.CommonResp{
  40. Err_code: -1,
  41. Err_msg: "查询失败",
  42. Data: []map[string]interface{}{},
  43. }, nil
  44. }
  45. return &types.CommonResp{
  46. Err_code: res.ErrCode,
  47. Err_msg: res.ErrMsg,
  48. Data: res.Data,
  49. }, nil
  50. }