-
Notifications
You must be signed in to change notification settings - Fork 2
User
Siyuan Zhang | 张豆 edited this page Oct 11, 2019
·
1 revision
GET /api/v1/users
Parameter | Default | Description |
---|---|---|
page |
0 | |
size |
10 |
Parameter | Default | Description |
---|---|---|
username |
null |
Fuzzy query. |
id |
null |
|
name |
null |
Fuzzy query. |
studentNumber |
null |
|
temporary |
null |
|
school |
null |
GET /api/v1/users?username=kast&page=0&size=5
{
"currentPage": 0,
"currentSize": 5,
"total": 1,
"list": [
{
"id": 20,
"username": "kastnerorz",
"firstname": null,
"lastname": null,
"email": "[email protected]",
"school": "上海大学",
"signature": null,
"acCount": 111,
"submitCount": 5,
"acRate": 0,
"enabled": true,
"authorities": [
{
"authority": "ROLE_ADMIN"
}
]
}
]
}
GET /api/v1/users/:id
{
"id": 20,
"username": "kastnerorz",
"firstname": null,
"lastname": null,
"email": "[email protected]",
"school": "上海大学",
"signature": null,
"acCount": 111,
"submitCount": 5,
"acRate": 0,
"enabled": true,
"authorities": [
{
"authority": "ROLE_ADMIN"
}
]
}
POST /api/v1/users
Key | Type | Default | Need |
---|---|---|---|
username |
String |
Yes | |
password |
String |
Yes | |
studentNumber |
String |
||
name |
String |
||
email |
String |
Yes | |
school |
String |
Yes | |
signature |
String |
||
enabled |
Boolean |
true |
|
authorities |
Array |
ROLE_USER |
POST /api/v1/users
Request Body:
{
"username": "test",
"password": "pass",
"email": "[email protected]",
"school": "上海大学",
"signature": [
{
"name": "ROLE_USER"
},
{
"name": "ROLE_ADMIN"
}
]
}
{
"id": 20,
"username": "kastnerorz",
"firstname": null,
"lastname": null,
"email": "[email protected]",
"school": "上海大学",
"signature": null,
"acCount": 111,
"submitCount": 5,
"acRate": 0,
"enabled": true,
"authorities": [
{
"authority": "ROLE_ADMIN"
}
]
}
DELETE /api/v1/users
Key | Type | Default | Need |
---|---|---|---|
list |
Array |
Yes |
DELETE /api/v1/users
Request Body:
{
"list": [12, 23, 56]
}
[
{
"id": 20,
"username": "kastnerorz",
"firstname": null,
"lastname": null,
"email": "[email protected]",
"school": "上海大学",
"signature": null,
"acCount": 111,
"submitCount": 5,
"acRate": 0,
"enabled": true,
"authorities": [
{
"authority": "ROLE_ADMIN"
}
]
}
]