1
0
mirror of https://gitee.com/bookshelfplus/bookshelfplus synced 2025-09-12 03:31:39 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
Files
bookshelfplus/bookshelfplus/docs/asciidoc/generated/all.adoc
2022-04-04 10:31:00 +08:00

855 lines
11 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

= 书栖网 服务端接口文档
[[_overview]]
== 概览
RESTful API | bookshelf.plus
=== 版本信息
[%hardbreaks]
__版本__ : 1.0
=== URI scheme
[%hardbreaks]
__域名__ : localhost:8090
=== 标签
* 书籍信息 : Book Controller
* 书籍分类信息 : Category Controller
* 用户操作 : User Controller
* 第三方登录 : Third Party Controller
* 系统调试接口 : Debug Controller
* 网站后台状态检测 : Status Controller
[[_paths]]
== 资源
[[_261c63557a0a2affe4e9ee7cf30075c0]]
=== 书籍信息
Book Controller
[[_addusingget]]
==== 【管理员】添加书籍
....
GET /api/book/add
....
===== 说明
管理员在后台添加书籍
===== 参数
[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|类型|名称|说明|类型
|**Query**|**author** +
__可选__|author|string
|**Query**|**bookName** +
__可选__|bookName|string
|**Query**|**categoryId** +
__可选__|categoryId|integer (int32)
|**Query**|**copyright** +
__可选__|copyright|string
|**Query**|**description** +
__可选__|description|string
|**Query**|**isDelete** +
__可选__|isDelete|boolean
|**Query**|**language** +
__可选__|language|string
|**Query**|**publishingHouse** +
__可选__|publishingHouse|string
|**Query**|**thumbnail** +
__可选__|thumbnail|string
|**Query**|**token** +
__可选__|token|string
|===
===== 响应
[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP代码|说明|类型
|**200**|OK|<<_commonreturntype,CommonReturnType>>
|**401**|Unauthorized|无内容
|**403**|Forbidden|无内容
|**404**|Not Found|无内容
|===
===== 生成
* `\*/*`
===== HTTP请求示例
====== 请求 path
----
/api/book/add
----
===== HTTP响应示例
====== 响应 200
[source,json]
----
{
"data" : "object",
"status" : "string"
}
----
[[_getusingget]]
==== 获取书籍信息
....
GET /api/book/get
....
===== 说明
获取书籍信息
===== 参数
[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|类型|名称|说明|类型
|**Query**|**id** +
__必填__|id|integer (int32)
|===
===== 响应
[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP代码|说明|类型
|**200**|OK|<<_commonreturntype,CommonReturnType>>
|**401**|Unauthorized|无内容
|**403**|Forbidden|无内容
|**404**|Not Found|无内容
|===
===== 生成
* `\*/*`
===== HTTP请求示例
====== 请求 path
----
/api/book/get?id=0
----
===== HTTP响应示例
====== 响应 200
[source,json]
----
{
"data" : "object",
"status" : "string"
}
----
[[_searchusingget]]
==== 查询书籍列表
....
GET /api/book/search
....
===== 说明
通过指定条件查询书籍列表
===== 参数
[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|类型|名称|说明|类型
|**Query**|**author** +
__可选__|author|string
|**Query**|**bookName** +
__可选__|bookName|string
|**Query**|**categoryId** +
__可选__|categoryId|integer (int32)
|**Query**|**id** +
__可选__|id|integer (int32)
|**Query**|**language** +
__可选__|language|string
|**Query**|**publishingHouse** +
__可选__|publishingHouse|string
|===
===== 响应
[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP代码|说明|类型
|**200**|OK|<<_commonreturntype,CommonReturnType>>
|**401**|Unauthorized|无内容
|**403**|Forbidden|无内容
|**404**|Not Found|无内容
|===
===== 生成
* `\*/*`
===== HTTP请求示例
====== 请求 path
----
/api/book/search
----
===== HTTP响应示例
====== 响应 200
[source,json]
----
{
"data" : "object",
"status" : "string"
}
----
[[_82c2171949c312f17a084ab9b31e7d55]]
=== 书籍分类信息
Category Controller
[[_getusingget_1]]
==== 获取指定分类
....
GET /api/category/get
....
===== 说明
获取指定的书籍分类
===== 参数
[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|类型|名称|说明|类型
|**Query**|**id** +
__必填__|id|integer (int32)
|===
===== 响应
[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP代码|说明|类型
|**200**|OK|<<_commonreturntype,CommonReturnType>>
|**401**|Unauthorized|无内容
|**403**|Forbidden|无内容
|**404**|Not Found|无内容
|===
===== 生成
* `\*/*`
===== HTTP请求示例
====== 请求 path
----
/api/category/get?id=0
----
===== HTTP响应示例
====== 响应 200
[source,json]
----
{
"data" : "object",
"status" : "string"
}
----
[[_getallusingget]]
==== 获取所有分类
....
GET /api/category/list
....
===== 说明
获取所有的书籍分类
===== 响应
[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP代码|说明|类型
|**200**|OK|<<_commonreturntype,CommonReturnType>>
|**401**|Unauthorized|无内容
|**403**|Forbidden|无内容
|**404**|Not Found|无内容
|===
===== 生成
* `\*/*`
===== HTTP请求示例
====== 请求 path
----
/api/category/list
----
===== HTTP响应示例
====== 响应 200
[source,json]
----
{
"data" : "object",
"status" : "string"
}
----
[[_9083a36b9e1b060bcb75ff62bb4bda37]]
=== 用户操作
User Controller
[[_getuserstatususingpost]]
==== 获取用户登录状态
....
POST /api/user/getUserStatus
....
===== 说明
获取用户登录状态
===== 参数
[options="header", cols=".^2a,.^3a,.^4a"]
|===
|类型|名称|类型
|**FormData**|**token** +
__可选__|string
|===
===== 响应
[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP代码|说明|类型
|**200**|OK|<<_commonreturntype,CommonReturnType>>
|**201**|Created|无内容
|**401**|Unauthorized|无内容
|**403**|Forbidden|无内容
|**404**|Not Found|无内容
|===
===== 消耗
* `application/x-www-form-urlencoded`
===== 生成
* `\*/*`
===== HTTP请求示例
====== 请求 path
----
/api/user/getUserStatus
----
====== 请求 formData
[source,json]
----
"string"
----
===== HTTP响应示例
====== 响应 200
[source,json]
----
{
"data" : "object",
"status" : "string"
}
----
[[_loginusingpost]]
==== 用户登录
....
POST /api/user/login
....
===== 说明
传入用户名以及密码明文后台计算密码SHA1值进行登录
===== 参数
[options="header", cols=".^2a,.^3a,.^4a"]
|===
|类型|名称|类型
|**FormData**|**password** +
__可选__|string
|**FormData**|**username** +
__可选__|string
|===
===== 响应
[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP代码|说明|类型
|**200**|OK|<<_commonreturntype,CommonReturnType>>
|**201**|Created|无内容
|**401**|Unauthorized|无内容
|**403**|Forbidden|无内容
|**404**|Not Found|无内容
|===
===== 消耗
* `application/x-www-form-urlencoded`
===== 生成
* `\*/*`
===== HTTP请求示例
====== 请求 path
----
/api/user/login
----
====== 请求 formData
[source,json]
----
"string"
----
===== HTTP响应示例
====== 响应 200
[source,json]
----
{
"data" : "object",
"status" : "string"
}
----
[[_logoutusingpost]]
==== 用户登出
....
POST /api/user/logout
....
===== 说明
用户退出登录
===== 参数
[options="header", cols=".^2a,.^3a,.^4a"]
|===
|类型|名称|类型
|**FormData**|**token** +
__可选__|string
|===
===== 响应
[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP代码|说明|类型
|**200**|OK|<<_commonreturntype,CommonReturnType>>
|**201**|Created|无内容
|**401**|Unauthorized|无内容
|**403**|Forbidden|无内容
|**404**|Not Found|无内容
|===
===== 消耗
* `application/x-www-form-urlencoded`
===== 生成
* `\*/*`
===== HTTP请求示例
====== 请求 path
----
/api/user/logout
----
====== 请求 formData
[source,json]
----
"string"
----
===== HTTP响应示例
====== 响应 200
[source,json]
----
{
"data" : "object",
"status" : "string"
}
----
[[_4b02b6687df4f15fab50b8d31c1fc123]]
=== 第三方登录
Third Party Controller
[[_qqusingget]]
==== 快捷登录回调函数
....
GET /api/third-party/callback/{platform}
....
===== 说明
传入 code 值,进行登录
===== 参数
[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|类型|名称|说明|类型
|**Path**|**platform** +
__必填__|platform|string
|**Query**|**auth_code** +
__可选__||string
|**Query**|**authorization_code** +
__可选__||string
|**Query**|**code** +
__可选__||string
|**Query**|**oauth_token** +
__可选__||string
|**Query**|**oauth_verifier** +
__可选__||string
|**Query**|**state** +
__可选__||string
|===
===== 响应
[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP代码|说明|类型
|**200**|OK|<<_commonreturntype,CommonReturnType>>
|**401**|Unauthorized|无内容
|**403**|Forbidden|无内容
|**404**|Not Found|无内容
|===
===== 生成
* `\*/*`
===== HTTP请求示例
====== 请求 path
----
/api/third-party/callback/string
----
===== HTTP响应示例
====== 响应 200
[source,json]
----
{
"data" : "object",
"status" : "string"
}
----
[[_loginusingget]]
==== 第三方用户登录跳转地址
....
GET /api/third-party/login
....
===== 说明
传入需要登录的第三方平台大小写均可返回跳转url
===== 参数
[options="header", cols=".^2a,.^3a,.^9a,.^4a"]
|===
|类型|名称|说明|类型
|**Query**|**platform** +
__必填__|platform|string
|===
===== 响应
[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP代码|说明|类型
|**200**|OK|<<_commonreturntype,CommonReturnType>>
|**401**|Unauthorized|无内容
|**403**|Forbidden|无内容
|**404**|Not Found|无内容
|===
===== 生成
* `\*/*`
===== HTTP请求示例
====== 请求 path
----
/api/third-party/login?platform=string
----
===== HTTP响应示例
====== 响应 200
[source,json]
----
{
"data" : "object",
"status" : "string"
}
----
[[_aca0f16a4237edba915fe70c9b07871c]]
=== 系统调试接口
Debug Controller
[[_statususingpost]]
==== 获取系统配置
....
POST /api/debug/status
....
===== 说明
仅限管理员登录状态下可获取
===== 参数
[options="header", cols=".^2a,.^3a,.^4a"]
|===
|类型|名称|类型
|**FormData**|**token** +
__可选__|string
|===
===== 响应
[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP代码|说明|类型
|**200**|OK|<<_commonreturntype,CommonReturnType>>
|**201**|Created|无内容
|**401**|Unauthorized|无内容
|**403**|Forbidden|无内容
|**404**|Not Found|无内容
|===
===== 消耗
* `application/x-www-form-urlencoded`
===== 生成
* `\*/*`
===== HTTP请求示例
====== 请求 path
----
/api/debug/status
----
====== 请求 formData
[source,json]
----
"string"
----
===== HTTP响应示例
====== 响应 200
[source,json]
----
{
"data" : "object",
"status" : "string"
}
----
[[_908e76a1e64eba3a29d68b89ae1eb608]]
=== 网站后台状态检测
Status Controller
[[_getusingget_2]]
==== 系统状态
....
GET /api/status/get
....
===== 说明
获取服务器当前系统负载。SystemLoadAverage返回-1时代表不支持。
===== 响应
[options="header", cols=".^2a,.^14a,.^4a"]
|===
|HTTP代码|说明|类型
|**200**|OK|<<_commonreturntype,CommonReturnType>>
|**401**|Unauthorized|无内容
|**403**|Forbidden|无内容
|**404**|Not Found|无内容
|===
===== 生成
* `\*/*`
===== HTTP请求示例
====== 请求 path
----
/api/status/get
----
===== HTTP响应示例
====== 响应 200
[source,json]
----
{
"data" : "object",
"status" : "string"
}
----
[[_definitions]]
== 定义
[[_commonreturntype]]
=== CommonReturnType
[options="header", cols=".^3a,.^11a,.^4a"]
|===
|名称|说明|类型
|**data** +
__可选__|**样例** : `"object"`|object
|**status** +
__可选__|**样例** : `"string"`|string
|===