-
Notifications
You must be signed in to change notification settings - Fork 2
Contest
GET /api/v1/contests
Parameter | Default | Description |
---|---|---|
page |
0 |
|
size |
10 |
Parameter | Default | Description |
---|---|---|
name |
null | fuzzy query |
type |
null | PUBLIC / SECRET_WITH_PASSWORD / SECRET_WITHOUT_PASSWORD |
status |
null | NOT_STARTED / PROCESSING / ENDED |
GET /api/v1/contests?page=0&size=2&name=testContest1
{
"currentPage": 0,
"currentSize": 1,
"total": 1,
"list": [
{
"id": 558,
"authorId": 20,
"authorName": "kastnerorz",
"password": null,
"name": "testContestSecretWithoutPassword",
"description": "testDescriptionSecretWithoutPassword",
"contestType": "SECRET_WITHOUT_PASSWORD",
"status": "NOT_STARTED",
"judgeType": "IMMEDIATELY",
"startDate": "2018-10-05 21:00:00",
"endDate": "2018-10-06 02:00:00",
"createDate": "2018-10-07 19:01:43",
"enable": false,
"visible": false
}
]
}
GET /api/v1/contests/:id
{
"id": 558,
"authorId": 20,
"authorName": "kastnerorz",
"password": null,
"name": "testContestSecretWithoutPassword",
"description": "testDescriptionSecretWithoutPassword",
"contestType": "SECRET_WITHOUT_PASSWORD",
"status": "NOT_STARTED",
"judgeType": "IMMEDIATELY",
"startDate": "2018-10-05 21:00:00",
"endDate": "2018-10-06 02:00:00",
"createDate": "2018-10-07 19:01:43",
"enable": false,
"visible": false
}
POST /api/v1/contests
The parameter which default is "null" must be provided
Parameter | Default | Description |
---|---|---|
authorId |
||
name |
Unique | |
description |
||
contestType |
PUBLIC |
PUBLIC / SECRET_WITH_PASSWORD / SECRET_WITHOUT_PASSWORD |
password |
null | Only SECRET_WITH_PASSWORD has password |
judgeType |
IMMEDIATELY |
IMMEDIATELY(提交即判题) / DELAY(考试结束后判题) |
enable |
false |
是否开启 |
visible |
false |
非管理员是否可见 |
startDate |
format: "YYYY-MM-DD hh:mm:ss" | |
endDate |
format: "YYYY-MM-DD hh:mm:ss" |
It will return the contest just created.
{
"id": 558,
"authorId": 20,
"authorName": "kastnerorz",
"password": null,
"name": "testContestSecretWithoutPassword",
"description": "testDescriptionSecretWithoutPassword",
"contestType": "SECRET_WITHOUT_PASSWORD",
"status": "NOT_STARTED",
"judgeType": "IMMEDIATELY",
"startDate": "2018-10-05 21:00:00",
"endDate": "2018-10-06 02:00:00",
"createDate": "2018-10-07 19:01:43",
"enable": false,
"visible": false
}
PUT /api/v1/contests/:id
The parameter which default is "null" must be provided
Parameter | Default | Description |
---|---|---|
authorId |
||
name |
Unique | |
description |
||
contestType |
PUBLIC |
PUBLIC / SECRET_WITH_PASSWORD / SECRET_WITHOUT_PASSWORD |
password |
null | Only SECRET_WITH_PASSWORD has password |
judgeType |
IMMEDIATELY |
IMMEDIATELY(提交即判题) / DELAY(考试结束后判题) |
enable |
false |
是否开启 |
visible |
false |
非管理员是否可见 |
startDate |
format: "YYYY-MM-DD hh:mm:ss" | |
endDate |
format: "YYYY-MM-DD hh:mm:ss" |
It will return the contest just updated.
{
"id": 558,
"authorId": 20,
"authorName": "kastnerorz",
"password": null,
"name": "testContestSecretWithoutPassword",
"description": "testDescriptionSecretWithoutPassword",
"contestType": "SECRET_WITHOUT_PASSWORD",
"status": "NOT_STARTED",
"judgeType": "IMMEDIATELY",
"startDate": "2018-10-05 21:00:00",
"endDate": "2018-10-06 02:00:00",
"createDate": "2018-10-07 19:01:43",
"enable": false,
"visible": false
}
PATCH /api/v1/contests/:id
Parameter | Default | Description |
---|---|---|
visible |
null | true / false |
{
"id": 558,
"authorId": 20,
"authorName": "kastnerorz",
"password": null,
"name": "testContestSecretWithoutPassword",
"description": "testDescriptionSecretWithoutPassword",
"contestType": "SECRET_WITHOUT_PASSWORD",
"status": "NOT_STARTED",
"judgeType": "IMMEDIATELY",
"startDate": "2018-10-05 21:00:00",
"endDate": "2018-10-06 02:00:00",
"createDate": "2018-10-07 19:01:43",
"enable": false,
"visible": false
}
DELETE /api/v1/contests/:id
{
"id": 558,
"authorId": 20,
"authorName": "kastnerorz",
"password": null,
"name": "testContestSecretWithoutPassword",
"description": "testDescriptionSecretWithoutPassword",
"contestType": "SECRET_WITHOUT_PASSWORD",
"status": "NOT_STARTED",
"judgeType": "IMMEDIATELY",
"startDate": "2018-10-05 21:00:00",
"endDate": "2018-10-06 02:00:00",
"createDate": "2018-10-07 19:01:43",
"enable": false,
"visible": false
}
GET /api/v1/contests/:id/users
[
{
"id": 97,
"username": "shu-test",
"firstname": null,
"lastname": null,
"email": "[email protected]",
"school": "上海大学",
"signature": null,
"acCount": 0,
"submitCount": 0,
"acRate": 0,
"enabled": true,
"authorities": [
{
"authority": "ROLE_USER"
}
]
}
]
ADMIN Required
POST /api/v1/contests/:id/users
The parameter which default is "null" must be provided
Parameter | Default | Description |
---|---|---|
userIds |
Request Body:
[47,50]
It will return all users after added.
[
{
"id": 97,
"username": "shu-test",
"firstname": null,
"lastname": null,
"email": "[email protected]",
"school": "上海大学",
"signature": null,
"acCount": 0,
"submitCount": 0,
"acRate": 0,
"enabled": true,
"authorities": [
{
"authority": "ROLE_USER"
}
]
}
]
POST /api/v1/contests/:id/groups
The parameter which default is "null" must be provided
Parameter | Default | Description |
---|---|---|
groupIds |
It will response the users in that group just added (It won't add duplicate users).
⚠️ The list returned is empty means the contest already has all of the users in selected group.
⚠️ Users added via groups can only delete manually.
[
{
"id": 91,
"username": "iris",
"firstname": null,
"lastname": null,
"email": "[email protected]",
"school": "上海大学",
"signature": null,
"acCount": 4,
"submitCount": 4,
"acRate": 0,
"enabled": true,
"authorities": [
{
"authority": "ROLE_USER"
}
]
},
{
"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"
}
]
},
{
"id": 97,
"username": "shu-test",
"firstname": null,
"lastname": null,
"email": "[email protected]",
"school": "上海大学",
"signature": null,
"acCount": 2,
"submitCount": 2,
"acRate": 0,
"enabled": true,
"authorities": [
{
"authority": "ROLE_ADMIN"
}
]
}
]
DELETE /api/v1/contests/:id/users
The parameter which default is "null" must be provided
Parameter | Default | Description |
---|---|---|
userIds |
It will return the users in contest after deleted.
[
{
"id": 97,
"username": "shu-test",
"firstname": null,
"lastname": null,
"email": "[email protected]",
"school": "上海大学",
"signature": null,
"acCount": 0,
"submitCount": 0,
"acRate": 0,
"enabled": true,
"authorities": [
{
"authority": "ROLE_USER"
}
]
}
]
GET /api/v1/contests/:id/problems
[
{
"id": 82,
"authorId": 20,
"authorName": "kastnerorz",
"name": "testContest1",
"description": "testDescription",
"contestType": "PUBLIC",
"judgeType": "IMMEDIATELY",
"startDate": "2018-08-27 06:42:00",
"endDate": "2018-08-28 06:42:00",
"createDate": "2018-08-27 22:37:46"
}
]
POST /api/v1/contests/:id/problems
The parameter which default is "null" must be provided
Parameter | Default | Description |
---|---|---|
problemId |
An array containing the problemIds |
Request Body:
[47,50]
It will return the problems just added.
DELETE /api/v1/contests/:id/problems
The parameter which default is "null" must be provided
Parameter | Default | Description |
---|---|---|
problemId |
An array containing the problemIds |
Request Body:
[47,50]
It will return the problems which contest has after delete the problems.
PATCH /api/v1/contests/:id/status
Parameter | Default | Description |
---|---|---|
option |
null | ENABLE / DISABLE / RESET |
{
"id": 780,
"authorId": 20,
"authorName": "kastnerorz",
"password": null,
"name": "withpassword",
"description": "<p>dddd</p>",
"contestType": "SECRET_WITH_PASSWORD",
"status": "PROCESSING",
"judgeType": "IMMEDIATELY",
"startDate": "2018-10-13 00:00:00",
"endDate": "2018-10-14 00:00:00",
"createDate": "2018-10-13 13:05:43",
"enable": true,
"visible": true
}
POST /api/v1/contests/:id/join
Parameter | Default | Description |
---|---|---|
password |
password |
{
"code": 200,
"message": "加入成功",
"data": true
}
GET /api/v1/contests/:id/ranking
{
"id": 609,
"contestId": 608,
"contestName": "testContestPublic",
"rankingUserList": [
{
"id": 682,
"userId": 91,
"userName": "iris",
"acceptCount": 0,
"submitCount": 0,
"totalTime": {
"id": 681,
"contestId": null,
"problemId": null,
"totalTime": 0,
"errorCount": 0,
"userId": null,
"userName": null,
"submitted": false,
"passed": false,
"firstPassed": false
},
"timeList": [
{
"id": 684,
"contestId": 608,
"problemId": 53,
"totalTime": 0,
"errorCount": 0,
"userId": 91,
"userName": "iris",
"submitted": false,
"passed": false,
"firstPassed": false
},
{
"id": 683,
"contestId": 608,
"problemId": 50,
"totalTime": 0,
"errorCount": 0,
"userId": 91,
"userName": "iris",
"submitted": false,
"passed": false,
"firstPassed": false
}
],
"ranked": true,
"rank": null
},
{
"id": 678,
"userId": 20,
"userName": "kastnerorz",
"acceptCount": 0,
"submitCount": 0,
"totalTime": {
"id": 677,
"contestId": null,
"problemId": null,
"totalTime": 0,
"errorCount": 0,
"userId": null,
"userName": null,
"submitted": false,
"passed": false,
"firstPassed": false
},
"timeList": [
{
"id": 680,
"contestId": 608,
"problemId": 53,
"totalTime": 0,
"errorCount": 0,
"userId": 20,
"userName": "kastnerorz",
"submitted": false,
"passed": false,
"firstPassed": false
},
{
"id": 679,
"contestId": 608,
"problemId": 50,
"totalTime": 0,
"errorCount": 0,
"userId": 20,
"userName": "kastnerorz",
"submitted": false,
"passed": false,
"firstPassed": false
}
],
"ranked": true,
"rank": null
}
]
}