syntax="proto3"; package slowwildserver; option go_package="slowwild/slowwildserver"; message UserEntity { int64 id = 1; // 用户id string avatar = 2; // 用户头像 string nickname = 3; // 昵称 string username = 4; // 用户名(唯一) string phone = 5; // 手机号码 int32 status = 6; // 是否锁住1-正常2-停用 int32 sex = 7; // 性别0-女1-男 int64 follows = 8; //粉丝 int64 followings = 9; // 关注量 int32 get_likes_count = 10; //获得点赞数量 int32 get_collection_count = 11; //获得收藏的数量 } message UserInfo { int64 id = 1; // 用户id string avatar = 2; // 用户头像 string nickname = 3; // 昵称 int32 sex = 7; // 性别0-女1-男 } message FollowUserInfo { UserInfo user = 1; bool is_mutual_follow = 2; // 是否互相关注 } message LoginAndRegisterRsp { string token = 1; // token令牌 int64 expire = 2; // 到期时间 } message LoginReq { string phone = 1; //手机号 string password = 2; // 密码 string code = 3; //验证码 int32 login_type = 4; // 登录类型 } message RegisterReq{ string phone = 1; // 手机号码 string nickname = 2; // 用户昵称 string password = 3; // 密码 string avatar = 4; // 头像 int32 sex = 5; // 性别 string username = 6; // 用户名(唯一) } message GetUserInfoReq { int64 id = 1; // 用户id } message GetUserInfoResp { UserEntity user = 1; // 用户信息 } message FindUserReq { string username = 1; // 用户昵称 string phone = 2; // 用户手机号码 repeated int64 ids = 3; // 用户id } message FindUserResp { repeated UserInfo user_list = 1; // 用户信息 } // 用户关注 message FollowUserReq { int64 user_id = 1; // 当前登录用户id int64 follow_user_id = 2; // 被关注的用户id } message FollowUserRes { bool success = 1; // 是否关注成功 } // 用户取消关注 message UnFollowUserReq { int64 user_id = 1; // 当前登录的用户id int64 un_follow_user_id = 2; // 当前被取消关注的用户id } message UnFollowUserRes { bool success = 1; // 是否关注成功 } // 查询粉丝列表 message GetFollowingReq { int64 user_id = 1; // 当前登录用户的id int32 page_size = 2; // 数量限制 int32 page = 3; // 分页开始偏移量 int64 query_user_id = 4; // 查询用户的id } message GetFollowingRes { repeated FollowUserInfo list = 1; int64 total = 2; } // 查询我关注的列表 message GetFollowReq { int64 user_id = 1; // 当前登录用户的id int32 page_size = 2; // 数量限制 int32 page = 3; // 分页开始偏移量 int64 query_user_id = 4; // 查询用户的id } message GetFollowRes { repeated FollowUserInfo list = 1; int64 total = 2; } //查询用户信息 message GetUserProfileReq { string username = 1; int64 user_id = 2; } message GetUserProfileRes { int64 id = 1; // 用户id string nickname = 2; // 用户昵称 string username = 3; // 用户名 int32 status = 4; // 用户状态0-正常1-封禁中2-禁言中3-删除 string avatar = 5; // 头像 bool is_friend = 7; // 是否是好友 bool is_following = 8; // 是否关注 int64 created_on = 9; // 注册时间 int64 follows = 10; // 关注数 int64 fans = 11; // 粉丝数 int32 get_likes_count = 12; //获得点赞数量 int32 get_collection_count = 13; //获得收藏的数量 } // 模糊查询用户 message SearchUsernameReq { string username = 1; } message SearchUsernameItem { string username = 1; string avatar = 2; int64 id = 3; } message SearchUsernameRes { repeated SearchUsernameItem list = 1; } service SlowWildServer { // 用户登录 rpc Login(LoginReq) returns (LoginAndRegisterRsp); // 用户注册 rpc Register(RegisterReq) returns (LoginAndRegisterRsp); // 获取用户信息 rpc GetUserInfo(GetUserInfoReq) returns (GetUserInfoResp); // 查询用户信息 rpc FindUser(FindUserReq) returns (FindUserResp); // 关注用户 rpc UserFollow (FollowUserReq) returns (FollowUserRes); // 取消关注用户 rpc UnUserFollow (UnFollowUserReq) returns (UnFollowUserRes); // 获取我得粉丝 rpc GetFans (GetFollowingReq) returns (GetFollowingRes); // 查询我的关注 rpc GetFollows (GetFollowingReq) returns (GetFollowingRes); // 查询用户的详细信息 rpc GetUserProfile (GetUserProfileReq) returns (GetUserProfileRes); // 搜索用户名称 rpc SearchUsername (SearchUsernameReq) returns (SearchUsernameRes); }