Commit c52bfa36 by 段启岩

合并接口文档

parent df82cb34
### 博客接口
#### 1.发布博客
请求路径:/api/blog
请求方式:POST
请求格式:JSON
请求参数:
blogTitle:标题
blogContent:内容
blogAbstract:摘要(自动或手动)
originLink:网络链接
tagIds:[博客引用的标签]
attribute:属性(是否置顶)
type:文章类型
viewPrivileges:浏览权限
allowComment:评论权限
allowForward:转载权限
topicIds: []
返回结果:success
#### 2.删除博客
请求路径:/api/blog/{blogId}
请求方式:DELETE
返回结果:success
请求示例:DELETE /api/blog/fe66853d28b36a9e0ec17cf9221bd5da
#### 3.发布评论
请求路径:/api/blog/{blogId}/comment
请求方式:POST
请求格式:JSON
请求参数:
parentId:上层ID
content:内容
返回结果:success
#### 4.删除评论
请求路径:/api/blog/{blogId}/comment/{commentId}
请求方式:DELETE
请求格式:JSON
请求示例:DELETE /api/blog/comment/fe66853d28b36a9e0ec17cf9221bd5da
返回结果:success
#### 5.评论排序(-)
#### 6.话题引用(-)
请求路径:/api/blog/reference
请求方式:POST
请求格式:JSON
请求参数:
token:token
topicId:引用话题ID
referencerType:引用类型
返回结果:success
#### 8.博客列表
请求路径:/api/blogs
请求方式:GET
请求格式:分页参数,排序参数
请求参数:
pageNo:页数
返回结果:
bloglist:博客内容列表
{
code: 0,
msg: '操作成功',
data: {
total: 20,
dataList: [
...,
...
]
}
}
#### 9.热门博客
请求路径:/api/blog/hots
请求方式:GET
请求格式:分页参数,排序参数
请求参数:
pageNo:页数
返回结果:
bloglist:博客内容列表
{
code: 0,
msg: '操作成功',
data: {
total: 20,
dataList: [
...,
...
]
}
}
#### 10.博客详情(-)
请求路径:/api/blog/{blogId}
请求方式:GET
请求格式:JSON
返回结果:
blogId:博客ID
userID:发布者ID
userNick:发布者昵称
userAvatar:发布者头像
blogTitle:标题
blogContent:内容
blogAbstract:摘要(自动或手动)
originLink:网络链接
tag:标签
#### 11.个人博客展示
请求路径:/api/user/{userId}/blogs
请求方式:GET
请求格式:JSON
返回结果:
blogId:动态ID
userNick:发布者昵称
userAvatar:发布者头像
blogTitle:标题
blogContent:内容
blogAbstract:摘要(自动或手动)
originLink:网络链接
tag:标签
#### 12.评论展示
请求路径:/api/blog/{blogId}/comments
请求方式:GET
请求格式:JSON
返回结果:
commentId:评论ID
commentContent:评论内容
commentDepth:评论深度
commenterID:评论者ID
commenterAvatar:评论者头像
commenterNick:评论者昵称
\ No newline at end of file
### 资讯接口
##### 1.发布资讯
```
请求路径:/api/news
请求方式:POST
请求格式:JSON
请求参数:
newsTitle:资讯标题
content:资讯内容
newsCover:资讯封面
返回结果:default
```
##### 2.修改资讯
```
请求路径:/api/news/{newsId}
请求方式:PUT
请求格式:JSON
请求参数:
newsTitle:资讯标题
content:资讯内容
newsCover:资讯封面
返回结果:default
```
##### 3.按分类展示资讯
```
请求路径:/api/news
请求方式:GET
请求格式:JSON
请求参数:
classify:资讯分类
请求结果:
List{
newsTitle:资讯标题
content:一部分内容
newsCover:资讯封面
}
```
##### 4.删除资讯
```
请求路径:/api/news/{newsId}
请求方式:DELETE
请求格式:JSON
请求参数:
返回结果:default
```
\ No newline at end of file
###动态接口
#### 1.发布动态
请求路径:/api/post
请求方式:POST
请求格式:JSON
请求参数:
content:发布内容
address:地址
browseRight:浏览权限(公/私)
返回结果:success
#### 2.关注用户(-)
请求路径:/api/post/follow
请求方式:POST
请求格式:JSON
请求参数:
token:关注者token
followedId:被关注者ID
返回结果:success
#### 3.评论
请求路径:/api/post/{postId}/comment
请求方式:POST
请求格式:JSON
请求参数:
postId:动态ID
parentId:上层ID
content:内容
返回结果:success
#### 4.删除评论
请求路径:/api/post/comment/{commentId}
请求方式:DELETE
请求参数:
返回结果:success
#### 5.动态展示
请求路径:/api/posts
请求方式:GET
请求格式:JSON
请求参数:
返回结果:
postId:动态ID
userID:发布者ID
userNick:发布者昵称
userAvatar:发布者头像
content:动态内容
pictures:图片
#### 6.个人动态展示
请求路径:/api/user/{userId}/posts
请求方式:GET
请求格式:JSON
请求参数:
返回结果:
postId:动态ID
userNick:发布者昵称
userAvatar:发布者头像
content:动态内容
pictures:图片
#### 7.删除动态
请求路径:/api/post/{postId}
请求方式:DELETE
请求格式:JSON
请求参数:
返回结果:success
#### 8.话题引用(-)
请求路径:/api/post/reference
请求方式:POST
请求格式:JSON
请求参数:
token:token
topicId:引用话题ID
referencerType:引用类型
返回结果:success
#### 9.评论展示
请求路径:/api/post/{postId}/comments
请求方式:GET
请求格式:JSON
请求参数:
返回结果:
commentId:评论ID
commentContent:评论内容
commentDepth:评论深度
commenterID:评论者ID
commenterAvatar:评论者头像
commenterNick:评论者昵称
\ No newline at end of file
### 项目接口
##### 1.发布项目
```
请求路径:/api/project
请求方式:POST
请求格式:JSON
请求参数:
projectName:项目名称
projectLink:项目链接
projectHome:项目官网链接
projectDoc: 项目文档链接
projectType: 项目类型
lincense: 授权协议
devLong: 开发语言
runtimePlatform: 操作系统
author: 作者
projectDescription: 项目介绍
projectCover: 项目封面
返回结果:default
```
##### 2.项目详情
```
请求路径:/api/project/{projectId}
请求方式:GET
请求格式:JSON
请求参数:
返回结果:
projectName:项目名称
projectId: 项目id
projectDetail: 项目具体信息
projectType: 项目类型
lincense: 授权协议
devLong: 开发语言
runtimePlatform: 操作系统
author: 作者
projectDescription: 项目介绍
projectCover: 项目封面
commentId: 评论id
comment: 评论内容
```
##### 3.修改项目资料
```
请求路径:/api/project/{projectId}
请求方式:PUT
请求格式:JSON
请求参数:
projectName:项目名称
projectLink:项目链接
projectHome:项目官网链接
projectDoc: 项目文档链接
projectType: 项目类型
lincense: 授权协议
devLong: 开发语言
runtimePlatform: 操作系统
author: 作者
projectDescription: 项目介绍
projectCover: 项目封面
返回结果:default
```
##### 4.个人项目列表
```
请求路径:/api/user/{userId}/projects
请求方式:GET
请求格式:JSON
返回结果:List<project>
```
##### 5.项目列表
```
请求路径:/api/projects
请求方式:GET
请求格式:JSON
请求参数:userId
返回结果:List<project>
```
##### 6.提交评论
```
请求路径:/api/project/{projectId}/comment
请求方式:POST
请求格式:JSON
请求参数:
content: 评论内容
commentId: 上一级评论的id
返回结果:default
```
##### 7.删除评论
```
请求路径:/api/project/comment/{commentId}
请求方式:DELETE
请求格式:JSON
请求参数:
返回结果:default
```
### 问答接口
##### 1.发布问题
```
请求路径:/api/question
请求方式:POST
请求格式:JSON
请求参数:
questionTitle:问题标题
questionDetail:问题详细信息
tagName:标签(最多五个)
tagType:标签类型
questionClassify:问题分类
questionStatus:问题状态(0:草稿,1:发布)
返回结果:default
```
##### 2.回复问题
```
请求路径:/api/question/{questionId}/reply
请求方式:POST
请求格式:JSON
请求参数:
questionId:问题ID
content:回复内容
replyStatus:回复状态(0:未采纳,1:采纳)
parentId:父回复ID
返回结果:default
```
##### 3.获取用户的所有提问
```
请求路径:/api/user/{userId}/questions
请求方式:GET
请求格式:JSON
请求参数:
返回结果:
List<question>{
questionTitle:问题标题
content:一部分内容
tag:问题标签
updateTime:问题更新时间
}
```
##### 4.获取用户的所有回答
```
请求路径:/api/user/{userId}/replies
请求方式:GET
请求格式:JSON
请求参数:
返回结果:
List:上述对象的集合
List{
question{
questionTitle:问题标题
}
reply{
content:该用户的回复内容
updateTime:回复更新时间
}
}
```
##### 5.问题详情展示
```
请求路径:/api/question/{questionId}
请求方式:GET
请求格式:JSON
请求参数:
返回结果:
question{
questionTitle:问题标题
content:问题内容
tag:标签
}
List<reply>{
User{
userAvatar:用户头像
nickName:用户昵称
}
content:回复内容
updateTime:回复更新时间
}
```
##### 6.回复列表
```
请求路径:/api/question/{questionId}/replies
请求方式:GET
请求格式:JSON
请求参数:
questionId:问题ID
返回结果:
List<reply>{
User{
userAvatar:用户头像
nickName:用户昵称
}
content:回复内容
updateTime:回复更新时间
}
```
##### 7.根据分类得到提问
```
请求路径:/api/questions
请求方式:GET
请求格式:JSON
请求参数:
classify:分类名称
返回结果:
List{
User{
nickName:用户昵称
}
Question{
questionTitle:问题标题
content:问题内容
updateTime:问题更新时间
tag:问题标签
}
}
```
##### 8.根据问题的标签进行相关推荐
```
请求路径:/api/question/recommonds
请求方式:GET
请求格式:JSON
请求参数:
questionId:问题ID
返回结果:
List<Question>{
User{
nickname:用户昵称
}
questionTitle:问题标题
}
```
##### 9.用户修改回复
```
请求路径:/api/question/reply/{replyId}
请求方式:PUT
请求格式:JSON
请求参数:
content: 修改后的回复内容
返回结果:default
```
##### 10.用户删除提问
```
请求路径:/api/question/{questionId}
请求方式:DELETE
请求格式:JSON
请求参数:
questionId:问题ID
返回结果:default
```
### 用户接口
##### 1.用户注册
请求路径:/api/user/register
```
请求路径:/api/user/register
请求方式:POST
请求格式:JSON
请求参数:
......@@ -8,8 +9,10 @@
password:密码
verifyCode:验证码
返回结果:default
```
##### 2.用户本地认证
```
请求路径:/api/auth/local
请求方式:POST
请求格式:JSON
......@@ -18,4 +21,114 @@
password:密码
返回结果:
userId:用户ID
accessToken:授权令牌
\ No newline at end of file
accessToken:授权令牌
```
##### 3.用户短信验证码认证
```
请求路径:/api/auth/sms
请求方式:POST
请求格式:JSON
请求参数:
mobile:手机号
verifyCode:验证码
返回结果:
userId:用户ID
accessToken:授权令牌
```
##### 4.修改密码
```
请求路径:/api/user/{userId}/password
请求方式:PUT
请求格式:JSON
请求参数:
oldPassword:旧密码
newPassword: 新密码
返回结果:
default
```
##### 5.用户通过手机号修改密码(-)
```
请求路径:/api/user/reset-pwd-by-phone
请求方式:PUT
请求格式:JSON
请求参数:
mobile:手机号
verifyCode:验证码
newPassword: 新密码
返回结果:
default
```
##### 6.个人信息
```
请求路径:/api/user/{userId}
请求方式:GET
请求格式:JSON
请求参数:
返回结果:
userAvatar
nickName
gender
signature
mobile
qqNumber
wxNumber
```
##### 6.他人信息
```
请求路径:/api/user/{userId}
请求方式:GET
请求格式:JSON
请求参数:
返回结果:
userAvatar
nickName
gender
signature
mobile
qqNumber
wxNumber
```
##### 7.上传头像(-)
```
请求路径:/api/file/upload
请求方式:POST
请求格式:file
请求参数:
file
type
返回结果:
default
```
##### 8.修改基本信息
```
请求路径:/api/userinfo/base
请求方式:PUT
请求格式:JSON
请求参数:
userAvatar
nickName
gender
signature
mobile
qqNumber
wxNumber
返回结果:
userAvatar
nickName
gender
signature
mobile
qqNumber
wxNumber
```
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment