pushStatisticsLogic.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jybase/encrypt"
  4. "context"
  5. "jyBXCore/rpc/type/bxcore"
  6. "jyBXCore/api/internal/svc"
  7. "jyBXCore/api/internal/types"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type PushStatisticsLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. }
  15. func NewPushStatisticsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PushStatisticsLogic {
  16. return &PushStatisticsLogic{
  17. Logger: logx.WithContext(ctx),
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. }
  21. }
  22. func (l *PushStatisticsLogic) PushStatistics(req *types.PtatisticsListReq) (resp *types.CommonPushResp, err error) {
  23. // todo: add your logic here and delete this line
  24. for k, v := range req.EntUserIdArr {
  25. req.EntUserIdArr[k] = encrypt.SE.Decode4Hex(v)
  26. }
  27. res, err := l.svcCtx.BxCore.PushStatistics(l.ctx, &bxcore.StatisticsListReq{
  28. EntId: req.EntId,
  29. EntUserId: req.EntUserId,
  30. PositionId: req.PositionId,
  31. EntUserIdArr: req.EntUserIdArr,
  32. DeptId: req.DeptId,
  33. StartTime: req.StartTime,
  34. EndTime: req.EndTime,
  35. Source: req.Source,
  36. IsMobile: req.IsMobile,
  37. })
  38. if err != nil {
  39. return nil, err
  40. }
  41. return &types.CommonPushResp{
  42. Data: res.Data,
  43. SourceItem: res.SourceItem,
  44. }, nil
  45. }