Browse Source

小纸条

wfz 3 years ago
parent
commit
14f101c49c
4 changed files with 98 additions and 51 deletions
  1. 56 49
      api/chat/chat.pb.go
  2. 2 0
      api/chat/chat.proto
  3. 38 0
      api/chat/chat_grpc.pb.go
  4. 2 2
      define/account.go

+ 56 - 49
api/chat/chat.pb.go

@@ -2167,7 +2167,7 @@ var file_chat_proto_rawDesc = []byte{
 	0x20, 0x0a, 0x0b, 0x6c, 0x69, 0x6b, 0x65, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x01,
 	0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6c, 0x69, 0x6b, 0x65, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74,
 	0x79, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
-	0x03, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x32, 0xb4, 0x1b, 0x0a, 0x04, 0x43, 0x68,
+	0x03, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x32, 0x82, 0x1c, 0x0a, 0x04, 0x43, 0x68,
 	0x61, 0x74, 0x12, 0x69, 0x0a, 0x1e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x50,
 	0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x49, 0x73, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e,
 	0x73, 0x68, 0x69, 0x70, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
@@ -2387,11 +2387,16 @@ var file_chat_proto_rawDesc = []byte{
 	0x2d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x61, 0x6e,
 	0x61, 0x67, 0x65, 0x72, 0x46, 0x69, 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x44, 0x65,
 	0x74, 0x61, 0x69, 0x6c, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00,
-	0x42, 0x3d, 0x0a, 0x08, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x50, 0x01, 0x5a, 0x2f,
-	0x67, 0x69, 0x74, 0x2e, 0x69, 0x6b, 0x75, 0x62, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73,
-	0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x77, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
-	0x66, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x68, 0x61, 0x74, 0x3b, 0x63, 0x68, 0x61, 0x74, 0x62,
-	0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x12, 0x4c, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 0x42,
+	0x79, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e,
+	0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x49, 0x44, 0x50,
+	0x61, 0x72, 0x61, 0x6d, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
+	0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x3d,
+	0x0a, 0x08, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x69,
+	0x74, 0x2e, 0x69, 0x6b, 0x75, 0x62, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x72,
+	0x76, 0x65, 0x72, 0x2f, 0x70, 0x77, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,
+	0x61, 0x70, 0x69, 0x2f, 0x63, 0x68, 0x61, 0x74, 0x3b, 0x63, 0x68, 0x61, 0x74, 0x62, 0x06, 0x70,
+	0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -2518,49 +2523,51 @@ var file_chat_proto_depIdxs = []int32{
 	49, // 40: api.chat.Chat.ManagerDeleteScrip:input_type -> api.common.IDParam
 	50, // 41: api.chat.Chat.ManagerFindReportList:input_type -> api.common.ManagerFindReportListRequest
 	51, // 42: api.chat.Chat.ManagerFindReportDetailsList:input_type -> api.common.ManagerFindReportDetailsListRequest
-	22, // 43: api.chat.Chat.CheckUserPartnerIsRelationship:output_type -> api.chat.CheckUserPartnerIsRelationshipReply
-	23, // 44: api.chat.Chat.CreateChatRoom:output_type -> api.chat.RoomReply
-	52, // 45: api.chat.Chat.FindOnlinePersonList:output_type -> api.common.RecommendPersonListReply
-	52, // 46: api.chat.Chat.FindRecommendPersonList:output_type -> api.common.RecommendPersonListReply
-	16, // 47: api.chat.Chat.PartnerFindRoomList:output_type -> api.chat.PartnerFindRoomListReply
-	14, // 48: api.chat.Chat.UserFindRoomList:output_type -> api.chat.UserFindRoomListReply
-	21, // 49: api.chat.Chat.Receive:output_type -> api.chat.ReceiveReply
-	53, // 50: api.chat.Chat.FindChatRecordList:output_type -> api.common.ChatRecordListReply
-	54, // 51: api.chat.Chat.FindChatRoomMsg:output_type -> api.common.ChatRoomMsg
-	42, // 52: api.chat.Chat.SetBlackChat:output_type -> google.protobuf.Empty
-	42, // 53: api.chat.Chat.DeleteChat:output_type -> google.protobuf.Empty
-	42, // 54: api.chat.Chat.Report:output_type -> google.protobuf.Empty
-	55, // 55: api.chat.Chat.FindRoomCardMsg:output_type -> api.common.RoomChatMsg
-	56, // 56: api.chat.Chat.CreateScrip:output_type -> api.common.ScripID
-	42, // 57: api.chat.Chat.DeleteScrip:output_type -> google.protobuf.Empty
-	57, // 58: api.chat.Chat.FindMyScrip:output_type -> api.common.ScripReply
-	57, // 59: api.chat.Chat.FindOtherScrip:output_type -> api.common.ScripReply
-	57, // 60: api.chat.Chat.FindRecommendScrip:output_type -> api.common.ScripReply
-	42, // 61: api.chat.Chat.PersonLookScrip:output_type -> google.protobuf.Empty
-	58, // 62: api.chat.Chat.PersonClickLookBack:output_type -> api.common.ScripInfo
-	59, // 63: api.chat.Chat.PersonReplyScrip:output_type -> api.common.ChatRecordInfo
-	26, // 64: api.chat.Chat.GetWindowInfo:output_type -> api.chat.WindowInfo
-	6,  // 65: api.chat.Chat.GetRandomMatching:output_type -> api.chat.GetRandomMatchingReply
-	60, // 66: api.chat.Chat.GetMatchingPartnerInfo:output_type -> api.common.GetMatchingPartnerInfoReply
-	42, // 67: api.chat.Chat.PartnerCollect:output_type -> google.protobuf.Empty
-	42, // 68: api.chat.Chat.PartnerDeleteCollect:output_type -> google.protobuf.Empty
-	53, // 69: api.chat.Chat.FindChatCollectList:output_type -> api.common.ChatRecordListReply
-	42, // 70: api.chat.Chat.UserUnlockVoice:output_type -> google.protobuf.Empty
-	42, // 71: api.chat.Chat.UserUnlockPicture:output_type -> google.protobuf.Empty
-	2,  // 72: api.chat.Chat.GetRoomProfit:output_type -> api.chat.GetRoomProfitReply
-	0,  // 73: api.chat.Chat.GetOnlinePersonNum:output_type -> api.chat.GetOnlinePersonNumReply
-	8,  // 74: api.chat.Chat.FindUserAllUnreadNum:output_type -> api.chat.UnreadNumReply
-	15, // 75: api.chat.Chat.GetUserRoomByPerson:output_type -> api.chat.UserRoomInfo
-	61, // 76: api.chat.Chat.ManagerFindRoomList:output_type -> api.common.ManagerFindRoomListReply
-	53, // 77: api.chat.Chat.ManagerFindChatRecordList:output_type -> api.common.ChatRecordListReply
-	62, // 78: api.chat.Chat.ManagerFindScripList:output_type -> api.common.ManagerScripReply
-	42, // 79: api.chat.Chat.ManagerUpdateScripText:output_type -> google.protobuf.Empty
-	42, // 80: api.chat.Chat.ManagerUpdateScripPicture:output_type -> google.protobuf.Empty
-	42, // 81: api.chat.Chat.ManagerDeleteScrip:output_type -> google.protobuf.Empty
-	63, // 82: api.chat.Chat.ManagerFindReportList:output_type -> api.common.ManagerFindReportListReply
-	64, // 83: api.chat.Chat.ManagerFindReportDetailsList:output_type -> api.common.ManagerFindReportDetailsListReply
-	43, // [43:84] is the sub-list for method output_type
-	2,  // [2:43] is the sub-list for method input_type
+	43, // 43: api.chat.Chat.DeleteScripByPersonID:input_type -> api.common.PersonIDParam
+	22, // 44: api.chat.Chat.CheckUserPartnerIsRelationship:output_type -> api.chat.CheckUserPartnerIsRelationshipReply
+	23, // 45: api.chat.Chat.CreateChatRoom:output_type -> api.chat.RoomReply
+	52, // 46: api.chat.Chat.FindOnlinePersonList:output_type -> api.common.RecommendPersonListReply
+	52, // 47: api.chat.Chat.FindRecommendPersonList:output_type -> api.common.RecommendPersonListReply
+	16, // 48: api.chat.Chat.PartnerFindRoomList:output_type -> api.chat.PartnerFindRoomListReply
+	14, // 49: api.chat.Chat.UserFindRoomList:output_type -> api.chat.UserFindRoomListReply
+	21, // 50: api.chat.Chat.Receive:output_type -> api.chat.ReceiveReply
+	53, // 51: api.chat.Chat.FindChatRecordList:output_type -> api.common.ChatRecordListReply
+	54, // 52: api.chat.Chat.FindChatRoomMsg:output_type -> api.common.ChatRoomMsg
+	42, // 53: api.chat.Chat.SetBlackChat:output_type -> google.protobuf.Empty
+	42, // 54: api.chat.Chat.DeleteChat:output_type -> google.protobuf.Empty
+	42, // 55: api.chat.Chat.Report:output_type -> google.protobuf.Empty
+	55, // 56: api.chat.Chat.FindRoomCardMsg:output_type -> api.common.RoomChatMsg
+	56, // 57: api.chat.Chat.CreateScrip:output_type -> api.common.ScripID
+	42, // 58: api.chat.Chat.DeleteScrip:output_type -> google.protobuf.Empty
+	57, // 59: api.chat.Chat.FindMyScrip:output_type -> api.common.ScripReply
+	57, // 60: api.chat.Chat.FindOtherScrip:output_type -> api.common.ScripReply
+	57, // 61: api.chat.Chat.FindRecommendScrip:output_type -> api.common.ScripReply
+	42, // 62: api.chat.Chat.PersonLookScrip:output_type -> google.protobuf.Empty
+	58, // 63: api.chat.Chat.PersonClickLookBack:output_type -> api.common.ScripInfo
+	59, // 64: api.chat.Chat.PersonReplyScrip:output_type -> api.common.ChatRecordInfo
+	26, // 65: api.chat.Chat.GetWindowInfo:output_type -> api.chat.WindowInfo
+	6,  // 66: api.chat.Chat.GetRandomMatching:output_type -> api.chat.GetRandomMatchingReply
+	60, // 67: api.chat.Chat.GetMatchingPartnerInfo:output_type -> api.common.GetMatchingPartnerInfoReply
+	42, // 68: api.chat.Chat.PartnerCollect:output_type -> google.protobuf.Empty
+	42, // 69: api.chat.Chat.PartnerDeleteCollect:output_type -> google.protobuf.Empty
+	53, // 70: api.chat.Chat.FindChatCollectList:output_type -> api.common.ChatRecordListReply
+	42, // 71: api.chat.Chat.UserUnlockVoice:output_type -> google.protobuf.Empty
+	42, // 72: api.chat.Chat.UserUnlockPicture:output_type -> google.protobuf.Empty
+	2,  // 73: api.chat.Chat.GetRoomProfit:output_type -> api.chat.GetRoomProfitReply
+	0,  // 74: api.chat.Chat.GetOnlinePersonNum:output_type -> api.chat.GetOnlinePersonNumReply
+	8,  // 75: api.chat.Chat.FindUserAllUnreadNum:output_type -> api.chat.UnreadNumReply
+	15, // 76: api.chat.Chat.GetUserRoomByPerson:output_type -> api.chat.UserRoomInfo
+	61, // 77: api.chat.Chat.ManagerFindRoomList:output_type -> api.common.ManagerFindRoomListReply
+	53, // 78: api.chat.Chat.ManagerFindChatRecordList:output_type -> api.common.ChatRecordListReply
+	62, // 79: api.chat.Chat.ManagerFindScripList:output_type -> api.common.ManagerScripReply
+	42, // 80: api.chat.Chat.ManagerUpdateScripText:output_type -> google.protobuf.Empty
+	42, // 81: api.chat.Chat.ManagerUpdateScripPicture:output_type -> google.protobuf.Empty
+	42, // 82: api.chat.Chat.ManagerDeleteScrip:output_type -> google.protobuf.Empty
+	63, // 83: api.chat.Chat.ManagerFindReportList:output_type -> api.common.ManagerFindReportListReply
+	64, // 84: api.chat.Chat.ManagerFindReportDetailsList:output_type -> api.common.ManagerFindReportDetailsListReply
+	42, // 85: api.chat.Chat.DeleteScripByPersonID:output_type -> google.protobuf.Empty
+	44, // [44:86] is the sub-list for method output_type
+	2,  // [2:44] 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

+ 2 - 0
api/chat/chat.proto

@@ -99,6 +99,8 @@ service Chat {
   rpc ManagerFindReportList (common.ManagerFindReportListRequest) returns (common.ManagerFindReportListReply){};
   // 管理员查询某个举报者的举报详情列表
   rpc ManagerFindReportDetailsList (common.ManagerFindReportDetailsListRequest) returns (common.ManagerFindReportDetailsListReply){};
+  // 用户被拉黑后删除精选中的小纸条
+  rpc DeleteScripByPersonID (common.PersonIDParam) returns (google.protobuf.Empty){};
 }
 
 message GetOnlinePersonNumReply{

+ 38 - 0
api/chat/chat_grpc.pb.go

@@ -107,6 +107,8 @@ type ChatClient interface {
 	ManagerFindReportList(ctx context.Context, in *common.ManagerFindReportListRequest, opts ...grpc.CallOption) (*common.ManagerFindReportListReply, error)
 	// 管理员查询某个举报者的举报详情列表
 	ManagerFindReportDetailsList(ctx context.Context, in *common.ManagerFindReportDetailsListRequest, opts ...grpc.CallOption) (*common.ManagerFindReportDetailsListReply, error)
+	// 用户被拉黑后删除精选中的小纸条
+	DeleteScripByPersonID(ctx context.Context, in *common.PersonIDParam, opts ...grpc.CallOption) (*emptypb.Empty, error)
 }
 
 type chatClient struct {
@@ -486,6 +488,15 @@ func (c *chatClient) ManagerFindReportDetailsList(ctx context.Context, in *commo
 	return out, nil
 }
 
+func (c *chatClient) DeleteScripByPersonID(ctx context.Context, in *common.PersonIDParam, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+	out := new(emptypb.Empty)
+	err := c.cc.Invoke(ctx, "/api.chat.Chat/DeleteScripByPersonID", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // ChatServer is the server API for Chat service.
 // All implementations must embed UnimplementedChatServer
 // for forward compatibility
@@ -577,6 +588,8 @@ type ChatServer interface {
 	ManagerFindReportList(context.Context, *common.ManagerFindReportListRequest) (*common.ManagerFindReportListReply, error)
 	// 管理员查询某个举报者的举报详情列表
 	ManagerFindReportDetailsList(context.Context, *common.ManagerFindReportDetailsListRequest) (*common.ManagerFindReportDetailsListReply, error)
+	// 用户被拉黑后删除精选中的小纸条
+	DeleteScripByPersonID(context.Context, *common.PersonIDParam) (*emptypb.Empty, error)
 	mustEmbedUnimplementedChatServer()
 }
 
@@ -707,6 +720,9 @@ func (UnimplementedChatServer) ManagerFindReportList(context.Context, *common.Ma
 func (UnimplementedChatServer) ManagerFindReportDetailsList(context.Context, *common.ManagerFindReportDetailsListRequest) (*common.ManagerFindReportDetailsListReply, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method ManagerFindReportDetailsList not implemented")
 }
+func (UnimplementedChatServer) DeleteScripByPersonID(context.Context, *common.PersonIDParam) (*emptypb.Empty, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method DeleteScripByPersonID not implemented")
+}
 func (UnimplementedChatServer) mustEmbedUnimplementedChatServer() {}
 
 // UnsafeChatServer may be embedded to opt out of forward compatibility for this service.
@@ -1458,6 +1474,24 @@ func _Chat_ManagerFindReportDetailsList_Handler(srv interface{}, ctx context.Con
 	return interceptor(ctx, in, info, handler)
 }
 
+func _Chat_DeleteScripByPersonID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(common.PersonIDParam)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ChatServer).DeleteScripByPersonID(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.chat.Chat/DeleteScripByPersonID",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ChatServer).DeleteScripByPersonID(ctx, req.(*common.PersonIDParam))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 // Chat_ServiceDesc is the grpc.ServiceDesc for Chat service.
 // It's only intended for direct use with grpc.RegisterService,
 // and not to be introspected or modified (even as a copy)
@@ -1629,6 +1663,10 @@ var Chat_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "ManagerFindReportDetailsList",
 			Handler:    _Chat_ManagerFindReportDetailsList_Handler,
 		},
+		{
+			MethodName: "DeleteScripByPersonID",
+			Handler:    _Chat_DeleteScripByPersonID_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "chat.proto",

+ 2 - 2
define/account.go

@@ -15,6 +15,6 @@ var (
 )
 
 var (
-	TypeScripNormal = "normal"
-	TypeScripDelete = "delete"
+	TypeScripNormal = "normal" // 正常发布 (在精选表中)
+	TypeScripDelete = "delete" // 用户删除
 )