Skip to content

Commit a3384cf

Browse files
[create-pull-request] automated change (#230)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 3297fb0 commit a3384cf

File tree

1 file changed

+168
-3
lines changed

1 file changed

+168
-3
lines changed

open-api/v0.yaml

Lines changed: 168 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,116 @@ paths:
135135
application/json:
136136
schema:
137137
$ref: '#/components/schemas/Paged_Subject'
138+
/v0/search/characters:
139+
post:
140+
tags:
141+
- 角色
142+
summary: 角色搜索
143+
operationId: searchCharacters
144+
description: |
145+
## 实验性 API, 本 schema 和实际的 API 行为都可能随时发生改动
146+
147+
目前支持的筛选条件包括:
148+
- `nsfw`: 使用 `include` 包含NSFW搜索结果。默认排除搜索NSFW条目。无权限情况下忽略此选项,不会返回NSFW条目。
149+
parameters:
150+
- name: limit
151+
in: query
152+
description: 分页参数
153+
required: false
154+
schema:
155+
type: integer
156+
- name: offset
157+
in: query
158+
description: 分页参数
159+
required: false
160+
schema:
161+
type: integer
162+
requestBody:
163+
content:
164+
application/json:
165+
schema:
166+
type: object
167+
required:
168+
- keyword
169+
properties:
170+
keyword:
171+
type: string
172+
filter:
173+
type: object
174+
description: 不同条件之间是 `且` 的关系
175+
properties:
176+
nsfw:
177+
type: boolean
178+
description: |
179+
无权限的用户会直接忽略此字段,不会返回 R18 角色。
180+
181+
默认或者 `null` 会返回包含 R18 的所有搜索结果。
182+
183+
`true` 只会返回 R18 角色。
184+
185+
`false` 只会返回非 R18 角色。
186+
responses:
187+
'200':
188+
description: 返回搜索结果
189+
content:
190+
application/json:
191+
schema:
192+
$ref: '#/components/schemas/Paged_Character'
193+
/v0/search/persons:
194+
post:
195+
tags:
196+
- 人物
197+
summary: 人物搜索
198+
operationId: searchPersons
199+
description: |
200+
## 实验性 API, 本 schema 和实际的 API 行为都可能随时发生改动
201+
202+
目前支持的筛选条件包括:
203+
- `career`: 职业,可以多次出现。`且` 关系。
204+
205+
不同筛选条件之间为 `且`
206+
parameters:
207+
- name: limit
208+
in: query
209+
description: 分页参数
210+
required: false
211+
schema:
212+
type: integer
213+
- name: offset
214+
in: query
215+
description: 分页参数
216+
required: false
217+
schema:
218+
type: integer
219+
requestBody:
220+
content:
221+
application/json:
222+
schema:
223+
type: object
224+
required:
225+
- keyword
226+
properties:
227+
keyword:
228+
type: string
229+
filter:
230+
type: object
231+
description: 不同条件之间是 `且` 的关系
232+
properties:
233+
career:
234+
type: array
235+
items:
236+
type: string
237+
example:
238+
- artist
239+
- director
240+
description: 职业,可以多次出现。多值之间为 `且` 关系。
241+
responses:
242+
'200':
243+
description: 返回搜索结果
244+
content:
245+
application/json:
246+
schema:
247+
$ref: '#/components/schemas/Paged_Person'
138248
/v0/subjects:
139249
get:
140250
tags:
@@ -472,7 +582,7 @@ paths:
472582
content:
473583
application/json:
474584
schema:
475-
$ref: '#/components/schemas/CharacterDetail'
585+
$ref: '#/components/schemas/Character'
476586
'400':
477587
description: Validation Error
478588
content:
@@ -914,8 +1024,19 @@ paths:
9141024
schema:
9151025
allOf:
9161026
- $ref: '#/components/schemas/User'
1027+
- required:
1028+
- email
1029+
- reg_time
9171030
- type: object
9181031
properties:
1032+
email:
1033+
description: 用户绑定的邮箱地址
1034+
type: string
1035+
format: email
1036+
reg_time:
1037+
description: 用户注册时间。比如 2017-12-03T08:51:16+08:00
1038+
type: string
1039+
format: date-time
9191040
time_offset:
9201041
description: 用户设置的时区偏移,以小时为单位。比如 GMT+8(shanghai/beijing)为 8
9211042
type: integer
@@ -2031,8 +2152,8 @@ components:
20312152
- B
20322153
- AB
20332154
- O
2034-
CharacterDetail:
2035-
title: CharacterDetail
2155+
Character:
2156+
title: Character
20362157
required:
20372158
- id
20382159
- name
@@ -2854,6 +2975,50 @@ components:
28542975
items:
28552976
$ref: '#/components/schemas/Subject'
28562977
default: []
2978+
Paged_Character:
2979+
title: Paged[Character]
2980+
type: object
2981+
properties:
2982+
total:
2983+
title: Total
2984+
type: integer
2985+
default: 0
2986+
limit:
2987+
title: Limit
2988+
type: integer
2989+
default: 0
2990+
offset:
2991+
title: Offset
2992+
type: integer
2993+
default: 0
2994+
data:
2995+
title: Data
2996+
type: array
2997+
items:
2998+
$ref: '#/components/schemas/Character'
2999+
default: []
3000+
Paged_Person:
3001+
title: Paged[Person]
3002+
type: object
3003+
properties:
3004+
total:
3005+
title: Total
3006+
type: integer
3007+
default: 0
3008+
limit:
3009+
title: Limit
3010+
type: integer
3011+
default: 0
3012+
offset:
3013+
title: Offset
3014+
type: integer
3015+
default: 0
3016+
data:
3017+
title: Data
3018+
type: array
3019+
items:
3020+
$ref: '#/components/schemas/Person'
3021+
default: []
28573022
Paged_Episode:
28583023
title: Paged[Episode]
28593024
type: object

0 commit comments

Comments
 (0)