|
@@ -0,0 +1,48 @@
|
|
|
+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 DatadeduplicationLogic struct {
|
|
|
+ logx.Logger
|
|
|
+ ctx context.Context
|
|
|
+ svcCtx *svc.ServiceContext
|
|
|
+}
|
|
|
+
|
|
|
+func NewDatadeduplicationLogic(ctx context.Context, svcCtx *svc.ServiceContext) DatadeduplicationLogic {
|
|
|
+ return DatadeduplicationLogic{
|
|
|
+ Logger: logx.WithContext(ctx),
|
|
|
+ ctx: ctx,
|
|
|
+ svcCtx: svcCtx,
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+func (l *DatadeduplicationLogic) Datadeduplication(req types.DedupReq) (*types.DedupResp, error) {
|
|
|
+ // todo: add your logic here and delete this line
|
|
|
+ res,err:=l.svcCtx.Dedup.DataDeduplication(l.ctx,&deduplication.Request{
|
|
|
+ InfoId: req.InfoId,
|
|
|
+ EntId: req.EntId,
|
|
|
+ IsInsert:req.IsInsert,
|
|
|
+ IsEnt: req.IsEnt,
|
|
|
+ PersonId: req.PersonId,
|
|
|
+ })
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return &types.DedupResp{
|
|
|
+ Code: 0,
|
|
|
+ Msg: "请求成功",
|
|
|
+ Data: types.Info{
|
|
|
+ TotalCount: res.Data.TotalCount,
|
|
|
+ ExistCount :res.Data.ExistCount,
|
|
|
+ NewCount :res.Data.NewCount,
|
|
|
+ },
|
|
|
+ }, nil
|
|
|
+}
|