You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
176 lines
5.0 KiB
176 lines
5.0 KiB
openapi: "3.0.0" |
|
info: |
|
title: 书签同步助手后端接口 |
|
version: 0.0.1 |
|
tags: |
|
- name: User |
|
description: 用户管理 |
|
- name: Bookmark |
|
description: 书签管理 |
|
paths: |
|
/user/login: |
|
post: |
|
operationId: userLogin |
|
summary: 用户登录 |
|
tags: |
|
- User |
|
requestBody: |
|
description: 登录信息。 |
|
required: true |
|
content: |
|
application/json: |
|
schema: |
|
type: object |
|
properties: |
|
account: |
|
description: 账号 |
|
type: string |
|
example: 'admin' |
|
password: |
|
description: 密码 |
|
type: string |
|
example: 'secret' |
|
responses: |
|
'200': |
|
description: 200 response |
|
content: |
|
application/json: |
|
schema: |
|
type: object |
|
properties: |
|
code: |
|
$ref: '#/components/schemas/ResponseCode' |
|
message: |
|
type: string |
|
description: 响应信息,响应码为非20000时表示错误信息 |
|
examples: |
|
20000: |
|
value: { |
|
"code": 20000, |
|
"message": "OK" |
|
} |
|
/user/logout: |
|
post: |
|
operationId: userLogout |
|
summary: 登录注销 |
|
tags: |
|
- User |
|
responses: |
|
'200': |
|
description: 200 response |
|
content: |
|
application/json: |
|
schema: |
|
type: object |
|
properties: |
|
code: |
|
$ref: '#/components/schemas/ResponseCode' |
|
message: |
|
type: string |
|
description: 响应信息,响应码为非20000时表示错误信息 |
|
examples: |
|
20000: |
|
value: { |
|
"code": 20000, |
|
"message": "OK" |
|
} |
|
/bookmark: |
|
get: |
|
operationId: downloadBookmark |
|
summary: 下载服务器书签列表 |
|
tags: |
|
- Bookmark |
|
responses: |
|
'200': |
|
description: |- |
|
200 response |
|
content: |
|
application/json: |
|
schema: |
|
type: object |
|
properties: |
|
code: |
|
$ref: '#/components/schemas/ResponseCode' |
|
message: |
|
type: string |
|
description: 响应信息,响应码为非20000时表示错误信息 |
|
data: |
|
type: object |
|
properties: |
|
total: |
|
description: 书签总数 |
|
type: integer |
|
list: |
|
type: array |
|
items: |
|
$ref: '#/components/schemas/Bookmark' |
|
post: |
|
operationId: uploadBookmark |
|
summary: 上传本地书签 |
|
tags: |
|
- Bookmark |
|
requestBody: |
|
description: 需要添加的职工信息,注意 employeeId 字段是无效的。 |
|
required: true |
|
content: |
|
application/json: |
|
schema: |
|
type: array |
|
items: |
|
$ref: '#/components/schemas/Bookmark' |
|
responses: |
|
'200': |
|
description: 200 response |
|
content: |
|
application/json: |
|
schema: |
|
type: object |
|
properties: |
|
code: |
|
$ref: '#/components/schemas/ResponseCode' |
|
message: |
|
type: string |
|
description: 响应信息,响应码为非20000时表示错误信息 |
|
examples: |
|
20000: |
|
value: { |
|
"code": 20000, |
|
"message": "OK" |
|
} |
|
components: |
|
schemas: |
|
ResponseCode: |
|
type: integer |
|
enum: |
|
- 20000 |
|
- 40000 |
|
- 40100 |
|
description: > |
|
响应码: |
|
* `20000` - 表明调用成功 |
|
* `40000` - 用户名或密码错误 |
|
* `40001` - token已过期 |
|
Bookmark: |
|
type: object |
|
properties: |
|
id: |
|
description: 节点的唯一标识, id 在当前配置文件中是唯一的,浏览器重启后依然有效。 |
|
type: string |
|
parentId: |
|
description: 父节点的ID,根节点没有此属性 |
|
type: string |
|
dateAdded: |
|
description: 书签节点创建时的时间戳 |
|
type: integer |
|
dateGroupModified: |
|
description: 书签文件夹内容的最后更新时间戳,书签节点没有此属性 |
|
type: integer |
|
index: |
|
description: 书签在父节点中的索引,根节点没有此属性 |
|
type: integer |
|
title: |
|
description: 书签标题 |
|
type: string |
|
url: |
|
description: 书签的url,书签文件夹没有此属性 |
|
type: string |