-
Notifications
You must be signed in to change notification settings - Fork 0
validate and error handle
steiner edited this page Jan 29, 2024
·
1 revision
注意 如果字段可为空,那就构造字段为空的JSON传递即可
- username
- length >= 5
- length <= 24
- passwordLength
- length >= 5
- email
- length <= 48
- length >= 5
- email 格式
- username
- length <= 24
- length >= 5
- name
- length <= 16
- length >= 1
- username
- length >= 5
- length <= 24
- email
- length <= 48
- length >= 5
- passwordLength
- value >= 5
- value <= 16
- email
- email 格式
- parentid
- value >= 1
- name
- length >= 5
- length <= 32
- name
- length >= 1
- length <= 32
- color
- 16进制颜色格式
- parentid
- value >= 1
- parentid
- value >= 1
- after
- value >= 0
- name
- length >= 1
- length <= 32
- userid
- value >= 1
- name
- length >= 1
- length <= 32
- avatarid
- value >= 1
- name
- length >= 1
- length <= 64
- name
- length >= 1
- length <= 32
- id
- value >= 1
- name
- length >= 1
- length <= 32
- id
- value >= 1
- name
- length >= 1
- length <= 32
- id
- value >= 1
- avatarid
- value >= 1
- name
- length >= 1
- length <= 32
- id
- value >= 1
- name
- length >= 1
- length <= 64
- name
- length >= 1
- length <= 16
- order
- value >= 0
- parentid
- value >= 1
- id
- value >= 1
- order
- value >= 0
- name
- value >= 1
- value <= 16
参照 api ,如果查询参数或路径参数不匹配,会返回 404 状态码
如果查询过程中发现没有对应的数据,返回 404 状态码 如
- 更新用户时,如果没有匹配的用户,返回 404 状态码
- 更新任务时,如果没有匹配的任务,返回 404 状态码
如果添加数据过程中或者更新过程中发现有重复的元素,返回 400 状态码
如
- 注册用户时有重复的用户名,返回 400 状态码
- 更新用户时有重复的用户名,返回 400 状态码
ktor 会自动返回 400 状态码