From c356540463f203d702f152a30bb6ab73fcd0b2c6 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Mon, 19 Sep 2022 07:34:47 +0000 Subject: [PATCH] Update doc --- doc/api/auth.zh_CN.md | 5 +++++ doc/api/auth/status.zh_CN.json | 3 ++- doc/api/result.zh_CN.json | 27 +++++++++++++++++++++++++++ doc/api/version.json | 3 ++- doc/api/version.zh_CN.json | 3 ++- 5 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 doc/api/result.zh_CN.json diff --git a/doc/api/auth.zh_CN.md b/doc/api/auth.zh_CN.md index 25ce74d..2c14566 100644 --- a/doc/api/auth.zh_CN.md +++ b/doc/api/auth.zh_CN.md @@ -3,3 +3,8 @@ * 路径: `/api/auth/status`、 `/auth/status`、 `/api/auth` 或 `/auth` * 方法: `GET` 或 `POST` * 鉴权: 无需 +## 新增用户 +* 路径: `/api/auth/user/add`、 `/auth/user/add` +* 方法: `GET` 或 `POST` +* RESTful: `PUT /api/auth/user` 或 `PUT /auth/user` +* 鉴权: 一般需要(如服务器状态内的`has_root_user`为`false`则无需鉴权) diff --git a/doc/api/auth/status.zh_CN.json b/doc/api/auth/status.zh_CN.json index cd45d20..4d31c9b 100644 --- a/doc/api/auth/status.zh_CN.json +++ b/doc/api/auth/status.zh_CN.json @@ -8,5 +8,6 @@ "type": "boolean", "description": "是否存在根用户,如不存在,添加用户无需鉴权" } - } + }, + "required": ["has_root_user"] } diff --git a/doc/api/result.zh_CN.json b/doc/api/result.zh_CN.json new file mode 100644 index 0000000..9af53f3 --- /dev/null +++ b/doc/api/result.zh_CN.json @@ -0,0 +1,27 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/lifegpc/pixiv_downloader/raw/master/doc/api/result.zh_CN.json", + "title": "返回结果", + "type": "object", + "properties": { + "ok": { + "description": "请求是否成功", + "type": "boolean" + }, + "code": { + "description": "错误代码,如请求成功则为0", + "type": "integer" + }, + "msg": { + "description": "错误信息", + "type": "string" + }, + "debug_msg": { + "description": "调试用的错误信息" + }, + "result": { + "description": "请求结果" + } + }, + "required": ["ok", "code"] +} diff --git a/doc/api/version.json b/doc/api/version.json index aa738d0..036d85b 100644 --- a/doc/api/version.json +++ b/doc/api/version.json @@ -13,5 +13,6 @@ "maxItems": 4, "minItems": 4 } - } + }, + "required": ["version"] } diff --git a/doc/api/version.zh_CN.json b/doc/api/version.zh_CN.json index b3ddf2f..18bcc00 100644 --- a/doc/api/version.zh_CN.json +++ b/doc/api/version.zh_CN.json @@ -13,5 +13,6 @@ "maxItems": 4, "minItems": 4 } - } + }, + "required": ["version"] }