participateRecordsLogic.go 1.4 KB

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