虚拟判题机对接文档

接口方法列表


抓取题目API

接口定义

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

输入参数

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

返回示例

{
    "data": {
        "description": "<div class=\"panel_content\">\n  Calculate \n <i>A + B</i>. \n <br />\n</div>\n<div class=\"panel_bottom\">\n  &nbsp; \n</div>",
        "hint": "",
        "id": 1,
        "input": "<div class=\"panel_content\">\n  Each line will contain two integers \n <i>A</i> and \n <i>B</i>. Process to end of file. \n <br />\n</div>\n<div class=\"panel_bottom\">\n  &nbsp; \n</div>",
        "languageList": {
            "0": "G++",
            "1": "GCC",
            "2": "C++",
            "3": "C",
            "4": "Pascal",
            "5": "Java",
            "6": "C#"
        },
        "memoryLimit": 32768,
        "output": "<div class=\"panel_content\">\n  For each case, output \n <i>A + B</i> in one line. \n <br />\n</div>\n<div class=\"panel_bottom\">\n  &nbsp; \n</div>",
        "sampleInput": "<div class=\"panel_content\"><pre><div style=\"font-family:Courier New,Courier,monospace;\"> 1 1 </div></pre></div><div class=\"panel_bottom\">\n       &nbsp;\n      </div>",
        "sampleOutput": "<div class=\"panel_content\"><pre><div style=\"font-family:Courier New,Courier,monospace;\"> 2 </div></pre></div><div class=\"panel_bottom\">\n       &nbsp;\n      </div></div></div>",
        "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 int 32 taskId

返回示例

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

返回码

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


posted @ 2020-08-04 12:36  小z同学  阅读(276)  评论(0编辑  收藏  举报