From 6a0ba0e63fa4ce37cf7fbb20108b638a95eb07a3 Mon Sep 17 00:00:00 2001 From: OrionLi Date: Mon, 28 Aug 2023 01:32:36 +0800 Subject: [PATCH] =?UTF-8?q?uint64=E5=85=A8=E9=83=A8=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E4=BD=BF=E7=94=A8int64?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/pb/relation.pb.go | 55 +++++++++++++++++++++++----------------- pkg/proto/relation.proto | 42 ++++++++++++++++++------------ 2 files changed, 58 insertions(+), 39 deletions(-) diff --git a/pkg/pb/relation.pb.go b/pkg/pb/relation.pb.go index 799746b..72aef92 100644 --- a/pkg/pb/relation.pb.go +++ b/pkg/pb/relation.pb.go @@ -20,14 +20,15 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// 关系操作请求 type RelationActionRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` - ToUserId uint64 `protobuf:"varint,2,opt,name=to_user_id,json=toUserId,proto3" json:"to_user_id,omitempty"` - ActionType int32 `protobuf:"varint,3,opt,name=action_type,json=actionType,proto3" json:"action_type,omitempty"` + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // 用户鉴权token + ToUserId int64 `protobuf:"varint,2,opt,name=to_user_id,json=toUserId,proto3" json:"to_user_id,omitempty"` // 对方用户id + ActionType int32 `protobuf:"varint,3,opt,name=action_type,json=actionType,proto3" json:"action_type,omitempty"` // 1-关注,2-取消关注 } func (x *RelationActionRequest) Reset() { @@ -69,7 +70,7 @@ func (x *RelationActionRequest) GetToken() string { return "" } -func (x *RelationActionRequest) GetToUserId() uint64 { +func (x *RelationActionRequest) GetToUserId() int64 { if x != nil { return x.ToUserId } @@ -83,6 +84,7 @@ func (x *RelationActionRequest) GetActionType() int32 { return 0 } +// 关系操作响应 type RelationActionResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -138,13 +140,14 @@ func (x *RelationActionResponse) GetStatusMsg() string { return "" } +// 获取关注列表请求 type GetFollowListRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserId uint64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // 用户id + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` // 用户鉴权token } func (x *GetFollowListRequest) Reset() { @@ -179,7 +182,7 @@ func (*GetFollowListRequest) Descriptor() ([]byte, []int) { return file_relation_proto_rawDescGZIP(), []int{2} } -func (x *GetFollowListRequest) GetUserId() uint64 { +func (x *GetFollowListRequest) GetUserId() int64 { if x != nil { return x.UserId } @@ -193,6 +196,7 @@ func (x *GetFollowListRequest) GetToken() string { return "" } +// 获取关注列表响应 type GetFollowListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -200,7 +204,7 @@ type GetFollowListResponse struct { StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` StatusMsg string `protobuf:"bytes,2,opt,name=status_msg,json=statusMsg,proto3" json:"status_msg,omitempty"` - UserList []*User `protobuf:"bytes,3,rep,name=user_list,json=userList,proto3" json:"user_list,omitempty"` + UserList []*User `protobuf:"bytes,3,rep,name=user_list,json=userList,proto3" json:"user_list,omitempty"` // 用户列表 } func (x *GetFollowListResponse) Reset() { @@ -256,13 +260,14 @@ func (x *GetFollowListResponse) GetUserList() []*User { return nil } +// 获取粉丝列表请求 type GetFollowerListRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserId uint64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // 用户id + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` // 用户鉴权token } func (x *GetFollowerListRequest) Reset() { @@ -297,7 +302,7 @@ func (*GetFollowerListRequest) Descriptor() ([]byte, []int) { return file_relation_proto_rawDescGZIP(), []int{4} } -func (x *GetFollowerListRequest) GetUserId() uint64 { +func (x *GetFollowerListRequest) GetUserId() int64 { if x != nil { return x.UserId } @@ -311,6 +316,7 @@ func (x *GetFollowerListRequest) GetToken() string { return "" } +// 获取粉丝列表响应 type GetFollowerListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -318,7 +324,7 @@ type GetFollowerListResponse struct { StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` StatusMsg string `protobuf:"bytes,2,opt,name=status_msg,json=statusMsg,proto3" json:"status_msg,omitempty"` - UserList []*User `protobuf:"bytes,3,rep,name=user_list,json=userList,proto3" json:"user_list,omitempty"` + UserList []*User `protobuf:"bytes,3,rep,name=user_list,json=userList,proto3" json:"user_list,omitempty"` // 用户列表 } func (x *GetFollowerListResponse) Reset() { @@ -374,13 +380,14 @@ func (x *GetFollowerListResponse) GetUserList() []*User { return nil } +// 获取好友列表请求 type GetFriendListRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserId uint64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // 用户id + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` // 用户鉴权token } func (x *GetFriendListRequest) Reset() { @@ -415,7 +422,7 @@ func (*GetFriendListRequest) Descriptor() ([]byte, []int) { return file_relation_proto_rawDescGZIP(), []int{6} } -func (x *GetFriendListRequest) GetUserId() uint64 { +func (x *GetFriendListRequest) GetUserId() int64 { if x != nil { return x.UserId } @@ -429,6 +436,7 @@ func (x *GetFriendListRequest) GetToken() string { return "" } +// 获取好友列表响应 type GetFriendListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -436,7 +444,7 @@ type GetFriendListResponse struct { StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` StatusMsg string `protobuf:"bytes,2,opt,name=status_msg,json=statusMsg,proto3" json:"status_msg,omitempty"` - UserList []*FriendUser `protobuf:"bytes,3,rep,name=user_list,json=userList,proto3" json:"user_list,omitempty"` + UserList []*FriendUser `protobuf:"bytes,3,rep,name=user_list,json=userList,proto3" json:"user_list,omitempty"` // 好友用户列表 } func (x *GetFriendListResponse) Reset() { @@ -492,14 +500,15 @@ func (x *GetFriendListResponse) GetUserList() []*FriendUser { return nil } +// 好友用户信息 type FriendUser struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - MsgType int32 `protobuf:"varint,3,opt,name=msg_type,json=msgType,proto3" json:"msg_type,omitempty"` + User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // 用户信息 + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // 最新聊天消息 + MsgType int32 `protobuf:"varint,3,opt,name=msg_type,json=msgType,proto3" json:"msg_type,omitempty"` // 消息类型,0=接收的消息,1=发送的消息 } func (x *FriendUser) Reset() { @@ -563,7 +572,7 @@ var file_relation_proto_rawDesc = []byte{ 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1c, 0x0a, 0x0a, 0x74, - 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x58, 0x0a, 0x16, 0x52, 0x65, @@ -574,7 +583,7 @@ var file_relation_proto_rawDesc = []byte{ 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x73, 0x67, 0x22, 0x45, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, - 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x75, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x7b, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, @@ -587,7 +596,7 @@ var file_relation_proto_rawDesc = []byte{ 0x75, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x47, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x7d, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, @@ -599,7 +608,7 @@ var file_relation_proto_rawDesc = []byte{ 0x05, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x45, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x81, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, diff --git a/pkg/proto/relation.proto b/pkg/proto/relation.proto index 8c8dae4..ddad1ba 100644 --- a/pkg/proto/relation.proto +++ b/pkg/proto/relation.proto @@ -9,52 +9,62 @@ service RelationService { rpc GetFriendList (GetFriendListRequest) returns (GetFriendListResponse) {} } +// 关系操作请求 message RelationActionRequest { - string token = 1; - uint64 to_user_id = 2; - int32 action_type = 3; + string token = 1; // 用户鉴权token + int64 to_user_id = 2; // 对方用户id + int32 action_type = 3; // 1-关注,2-取消关注 } +// 关系操作响应 message RelationActionResponse { int32 status_code = 1; string status_msg = 2; } +// 获取关注列表请求 message GetFollowListRequest { - uint64 user_id = 1; - string token = 2; + int64 user_id = 1; // 用户id + string token = 2; // 用户鉴权token } +// 获取关注列表响应 message GetFollowListResponse { int32 status_code = 1; string status_msg = 2; - repeated User user_list = 3; + repeated User user_list = 3; // 用户列表 } +// 获取粉丝列表请求 message GetFollowerListRequest { - uint64 user_id = 1; - string token = 2; + int64 user_id = 1; // 用户id + string token = 2; // 用户鉴权token } +// 获取粉丝列表响应 message GetFollowerListResponse { int32 status_code = 1; string status_msg = 2; - repeated User user_list = 3; + repeated User user_list = 3; // 用户列表 } +// 获取好友列表请求 message GetFriendListRequest { - uint64 user_id = 1; - string token = 2; + int64 user_id = 1; // 用户id + string token = 2; // 用户鉴权token } +// 获取好友列表响应 message GetFriendListResponse { int32 status_code = 1; string status_msg = 2; - repeated FriendUser user_list = 3; + repeated FriendUser user_list = 3; // 好友用户列表 } +// 好友用户信息 message FriendUser { - User user = 1; - string message = 2; - int32 msg_type = 3; -} \ No newline at end of file + User user = 1; // 用户信息 + string message = 2; // 最新聊天消息 + int32 msg_type = 3; // 消息类型,0=接收的消息,1=发送的消息 +} +