浏览代码

空接口

fuwencai 4 年之前
父节点
当前提交
c6b27e2ecb

+ 4 - 3
entity/deduplication.go

@@ -1,7 +1,8 @@
 package entity
 
 type Deduplication struct {
-	InfoId   string `xorm:"info_id" form:"info_id" json:"info_id"`
-	PersonId string `xorm:"person_id" form:"person_id" json:"person_id"`
-	EntId    string `xorm:"ent_id" form:"ent_id" json:"ent_id"`
+	InfoId    string `xorm:"info_id" form:"info_id" json:"info_id"`
+	PersonId  string `xorm:"person_id" form:"person_id" json:"person_id"`
+	EntId     string `xorm:"ent_id" form:"ent_id" json:"ent_id"`
+	AccountId string `xorm:"account_id" form:"account_id" json:"account_id"`
 }

+ 2 - 8
rpc/deduplication.proto

@@ -38,12 +38,6 @@ message ByAccountRequest {
   string  infoId = 2;      //信息id  逗号分隔
   string accountId = 3;    // 账户id
 }
-// 根据账户id判重返回值
-message ByAccountResponse {
-  int64  code = 1;    //响应代码
-  string message = 2;  //响应消息
-  Info   data = 3;     //响应内容
-}
 
 service Deduplication {
   // 数据判重
@@ -51,7 +45,7 @@ service Deduplication {
   // 获取企业数据总量
   rpc GetEntCount(GetEntCountRequest) returns(GetEntCountResponse);
   //  根据账户id进行判重
-  rpc dataDeduplicateByAccount(ByAccountRequest) returns(ByAccountResponse);
+  rpc dataDeduplicateByAccount(ByAccountRequest) returns(Response);
   //  根据账户id判重并存入数据
-  rpc dataDeduplicateAndSave(ByAccountRequest) returns(ByAccountRequest);
+  rpc dataDeduplicateAndSave(ByAccountRequest) returns(Response);
 }

+ 47 - 133
rpc/deduplication/deduplication.pb.go

@@ -416,70 +416,6 @@ func (x *ByAccountRequest) GetAccountId() string {
 	return ""
 }
 
-// 根据账户id判重返回值
-type ByAccountResponse struct {
-	state         protoimpl.MessageState
-	sizeCache     protoimpl.SizeCache
-	unknownFields protoimpl.UnknownFields
-
-	Code    int64  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`      //响应代码
-	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` //响应消息
-	Data    *Info  `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`       //响应内容
-}
-
-func (x *ByAccountResponse) Reset() {
-	*x = ByAccountResponse{}
-	if protoimpl.UnsafeEnabled {
-		mi := &file_deduplication_proto_msgTypes[6]
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		ms.StoreMessageInfo(mi)
-	}
-}
-
-func (x *ByAccountResponse) String() string {
-	return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ByAccountResponse) ProtoMessage() {}
-
-func (x *ByAccountResponse) ProtoReflect() protoreflect.Message {
-	mi := &file_deduplication_proto_msgTypes[6]
-	if protoimpl.UnsafeEnabled && x != nil {
-		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
-		if ms.LoadMessageInfo() == nil {
-			ms.StoreMessageInfo(mi)
-		}
-		return ms
-	}
-	return mi.MessageOf(x)
-}
-
-// Deprecated: Use ByAccountResponse.ProtoReflect.Descriptor instead.
-func (*ByAccountResponse) Descriptor() ([]byte, []int) {
-	return file_deduplication_proto_rawDescGZIP(), []int{6}
-}
-
-func (x *ByAccountResponse) GetCode() int64 {
-	if x != nil {
-		return x.Code
-	}
-	return 0
-}
-
-func (x *ByAccountResponse) GetMessage() string {
-	if x != nil {
-		return x.Message
-	}
-	return ""
-}
-
-func (x *ByAccountResponse) GetData() *Info {
-	if x != nil {
-		return x.Data
-	}
-	return nil
-}
-
 var File_deduplication_proto protoreflect.FileDescriptor
 
 var file_deduplication_proto_rawDesc = []byte{
@@ -522,37 +458,29 @@ var file_deduplication_proto_rawDesc = []byte{
 	0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x6e, 0x66, 0x6f, 0x49, 0x64, 0x18, 0x02,
 	0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6e, 0x66, 0x6f, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09,
 	0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x6a, 0x0a, 0x11, 0x42, 0x79,
-	0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
-	0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63,
-	0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x27, 0x0a,
-	0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x65,
-	0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x66, 0x6f,
-	0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0xe6, 0x02, 0x0a, 0x0d, 0x44, 0x65, 0x64, 0x75, 0x70,
-	0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x44, 0x0a, 0x11, 0x64, 0x61, 0x74, 0x61,
-	0x44, 0x65, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e,
-	0x64, 0x65, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65,
+	0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x32, 0xd5, 0x02, 0x0a, 0x0d, 0x44,
+	0x65, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x44, 0x0a, 0x11,
+	0x64, 0x61, 0x74, 0x61, 0x44, 0x65, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+	0x6e, 0x12, 0x16, 0x2e, 0x64, 0x65, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+	0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x64, 0x65, 0x64, 0x75,
+	0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+	0x73, 0x65, 0x12, 0x54, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e,
+	0x74, 0x12, 0x21, 0x2e, 0x64, 0x65, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+	0x6e, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71,
+	0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x64, 0x65, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61,
+	0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74,
+	0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x18, 0x64, 0x61, 0x74, 0x61,
+	0x44, 0x65, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x42, 0x79, 0x41, 0x63, 0x63,
+	0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x2e, 0x64, 0x65, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61,
+	0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65,
 	0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x64, 0x65, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63,
-	0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54,
-	0x0a, 0x0b, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x21, 0x2e,
-	0x64, 0x65, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65,
-	0x74, 0x45, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
-	0x1a, 0x22, 0x2e, 0x64, 0x65, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
-	0x2e, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70,
-	0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x18, 0x64, 0x61, 0x74, 0x61, 0x44, 0x65, 0x64, 0x75,
-	0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x42, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
-	0x12, 0x1f, 0x2e, 0x64, 0x65, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
-	0x2e, 0x42, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
-	0x74, 0x1a, 0x20, 0x2e, 0x64, 0x65, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
-	0x6e, 0x2e, 0x42, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
-	0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x16, 0x64, 0x61, 0x74, 0x61, 0x44, 0x65, 0x64, 0x75, 0x70,
-	0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x64, 0x53, 0x61, 0x76, 0x65, 0x12, 0x1f, 0x2e,
-	0x64, 0x65, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x79,
-	0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f,
-	0x2e, 0x64, 0x65, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42,
-	0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x62,
-	0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52,
+	0x0a, 0x16, 0x64, 0x61, 0x74, 0x61, 0x44, 0x65, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+	0x65, 0x41, 0x6e, 0x64, 0x53, 0x61, 0x76, 0x65, 0x12, 0x1f, 0x2e, 0x64, 0x65, 0x64, 0x75, 0x70,
+	0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75,
+	0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x64, 0x65, 0x64, 0x75,
+	0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+	0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -567,7 +495,7 @@ func file_deduplication_proto_rawDescGZIP() []byte {
 	return file_deduplication_proto_rawDescData
 }
 
-var file_deduplication_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
+var file_deduplication_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
 var file_deduplication_proto_goTypes = []interface{}{
 	(*Request)(nil),             // 0: deduplication.Request
 	(*Info)(nil),                // 1: deduplication.Info
@@ -575,24 +503,22 @@ var file_deduplication_proto_goTypes = []interface{}{
 	(*Response)(nil),            // 3: deduplication.Response
 	(*GetEntCountResponse)(nil), // 4: deduplication.GetEntCountResponse
 	(*ByAccountRequest)(nil),    // 5: deduplication.ByAccountRequest
-	(*ByAccountResponse)(nil),   // 6: deduplication.ByAccountResponse
 }
 var file_deduplication_proto_depIdxs = []int32{
 	1, // 0: deduplication.Response.data:type_name -> deduplication.Info
-	1, // 1: deduplication.ByAccountResponse.data:type_name -> deduplication.Info
-	0, // 2: deduplication.Deduplication.dataDeduplication:input_type -> deduplication.Request
-	2, // 3: deduplication.Deduplication.GetEntCount:input_type -> deduplication.GetEntCountRequest
-	5, // 4: deduplication.Deduplication.dataDeduplicateByAccount:input_type -> deduplication.ByAccountRequest
-	5, // 5: deduplication.Deduplication.dataDeduplicateAndSave:input_type -> deduplication.ByAccountRequest
-	3, // 6: deduplication.Deduplication.dataDeduplication:output_type -> deduplication.Response
-	4, // 7: deduplication.Deduplication.GetEntCount:output_type -> deduplication.GetEntCountResponse
-	6, // 8: deduplication.Deduplication.dataDeduplicateByAccount:output_type -> deduplication.ByAccountResponse
-	5, // 9: deduplication.Deduplication.dataDeduplicateAndSave:output_type -> deduplication.ByAccountRequest
-	6, // [6:10] is the sub-list for method output_type
-	2, // [2:6] is the sub-list for method input_type
-	2, // [2:2] is the sub-list for extension type_name
-	2, // [2:2] is the sub-list for extension extendee
-	0, // [0:2] is the sub-list for field type_name
+	0, // 1: deduplication.Deduplication.dataDeduplication:input_type -> deduplication.Request
+	2, // 2: deduplication.Deduplication.GetEntCount:input_type -> deduplication.GetEntCountRequest
+	5, // 3: deduplication.Deduplication.dataDeduplicateByAccount:input_type -> deduplication.ByAccountRequest
+	5, // 4: deduplication.Deduplication.dataDeduplicateAndSave:input_type -> deduplication.ByAccountRequest
+	3, // 5: deduplication.Deduplication.dataDeduplication:output_type -> deduplication.Response
+	4, // 6: deduplication.Deduplication.GetEntCount:output_type -> deduplication.GetEntCountResponse
+	3, // 7: deduplication.Deduplication.dataDeduplicateByAccount:output_type -> deduplication.Response
+	3, // 8: deduplication.Deduplication.dataDeduplicateAndSave:output_type -> deduplication.Response
+	5, // [5:9] is the sub-list for method output_type
+	1, // [1:5] is the sub-list for method input_type
+	1, // [1:1] is the sub-list for extension type_name
+	1, // [1:1] is the sub-list for extension extendee
+	0, // [0:1] is the sub-list for field type_name
 }
 
 func init() { file_deduplication_proto_init() }
@@ -673,18 +599,6 @@ func file_deduplication_proto_init() {
 				return nil
 			}
 		}
-		file_deduplication_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*ByAccountResponse); i {
-			case 0:
-				return &v.state
-			case 1:
-				return &v.sizeCache
-			case 2:
-				return &v.unknownFields
-			default:
-				return nil
-			}
-		}
 	}
 	type x struct{}
 	out := protoimpl.TypeBuilder{
@@ -692,7 +606,7 @@ func file_deduplication_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_deduplication_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   7,
+			NumMessages:   6,
 			NumExtensions: 0,
 			NumServices:   1,
 		},
