Skip to content

Commit

Permalink
用户服务idl完善
Browse files Browse the repository at this point in the history
  • Loading branch information
8xmx8 committed Oct 25, 2023
1 parent ce104fa commit 25f710b
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/idl/user.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
syntax = "proto3";
package rpc.user;
option go_package = "./src/rpc/user";


message UserRequest {
int64 user_id = 1; // 用户id
int64 actor_id = 2; // 发送请求的用户的id
}

message UserResponse {
int32 status_code = 1; // 状态码,0-成功,其他值-失败
string status_msg = 2; // 返回状态描述
User user = 3; // 用户信息
}

message UserExistRequest {
int64 user_id = 1; // 用户id
}

message UserExistResponse {
int32 status_code = 1; // 状态码,0-成功,其他值-失败
string status_msg = 2; // 返回状态描述
bool existed = 3;
}

message User {
int64 id = 1; // 用户id
string name = 2; // 用户名称
optional uint32 follow_count = 3; // 关注总数
optional uint32 follower_count = 4; // 粉丝总数
bool is_follow = 5; // true-已关注,false-未关注
optional string avatar = 6; //用户头像
optional string background_image = 7; //用户个人页顶部大图
optional string signature = 8; //个人简介
optional uint32 total_favorited = 9; //获赞数量
optional uint32 work_count = 10; //作品数量
optional uint32 favorite_count = 11; //点赞数量
}

service UserService{
rpc GetUserInfo(UserRequest) returns(UserResponse);

rpc GetUserExistInformation(UserExistRequest) returns(UserExistResponse);
}

0 comments on commit 25f710b

Please sign in to comment.