### 1. "登录方法" 1. route definition - Url: /api/user/login - Method: POST - Request: `LoginReq` - Response: `LoginAndRegisterRsp` 2. request definition ```golang type LoginReq struct { Phone string `json:"phone"` Password string `json:"password"` Code string `json:"code"` Login_type int32 `json:"login_type"` Login_ip string `json:"login_ip"` } ``` 3. response definition ```golang type LoginAndRegisterRsp struct { Token string `json:"token"` Expire int64 `json:"expire"` } ``` ### 2. "用户注册" 1. route definition - Url: /api/user/register - Method: POST - Request: `RegisterReq` - Response: `LoginAndRegisterRsp` 2. request definition ```golang type RegisterReq struct { Phone string `json:"phone"` Nickname string `json:"nickname"` Password string `json:"password"` Avatar string `json:"avatar"` Sex int32 `json:"sex"` Username string `json:"username"` Code string `json:"code"` } ``` 3. response definition ```golang type LoginAndRegisterRsp struct { Token string `json:"token"` Expire int64 `json:"expire"` } ``` ### 3. "获取粉丝" 1. route definition - Url: /api/user/fans - Method: GET - Request: `GetFollowingReq` - Response: `GetFollowingRes` 2. request definition ```golang type GetFollowingReq struct { User_id int64 `json:"user_id"` Page_size int32 `json:"page_size"` Page int32 `json:"page"` Query_user_id int64 `json:"query_user_id"` } ``` 3. response definition ```golang type GetFollowingRes struct { List []FollowUserInfo `json:"list"` Total int64 `json:"total"` } ``` ### 4. "查询用户" 1. route definition - Url: /api/user/find - Method: POST - Request: `FindUserReq` - Response: `FindUserResp` 2. request definition ```golang type FindUserReq struct { Username string `json:"username"` Phone string `json:"phone"` Ids []int64 `json:"ids"` } ``` 3. response definition ```golang type FindUserResp struct { User_list []UserInfo `json:"user_list"` } ``` ### 5. "关注用户" 1. route definition - Url: /api/user/follow - Method: POST - Request: `FollowUserReq` - Response: `FollowUserRes` 2. request definition ```golang type FollowUserReq struct { User_id int64 `json:"user_id"` Follow_user_id int64 `json:"follow_user_id"` } ``` 3. response definition ```golang type FollowUserRes struct { Success bool `json:"success"` } ``` ### 6. "获取关注列表" 1. route definition - Url: /api/user/follows - Method: GET - Request: `GetFollowReq` - Response: `GetFollowRes` 2. request definition ```golang type GetFollowReq struct { User_id int64 `json:"user_id"` Page_size int32 `json:"page_size"` Page int32 `json:"page"` Query_user_id int64 `json:"query_user_id"` } ``` 3. response definition ```golang type GetFollowRes struct { List []FollowUserInfo `json:"list"` Total int64 `json:"total"` } ``` ### 7. "获取用户信息" 1. route definition - Url: /api/user/info - Method: GET - Request: `GetUserInfoReq` - Response: `GetUserInfoResp` 2. request definition ```golang type GetUserInfoReq struct { User_id int64 `json:"user_id"` Query_user_id int64 `json:"query_user_id"` } ``` 3. response definition ```golang type GetUserInfoResp struct { Id int64 `json:"id"` Avatar string `json:"avatar"` Nickname string `json:"nickname"` Sex int32 `json:"sex"` Is_follow bool `json:"is_follow"` } ``` ### 8. "获取用户信息" 1. route definition - Url: /api/user/profile - Method: GET - Request: `GetUserProfileReq` - Response: `GetUserProfileRes` 2. request definition ```golang type GetUserProfileReq struct { User_id int64 `json:"user_id"` } ``` 3. response definition ```golang type GetUserProfileRes struct { Id int64 `json:"id"` Nickname string `json:"nickname"` Username string `json:"username"` Status int32 `json:"status"` Avatar string `json:"avatar"` Phone string `json:"phone"` Tweet_count int32 `json:"tweet_count"` Is_following bool `json:"is_following"` Created_on int64 `json:"created_on"` Follows int64 `json:"follows"` Fans int64 `json:"fans"` Get_likes_count int32 `json:"get_likes_count"` Get_collection_count int32 `json:"get_collection_count"` Sex int32 `json:"sex"` } ``` ### 9. "搜索用户" 1. route definition - Url: /api/user/search - Method: GET - Request: `SearchUsernameReq` - Response: `SearchUsernameRes` 2. request definition ```golang type SearchUsernameReq struct { Keyword string `json:"keyword"` Page int32 `json:"page"` Page_size int32 `json:"page_size"` User_id int64 `json:"user_id"` } ``` 3. response definition ```golang type SearchUsernameRes struct { List []SearchUsernameItem `json:"list"` Total int64 `json:"total"` } ``` ### 10. "取消关注用户" 1. route definition - Url: /api/user/unfollow - Method: POST - Request: `UnFollowUserReq` - Response: `UnFollowUserRes` 2. request definition ```golang type UnFollowUserReq struct { User_id int64 `json:"user_id"` Un_follow_user_id int64 `json:"un_follow_user_id"` } ``` 3. response definition ```golang type UnFollowUserRes struct { Success bool `json:"success"` } ``` ### 11. "评论删除" 1. route definition - Url: /api/comment/delete - Method: POST - Request: `CommentDeleteReq` - Response: `CommentDeleteRsp` 2. request definition ```golang type CommentDeleteReq struct { User_id int64 `json:"user_id"` Comment_id int64 `json:"comment_id"` Comment_type int32 `json:"comment_type"` } ``` 3. response definition ```golang type CommentDeleteRsp struct { Success bool `json:"success"` } ``` ### 12. "帖子收藏" 1. route definition - Url: /api/post/collection - Method: POST - Request: `PostCollectionReq` - Response: `PostCollectionRsp` 2. request definition ```golang type PostCollectionReq struct { Post_id int64 `json:"post_id"` User_id int64 `json:"user_id"` } ``` 3. response definition ```golang type PostCollectionRsp struct { Success bool `json:"success"` } ``` ### 13. "发布评论" 1. route definition - Url: /api/post/comment - Method: POST - Request: `PostCommentReq` - Response: `PostCommentRsp` 2. request definition ```golang type PostCommentReq struct { Post_id int64 `json:"post_id"` User_id int64 `json:"user_id"` Content string `json:"content"` Image string `json:"image"` At_user_id int64 `json:"at_user_id"` Ip string `json:"ip"` Ip_loc string `json:"ip_loc"` } ``` 3. response definition ```golang type PostCommentRsp struct { Comment_id int64 `json:"comment_id"` } ``` ### 14. "评论点赞" 1. route definition - Url: /api/post/comment/upvote - Method: POST - Request: `PostCommentUpvoteReq` - Response: `PostCommentUpvoteRsp` 2. request definition ```golang type PostCommentUpvoteReq struct { User_id int64 `json:"user_id"` Comment_id int64 `json:"comment_id"` Comment_type int32 `json:"comment_type"` } ``` 3. response definition ```golang type PostCommentUpvoteRsp struct { Success bool `json:"success"` } ``` ### 15. "创建帖子" 1. route definition - Url: /api/post/create - Method: POST - Request: `CreatePostReq` - Response: `CreatePostRsp` 2. request definition ```golang type CreatePostReq struct { User_id int64 `json:"user_id"` Title string `json:"title"` Content string `json:"content"` Tags []CreateTag `json:"tags"` At_user_ids []int64 `json:"at_user_ids"` Post_type int32 `json:"post_type"` Visibility int32 `json:"visibility"` Images []string `json:"images"` Video_cover string `json:"video_cover"` Video_url string `json:"video_url"` Ip string `json:"ip"` Ip_loc string `json:"ip_loc"` } ``` 3. response definition ```golang type CreatePostRsp struct { Post_id int64 `json:"post_id"` } ``` ### 16. "帖子删除" 1. route definition - Url: /api/post/delete - Method: POST - Request: `PostDeleteReq` - Response: `PostDeleteRsp` 2. request definition ```golang type PostDeleteReq struct { User_id int64 `json:"user_id"` Post_id int64 `json:"post_id"` } ``` 3. response definition ```golang type PostDeleteRsp struct { Success bool `json:"success"` } ``` ### 17. "回复评论" 1. route definition - Url: /api/post/reply - Method: POST - Request: `PostReplyReq` - Response: `PostReplyRsp` 2. request definition ```golang type PostReplyReq struct { Post_id int64 `json:"post_id"` User_id int64 `json:"user_id"` Content string `json:"content"` Image string `json:"image"` At_user_id int64 `json:"at_user_id"` Ip string `json:"ip"` Ip_loc string `json:"ip_loc"` Comment_id int64 `json:"comment_id"` To_reply_id int64 `json:"to_reply_id"` } ``` 3. response definition ```golang type PostReplyRsp struct { Reply_id int64 `json:"reply_id"` } ``` ### 18. "帖子分享" 1. route definition - Url: /api/post/share - Method: POST - Request: `PostShareReq` - Response: `PostShareRsp` 2. request definition ```golang type PostShareReq struct { Post_id int64 `json:"post_id"` User_id int64 `json:"user_id"` } ``` 3. response definition ```golang type PostShareRsp struct { Success bool `json:"success"` } ``` ### 19. "帖子点赞" 1. route definition - Url: /api/post/upvote - Method: POST - Request: `PostUpvoteReq` - Response: `PostUpvoteRsp` 2. request definition ```golang type PostUpvoteReq struct { Post_id int64 `json:"post_id"` User_id int64 `json:"user_id"` } ``` 3. response definition ```golang type PostUpvoteRsp struct { Success bool `json:"success"` } ``` ### 20. "获取帖子详情" 1. route definition - Url: /api/post - Method: GET - Request: `GetPostReq` - Response: `GetPostRsp` 2. request definition ```golang type GetPostReq struct { User_id int64 `json:"user_id"` Post_id int64 `json:"post_id"` } ``` 3. response definition ```golang type GetPostRsp struct { Id int64 `json:"id"` User UserInfo `json:"user"` Title string `json:"title"` Content_summary string `json:"content_summary"` Post_type int32 `json:"post_type"` Comment_count int64 `json:"comment_count"` Upvote_count int64 `json:"upvote_count"` Collection_count int64 `json:"collection_count"` Share_count int64 `json:"share_count"` Visibility int32 `json:"visibility"` Ip_loc string `json:"ip_loc"` Hot_num int64 `json:"hot_num"` Images []string `json:"images"` Video_url string `json:"video_url"` Video_cover string `json:"video_cover"` Content string `json:"content"` Created_on int64 `json:"created_on"` Tags []TagItem `json:"tags"` With_user []UserInfo `json:"with_user"` Latest_replied_on int64 `json:"latest_replied_on"` Is_liked bool `json:"is_liked"` Is_collected bool `json:"is_collected"` Is_mine bool `json:"is_mine"` } type UserInfo struct { Id int64 `json:"id"` Avatar string `json:"avatar"` Nickname string `json:"nickname"` Sex int32 `json:"sex"` } ``` ### 21. "获取评论列表" 1. route definition - Url: /api/post/comment/list - Method: GET - Request: `GetPostCommentListReq` - Response: `GetPostCommentListRsp` 2. request definition ```golang type GetPostCommentListReq struct { Page int32 `json:"page"` Page_size int32 `json:"page_size"` Post_id int64 `json:"post_id"` User_id int64 `json:"user_id"` } ``` 3. response definition ```golang type GetPostCommentListRsp struct { List []CommentItem `json:"list"` Total int64 `json:"total"` } ``` ### 22. "获取帖子列表" 1. route definition - Url: /api/post/list - Method: GET - Request: `GetPostListReq` - Response: `GetPostListRsp` 2. request definition ```golang type GetPostListReq struct { Page int32 `json:"page"` Page_size int32 `json:"page_size"` Search_type int32 `json:"search_type"` Sort_type int32 `json:"sort_type"` Keyword string `json:"keyword"` User_id int64 `json:"user_id"` } ``` 3. response definition ```golang type GetPostListRsp struct { List []GetPostListItem `json:"list"` Total int64 `json:"total"` } ``` ### 23. "获取回复列表" 1. route definition - Url: /api/post/reply/list - Method: GET - Request: `GetReplyListReq` - Response: `GetReplyListRsp` 2. request definition ```golang type GetReplyListReq struct { Page int32 `json:"page"` Page_size int32 `json:"page_size"` Comment_id int64 `json:"comment_id"` User_id int64 `json:"user_id"` } ``` 3. response definition ```golang type GetReplyListRsp struct { List []RepliesItem `json:"list"` Total int64 `json:"total"` } ``` ### 24. "获取话题详情" 1. route definition - Url: /api/tag - Method: GET - Request: `GetTagReq` - Response: `GetTagRsp` 2. request definition ```golang type GetTagReq struct { Tag_id int64 `json:"tag_id"` User_id int64 `json:"user_id"` } ``` 3. response definition ```golang type GetTagRsp struct { Name string `json:"name"` Hot_num int64 `json:"hot_num"` User UserInfo `json:"user"` Id int64 `json:"id"` Created_on int64 `json:"created_on"` Post_count int64 `json:"post_count"` Follow_count int64 `json:"follow_count"` Is_followed bool `json:"is_followed"` } type UserInfo struct { Id int64 `json:"id"` Avatar string `json:"avatar"` Nickname string `json:"nickname"` Sex int32 `json:"sex"` } ``` ### 25. "获取话题列表" 1. route definition - Url: /api/tag/list - Method: GET - Request: `GetTagListReq` - Response: `GetTagListRsp` 2. request definition ```golang type GetTagListReq struct { Page int32 `json:"page"` Page_size int32 `json:"page_size"` Tag_name string `json:"tag_name"` Sort_by int32 `json:"sort_by"` } ``` 3. response definition ```golang type GetTagListRsp struct { Tag_list []TagItem `json:"tag_list"` Total int32 `json:"total"` } ``` ### 26. "获取用户收藏的帖子列表" 1. route definition - Url: /api/user/post/collection/list - Method: GET - Request: `GetUserPostCollectionListReq` - Response: `GetUserPostCollectionListRsp` 2. request definition ```golang type GetUserPostCollectionListReq struct { User_id int64 `json:"user_id"` Page int64 `json:"page"` Page_size int64 `json:"page_size"` Query_user_id int64 `json:"query_user_id"` } ``` 3. response definition ```golang type GetUserPostCollectionListRsp struct { List []GetPostListItem `json:"list"` Total int64 `json:"total"` } ``` ### 27. "获取用户点赞的帖子列表" 1. route definition - Url: /api/user/post/like/list - Method: GET - Request: `GetUserPostLikeListReq` - Response: `GetUserPostLikeListRsp` 2. request definition ```golang type GetUserPostLikeListReq struct { User_id int64 `json:"user_id"` Page int64 `json:"page"` Page_size int64 `json:"page_size"` Query_user_id int64 `json:"query_user_id"` } ``` 3. response definition ```golang type GetUserPostLikeListRsp struct { List []GetPostListItem `json:"list"` Total int64 `json:"total"` } ``` ### 28. "获取用户发布的帖子列表" 1. route definition - Url: /api/user/post/list - Method: GET - Request: `GetUserPostListReq` - Response: `GetUserPostListRsp` 2. request definition ```golang type GetUserPostListReq struct { User_id int64 `json:"user_id"` Page int64 `json:"page"` Page_size int64 `json:"page_size"` Query_user_id int64 `json:"query_user_id"` } ``` 3. response definition ```golang type GetUserPostListRsp struct { List []GetPostListItem `json:"list"` Total int64 `json:"total"` } ```