12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package logic
- import (
- "app.yhyue.com/moapp/dataDeduplication/rpc/deduplication"
- "context"
- "app.yhyue.com/moapp/dataDeduplication/api/internal/svc"
- "app.yhyue.com/moapp/dataDeduplication/api/internal/types"
- "github.com/tal-tech/go-zero/core/logx"
- )
- type DedupAndSaveLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- func NewDedupAndSaveLogic(ctx context.Context, svcCtx *svc.ServiceContext) DedupAndSaveLogic {
- return DedupAndSaveLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
- func (l *DedupAndSaveLogic) DedupAndSave(req types.DedupByAccountReq) (*types.DedupResp, error) {
- res,_:=l.svcCtx.Dedup.DataDeduplicateAndSave(l.ctx,&deduplication.ByAccountRequest{
- InfoId: req.InfoId,
- PersonId: req.PersonId,
- AccountId: req.AccountId,
- DataDesc: req.DataDesc,
- })
- return &types.DedupResp{
- Code: res.Code,
- Msg: "请求成功",
- Data: types.Info{
- TotalCount: res.Data.TotalCount,
- ExistCount :res.Data.ExistCount,
- NewCount :res.Data.NewCount,
- },
- }, nil
- }
|