Skip to content
Siyuan Zhang | 张豆 edited this page Oct 11, 2019 · 1 revision

Get All Commits

HTTP Request

GET /api/v1/commits

URL Parameters

Parameter Default Description
page 0
size 10
isPractice null
username null
language null CPP/C/JAVA/PYTHON2/PYTHON3

Response

{
    "currentPage": 0,
    "currentSize": 10,
    "total": 2,
    "list": [
        {
            "id": 773,
            "authorId": 20,
            "authorName": "kastnerorz",
            "problemId": 50,
            "problemTitle": "test1",
            "contestId": null,
            "code": "src",
            "createDate": null,
            "language": "JAVA",
            "duration": 10,
            "result": "ACCEPTED"
        },
        {
            "id": 774,
            "authorId": 20,
            "authorName": "kastnerorz",
            "problemId": 50,
            "problemTitle": "test1",
            "contestId": null,
            "code": "src",
            "createDate": "2018-10-11 14:09:43",
            "language": "JAVA",
            "duration": 10,
            "result": "ACCEPTED"
        }
    ]
}

Get A Specific Commit

HTTP Request

GET /api/v1/commits/:id

Response

{
    "id": 773,
    "authorId": 20,
    "authorName": "kastnerorz",
    "problemId": 50,
    "problemTitle": "test1",
    "contestId": null,
    "code": "src",
    "createDate": null,
    "language": "JAVA",
    "duration": 10,
    "result": "ACCEPTED"
}

Get Contest Commits

HTTP Request

GET /api/v1/contests/:contestId/problems/:problemId/commits

Response

[
    {
        "id": 785,
        "authorId": 20,
        "authorName": "kastnerorz",
        "problemId": 53,
        "problemTitle": "test3",
        "contestId": 778,
        "code": "code",
        "createDate": "2018-10-14 15:07:05",
        "language": "JAVA",
        "duration": 10,
        "result": "TIME_LIMIT_EXCEEDED"
    }
]

Create Contest Commit

HTTP Request

POST /api/v1/contests/:contestId/problems/:problemId/commits

Request Parameters

Parameter Default Description
code null Source code
language null JAVA / CPP / C

Response

{
    "id": 785,
    "authorId": 20,
    "authorName": "kastnerorz",
    "problemId": 53,
    "problemTitle": "test3",
    "contestId": 778,
    "code": "code",
    "createDate": "2018-10-14 15:07:05",
    "language": "JAVA",
    "duration": 10,
    "result": "TIME_LIMIT_EXCEEDED"
}

Get Practice Commits

HTTP Request

GET /api/v1/problems/:id/commits

Response

[
    {
        "id": 787,
        "authorId": 20,
        "authorName": "kastnerorz",
        "problemId": 53,
        "problemTitle": "test3",
        "contestId": null,
        "code": "src",
        "createDate": "2018-10-15 10:39:04",
        "language": "CPP",
        "duration": 10,
        "result": "ACCEPTED"
    }
]

Create Practice Commit

HTTP Request

POST /api/v1/problems/:problemId/commits

Request Parameters

Parameter Default Description
code null Source code
language null JAVA / CPP / C

Response

{
    "id": 785,
    "authorId": 20,
    "authorName": "kastnerorz",
    "problemId": 53,
    "problemTitle": "test3",
    "contestId": 778,
    "code": "code",
    "createDate": "2018-10-14 15:07:05",
    "language": "JAVA",
    "duration": 10,
    "result": "TIME_LIMIT_EXCEEDED"
}

Re-Judge Commit

HTTP Request

PUT /api/v1/commits/:id

Response

{
    "id": 785,
    "authorId": 20,
    "authorName": "kastnerorz",
    "problemId": 53,
    "problemTitle": "test3",
    "contestId": 778,
    "code": "code",
    "createDate": "2018-10-14 15:07:05",
    "language": "JAVA",
    "duration": 10,
    "result": "ACCEPTED"
}