@@ -723,9 +637,9 @@ type DeduplicationClient interface {
 	// 获取企业数据总量
 	GetEntCount(ctx context.Context, in *GetEntCountRequest, opts ...grpc.CallOption) (*GetEntCountResponse, error)
 	//  根据账户id进行判重
-	DataDeduplicateByAccount(ctx context.Context, in *ByAccountRequest, opts ...grpc.CallOption) (*ByAccountResponse, error)
+	DataDeduplicateByAccount(ctx context.Context, in *ByAccountRequest, opts ...grpc.CallOption) (*Response, error)
 	//  根据账户id判重并存入数据
-	DataDeduplicateAndSave(ctx context.Context, in *ByAccountRequest, opts ...grpc.CallOption) (*ByAccountRequest, error)
+	DataDeduplicateAndSave(ctx context.Context, in *ByAccountRequest, opts ...grpc.CallOption) (*Response, error)
 }
 
 type deduplicationClient struct {
@@ -754,8 +668,8 @@ func (c *deduplicationClient) GetEntCount(ctx context.Context, in *GetEntCountRe
 	return out, nil
 }
 
-func (c *deduplicationClient) DataDeduplicateByAccount(ctx context.Context, in *ByAccountRequest, opts ...grpc.CallOption) (*ByAccountResponse, error) {
-	out := new(ByAccountResponse)
+func (c *deduplicationClient) DataDeduplicateByAccount(ctx context.Context, in *ByAccountRequest, opts ...grpc.CallOption) (*Response, error) {
+	out := new(Response)
 	err := c.cc.Invoke(ctx, "/deduplication.Deduplication/dataDeduplicateByAccount", in, out, opts...)
 	if err != nil {
 		return nil, err
@@ -763,8 +677,8 @@ func (c *deduplicationClient) DataDeduplicateByAccount(ctx context.Context, in *
 	return out, nil
 }
 
-func (c *deduplicationClient) DataDeduplicateAndSave(ctx context.Context, in *ByAccountRequest, opts ...grpc.CallOption) (*ByAccountRequest, error) {
-	out := new(ByAccountRequest)
+func (c *deduplicationClient) DataDeduplicateAndSave(ctx context.Context, in *ByAccountRequest, opts ...grpc.CallOption) (*Response, error) {
+	out := new(Response)
 	err := c.cc.Invoke(ctx, "/deduplication.Deduplication/dataDeduplicateAndSave", in, out, opts...)
 	if err != nil {
 		return nil, err
@@ -779,9 +693,9 @@ type DeduplicationServer interface {
 	// 获取企业数据总量
 	GetEntCount(context.Context, *GetEntCountRequest) (*GetEntCountResponse, error)
 	//  根据账户id进行判重
-	DataDeduplicateByAccount(context.Context, *ByAccountRequest) (*ByAccountResponse, error)
+	DataDeduplicateByAccount(context.Context, *ByAccountRequest) (*Response, error)
 	//  根据账户id判重并存入数据
-	DataDeduplicateAndSave(context.Context, *ByAccountRequest) (*ByAccountRequest, error)
+	DataDeduplicateAndSave(context.Context, *ByAccountRequest) (*Response, error)
 }
 
 // UnimplementedDeduplicationServer can be embedded to have forward compatible implementations.
@@ -794,10 +708,10 @@ func (*UnimplementedDeduplicationServer) DataDeduplication(context.Context, *Req
 func (*UnimplementedDeduplicationServer) GetEntCount(context.Context, *GetEntCountRequest) (*GetEntCountResponse, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method GetEntCount not implemented")
 }
-func (*UnimplementedDeduplicationServer) DataDeduplicateByAccount(context.Context, *ByAccountRequest) (*ByAccountResponse, error) {
+func (*UnimplementedDeduplicationServer) DataDeduplicateByAccount(context.Context, *ByAccountRequest) (*Response, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method DataDeduplicateByAccount not implemented")
 }
-func (*UnimplementedDeduplicationServer) DataDeduplicateAndSave(context.Context, *ByAccountRequest) (*ByAccountRequest, error) {
+func (*UnimplementedDeduplicationServer) DataDeduplicateAndSave(context.Context, *ByAccountRequest) (*Response, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method DataDeduplicateAndSave not implemented")
 }
 

+ 7 - 8
rpc/deduplicationclient/deduplication.go

@@ -14,13 +14,12 @@ import (
 )
 
 type (
-	Response            = deduplication.Response
-	GetEntCountResponse = deduplication.GetEntCountResponse
-	ByAccountRequest    = deduplication.ByAccountRequest
-	ByAccountResponse   = deduplication.ByAccountResponse
 	Request             = deduplication.Request
 	Info                = deduplication.Info
 	GetEntCountRequest  = deduplication.GetEntCountRequest
+	Response            = deduplication.Response
+	GetEntCountResponse = deduplication.GetEntCountResponse
+	ByAccountRequest    = deduplication.ByAccountRequest
 
 	Deduplication interface {
 		//  数据判重
@@ -28,9 +27,9 @@ type (
 		//  获取企业数据总量
 		GetEntCount(ctx context.Context, in *GetEntCountRequest) (*GetEntCountResponse, error)
 		//   根据账户id进行判重
-		DataDeduplicateByAccount(ctx context.Context, in *ByAccountRequest) (*ByAccountResponse, error)
+		DataDeduplicateByAccount(ctx context.Context, in *ByAccountRequest) (*Response, error)
 		//   根据账户id判重并存入数据
-		DataDeduplicateAndSave(ctx context.Context, in *ByAccountRequest) (*ByAccountRequest, error)
+		DataDeduplicateAndSave(ctx context.Context, in *ByAccountRequest) (*Response, error)
 	}
 
 	defaultDeduplication struct {
@@ -57,13 +56,13 @@ func (m *defaultDeduplication) GetEntCount(ctx context.Context, in *GetEntCountR
 }
 
 //   根据账户id进行判重
-func (m *defaultDeduplication) DataDeduplicateByAccount(ctx context.Context, in *ByAccountRequest) (*ByAccountResponse, error) {
+func (m *defaultDeduplication) DataDeduplicateByAccount(ctx context.Context, in *ByAccountRequest) (*Response, error) {
 	client := deduplication.NewDeduplicationClient(m.cli.Conn())
 	return client.DataDeduplicateByAccount(ctx, in)
 }
 
 //   根据账户id判重并存入数据
-func (m *defaultDeduplication) DataDeduplicateAndSave(ctx context.Context, in *ByAccountRequest) (*ByAccountRequest, error) {
+func (m *defaultDeduplication) DataDeduplicateAndSave(ctx context.Context, in *ByAccountRequest) (*Response, error) {
 	client := deduplication.NewDeduplicationClient(m.cli.Conn())
 	return client.DataDeduplicateAndSave(ctx, in)
 }

+ 11 - 4
rpc/internal/logic/datadeduplicateandsavelogic.go

@@ -24,8 +24,15 @@ func NewDataDeduplicateAndSaveLogic(ctx context.Context, svcCtx *svc.ServiceCont
 }
 
 //   根据账户id判重并存入数据
-func (l *DataDeduplicateAndSaveLogic) DataDeduplicateAndSave(in *deduplication.ByAccountRequest) (*deduplication.ByAccountRequest, error) {
-	// todo: add your logic here and delete this line
-
-	return &deduplication.ByAccountRequest{}, nil
+func (l *DataDeduplicateAndSaveLogic) DataDeduplicateAndSave(in *deduplication.ByAccountRequest) (*deduplication.Response, error) {
+	info,err:=deduplicationService.DataDeduplicateByAccountId(in)
+	code := 0
+	if err!= ""{
+		code = -1
+	}
+	return &deduplication.Response{
+		Data: info,
+		Message: err,
+		Code: int64(code),
+	}, nil
 }

+ 11 - 4
rpc/internal/logic/datadeduplicatebyaccountlogic.go

@@ -24,8 +24,15 @@ func NewDataDeduplicateByAccountLogic(ctx context.Context, svcCtx *svc.ServiceCo
 }
 
 //   根据账户id进行判重
-func (l *DataDeduplicateByAccountLogic) DataDeduplicateByAccount(in *deduplication.ByAccountRequest) (*deduplication.ByAccountResponse, error) {
-	// todo: add your logic here and delete this line
-
-	return &deduplication.ByAccountResponse{}, nil
+func (l *DataDeduplicateByAccountLogic) DataDeduplicateByAccount(in *deduplication.ByAccountRequest) (*deduplication.Response, error) {
+	info,err:=deduplicationService.DataDeduplicateAndSave(in)
+	code := 0
+	if err!= ""{
+		code = -1
+	}
+	return &deduplication.Response{
+		Data: info,
+		Message: err,
+		Code: int64(code),
+	}, nil
 }

+ 2 - 2
rpc/internal/server/deduplicationserver.go

@@ -34,13 +34,13 @@ func (s *DeduplicationServer) GetEntCount(ctx context.Context, in *deduplication
 }
 
 //   根据账户id进行判重
-func (s *DeduplicationServer) DataDeduplicateByAccount(ctx context.Context, in *deduplication.ByAccountRequest) (*deduplication.ByAccountResponse, error) {
+func (s *DeduplicationServer) DataDeduplicateByAccount(ctx context.Context, in *deduplication.ByAccountRequest) (*deduplication.Response, error) {
 	l := logic.NewDataDeduplicateByAccountLogic(ctx, s.svcCtx)
 	return l.DataDeduplicateByAccount(in)
 }
 
 //   根据账户id判重并存入数据
-func (s *DeduplicationServer) DataDeduplicateAndSave(ctx context.Context, in *deduplication.ByAccountRequest) (*deduplication.ByAccountRequest, error) {
+func (s *DeduplicationServer) DataDeduplicateAndSave(ctx context.Context, in *deduplication.ByAccountRequest) (*deduplication.Response, error) {
 	l := logic.NewDataDeduplicateAndSaveLogic(ctx, s.svcCtx)
 	return l.DataDeduplicateAndSave(in)
 }