虚拟判题机对接文档

接口方法列表

  • 抓取题目API
  • 提交账号API
  • 提交解答API
  • 查询状态API

抓取题目API

接口定义

http://localhost:8080/vjudge/problem/crawlProblem.action?id=${id}

输入参数

参数名 类型 示例值 描述
id int 6 题目编号

返回示例

{
    "data": {
        "description": "
\n Calculate \n A + B. \n
\n
\n
\n   \n
", "hint": "", "id": 1, "input": "
\n Each line will contain two integers \n A and \n B. Process to end of file. \n
\n
\n
\n   \n
", "languageList": { "0": "G++", "1": "GCC", "2": "C++", "3": "C", "4": "Pascal", "5": "Java", "6": "C#" }, "memoryLimit": 32768, "output": "
\n For each case, output \n A + B in one line. \n
\n
\n
\n   \n
", "sampleInput": "
1 1
\n  \n
", "sampleOutput": "
2
\n  \n
", "source": "", "timeLimit": 1, "title": "A + B Problem" }, "code": 100, "message": "抓取对象正在更新..." }

返回码

code message 备注说明
0 抓取成功
100 抓取对象正在更新...
200 抓取对象不完整 失败返回码


提交账号API

接口定义

http://localhost:8080/vjudge/user/submitAccount.action

输入参数

参数名 类型 示例值 描述
username String 用户名
password String 用户密码

返回示例

{
    "code": 0,
    "message": "success"
}

返回码

code message 备注说明
0 success
200 Username not exists! 失败返回码


提交解答API

接口定义

http://localhost:8080/vjudge/problem/submitSolution.action

输入参数

参数名 类型 示例值 描述
id int 1 题目编号
language String 2 语言编号
source String base64编制代码

返回示例

{
    "data": {
        "taskId": 32
    },
    "code": 0,
    "message": "Submitting in process..."
}

返回码

code message 备注说明
0 Submitting in process...
101 Please login first!
200 No such a language! 失败返回码


查询状态API

接口定义

http://localhost:8080/vjudge/problem/queryStatus.action?id=${id}

输入参数

参数名 类型 示例值 描述
id int 32 taskId

返回示例

{
    "data": {
        "memory": 1712,
        "status": "AC",
        "time": 15
    },
    "code": 0,
    "message": "Success"
}

返回码

code message 备注说明
0 Success
200 The query doesn't exist 失败返回码


你可能感兴趣的:(虚拟判题机对接文档)