distributeclueshowlogic.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package logic
  2. import (
  3. "context"
  4. "bp.jydev.jianyu360.cn/BaseService/biService/api/internal/svc"
  5. "bp.jydev.jianyu360.cn/BaseService/biService/api/internal/types"
  6. "bp.jydev.jianyu360.cn/BaseService/biService/rpc/biservice"
  7. "github.com/gogf/gf/v2/util/gconv"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type DistributeClueShowLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. }
  15. func NewDistributeClueShowLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DistributeClueShowLogic {
  16. return &DistributeClueShowLogic{
  17. Logger: logx.WithContext(ctx),
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. }
  21. }
  22. func (l *DistributeClueShowLogic) DistributeClueShow(req *types.DistributeClueShowReq) (resp *types.BiResp, err error) {
  23. // todo: add your logic here and delete this line
  24. datas := []*biservice.DistributeClueShows{}
  25. for _, v := range req.Datas {
  26. data := &biservice.DistributeClueShows{
  27. PositionId: gconv.Int64(v["positionId"]),
  28. DistributedCount: gconv.Int64(v["distributedCount"]),
  29. }
  30. datas = append(datas, data)
  31. }
  32. res, err := l.svcCtx.BiServiceRpc.DistributeClueShow(l.ctx, &biservice.DistributeClueShowReq{
  33. DataType: req.DataType,
  34. ClueIdList: req.ClueIdList,
  35. PositionId: req.PositionId,
  36. Datas: datas,
  37. IsTask: req.IsTask,
  38. UpdatePositionID: req.UpdatePositionID,
  39. })
  40. return &types.BiResp{Error_code: res.ErrorCode, Error_msg: res.ErrorMsg, Data: res.Data}, err
  41. }