| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459 |
- 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; // 登录类型
- string login_ip = 5; // 登录ip
- }
- message RegisterReq{
- string phone = 1; // 手机号码
- string nickname = 2; // 用户昵称
- string password = 3; // 密码
- string avatar = 4; // 头像
- int32 sex = 5; // 性别
- string username = 6; // 用户名(唯一)
- string code = 7; //验证码
- }
- message GetUserInfoReq {
- int64 user_id = 1; // 用户id
- int64 query_user_id = 2; // 查询用户id
- }
- message GetUserInfoResp {
- int64 id = 1; // 用户id
- string avatar = 2; // 用户头像
- string nickname = 3; // 昵称
- int32 sex = 4; // 性别0-女1-男
- bool is_follow = 5; // 是否关注
- }
- 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 {
- int64 user_id = 1;
- }
- message GetUserProfileRes {
- int64 id = 1; // 用户id
- string nickname = 2; // 用户昵称
- string username = 3; // 用户名
- int32 status = 4; // 用户状态0-正常1-封禁中2-禁言中3-删除
- string avatar = 5; // 头像
- string phone = 6; // 手机号
- int32 tweet_count = 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; //获得收藏的数量
- int32 sex = 14; //1-男2-女
- }
- // 模糊查询用户
- message SearchUsernameReq {
- string keyword = 1;
- int32 page = 2;
- int32 page_size = 3;
- int64 user_id = 4;
- }
- message SearchUsernameItem {
- string nickname = 1;
- string avatar = 2;
- int64 id = 3;
- int32 sex = 4;
- bool is_follow = 5;
- }
- message SearchUsernameRes {
- repeated SearchUsernameItem list = 1;
- int64 total = 2;
- }
- message CreateTag {
- string name = 1;
- int64 id = 2;
- }
- message CreatePostReq {
- int64 user_id = 1;
- string title = 2;
- string content = 3;
- repeated CreateTag tags = 4;
- repeated int64 at_user_ids = 5;
- int32 type = 6; //0-图文1-视频
- int32 visibility = 7; //可见性: 0私密 1好友可见 2关注可见 4公开
- repeated string images = 8;
- string video_cover = 9;
- string video_url = 10;
- string ip = 11;
- string ip_loc = 12;
- }
- message CreatePostRsp {
- int64 post_id = 1;
- }
- message GetTagListReq {
- int32 page = 1;
- int32 page_size = 2;
- string tag_name = 3;
- }
- message TagItem {
- string name = 1;
- int64 hot_num = 2;
- UserInfo user = 3;
- int64 id = 4;
- int64 created_on = 5;
- }
- message GetTagListRsp {
- repeated TagItem tag_list = 1;
- int32 total = 2;
- }
- message GetTagReq {
- int32 tag_id = 1;
- }
- message GetTagRsp {
- TagItem info = 1;
- }
- message GetPostListReq {
- int32 page = 1;
- int32 page_size = 2;
- int32 search_type = 3; // 0-默认搜索1-搜索内容/标题2-话题搜索
- int32 sort_type = 4; //0-默认创建时间排序1-热度排序
- int32 keyword = 5; // 搜索关键字,或者对应的id
- int64 user_id = 6; // 用户id
- }
- message GetPostListItem {
- int64 id = 1;
- UserInfo user = 2;
- string title = 3;
- string content_summary = 4;
- int32 post_type = 5; //帖子类型0-普通图文1-视频
- int64 comment_count = 6;
- int64 upvote_count = 7;
- int64 collection_count = 8;
- int64 share_count = 9;
- int32 visibillity = 10;
- string ip_loc = 11;
- int64 hot_num = 12;
- repeated string images = 13;
- string video_url = 14;
- string video_cover = 15;
- int64 created_on = 16;
- repeated TagItem tags = 17;
- }
- message GetPostListRsp {
- repeated GetPostListItem List = 1;
- int64 total = 2;
- }
- message GetPostReq {
- int64 user_id = 1;
- int64 post_id = 2;
- }
- message GetPostRsp {
- int64 id = 1;
- UserInfo user = 2;
- string title = 3;
- string content_summary = 4;
- int32 post_type = 5; //帖子类型0-普通图文1-视频
- int64 comment_count = 6;
- int64 upvote_count = 7;
- int64 collection_count = 8;
- int64 share_count = 9;
- int32 visibillity = 10;
- string ip_loc = 11;
- int64 hot_num = 12;
- repeated string images = 13;
- string video_url = 14;
- string video_cover = 15;
- string content = 16;
- int64 created_on = 17;
- repeated TagItem tags = 18;
- repeated UserInfo with_user = 19;
- int64 latest_replied_on = 20;
- }
- message PostUpvoteReq {
- int64 post_id = 1;
- int64 user_id = 2;
- }
- message PostUpvoteRsp {
- bool success = 1;
- }
- message PostCollectionReq {
- int64 post_id = 1;
- int64 user_id = 2;
- }
- message PostCollectionRsp {
- bool success = 1;
- }
- message PostShareReq {
- int64 post_id = 1;
- int64 user_id = 2;
- }
- message PostShareRsp {
- bool success = 1;
- }
- message PostCommentReq {
- int64 post_id = 1;
- int64 user_id = 2;
- string content = 3;
- string image = 4;
- int64 at_user_id = 5;
- string ip = 6;
- string ip_loc = 7;
- }
- message PostCommentRsp {
- int64 comment_id = 1;
- }
- message PostReplyReq {
- int64 post_id = 1;
- int64 user_id = 2;
- string content = 3;
- string image = 4;
- int64 at_user_id = 5;
- string ip = 6;
- string ip_loc = 7;
- }
- message PostReplyRsp {
- int64 reply_id = 1;
- }
- message GetPostCommentListReq {
- int32 page = 1;
- int32 page_size = 2;
- int64 post_id = 3;
- int64 user_id = 4;
- }
- message RepliesItem {
- int64 id = 1;
- int64 post_id = 2;
- UserInfo user = 3;
- string ip_loc = 4;
- string content = 5;
- string image = 6;
- repeated UserInfo with_user = 7;
- int64 upvote_count = 8;
- }
- message CommentItem {
- int64 id = 1;
- int64 post_id = 2;
- UserInfo user = 3;
- string ip_loc = 4;
- string content = 5;
- string image = 6;
- repeated UserInfo with_user = 7;
- int64 reply_count = 8;
- int64 upvote_count = 9;
- repeated RepliesItem reply_item = 10;
- }
- message GetPostCommentListRsp {
- repeated CommentItem list = 1;
- int64 total = 2;
- }
- message GetReplyListReq {
- int32 page = 1;
- int32 page_size = 2;
- int64 comment_id = 3;
- int64 user_id = 4;
- }
- message GetReplyListRsp {
- repeated RepliesItem list = 1;
- int64 total = 2;
- }
- message PostCommentUpvoteReq {
- int64 user_id = 1;
- int64 comment_id = 2;
- int32 comment_type = 3; // 0- 评论1-回复
- }
- message PostCommentUpvoteRsp {
- bool success = 1;
- }
- message PostCommentThumbsDownReq {
- int64 user_id = 1;
- int64 comment_id = 2;
- int32 comment_type = 3; // 0- 评论1-回复
- }
- message PostCommentThumbsDownRsp {
- bool success = 1;
- }
- message PostDeleteReq {
- int64 user_id = 1;
- int64 post_id = 2;
- }
- message PostDeleteRsp {
- bool success = 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);
- // 发布帖子
- rpc CreatePost (CreatePostReq) returns (CreatePostRsp);
- // 获取话题列表
- rpc GetTagList (GetTagListReq) returns (GetTagListRsp);
- // 获取话题详情
- rpc GetTag (GetTagReq) returns (GetTagRsp);
- // 获取帖子列表
- rpc GetPostList (GetPostListReq) returns (GetPostListRsp);
- // 获取帖子详情
- rpc GetPost (GetPostReq) returns (GetPostRsp);
- // 点赞帖子
- rpc PostUpvote (PostUpvoteReq) returns (PostUpvoteRsp);
- // 分享帖子
- rpc PostShare (PostShareReq) returns (PostShareRsp);
- // 收藏帖子
- rpc PostCollection (PostCollectionReq) returns (PostCollectionRsp);
- // 发布评论
- rpc PostComment (PostCommentReq) returns (PostCommentRsp);
- // 发布回复
- rpc PostReply (PostReplyReq) returns (PostReplyRsp);
- // 获取评论列表
- rpc GetPostCommentList (GetPostCommentListReq) returns (GetPostCommentListRsp);
- // 获取回复列表
- rpc GetReplyList (GetReplyListReq) returns (GetReplyListRsp);
- // 评论点赞
- rpc PostCommentUpvote (PostCommentUpvoteReq) returns (PostCommentUpvoteRsp);
- // 评论点踩
- rpc PostCommentThumbsDown (PostCommentThumbsDownReq) returns (PostCommentThumbsDownRsp);
- // 删除帖子
- rpc PostDelete (PostDeleteReq) returns (PostDeleteRsp);
- }
|