pushStatisticsLogic.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. })
  37. if err != nil {
  38. return nil, err
  39. }
  40. return &types.CommonPushResp{
  41. Data: res.Data,
  42. SourceItem: res.SourceItem,
  43. }, nil
  44. }