跳到主要内容

v1/problem.proto (version not set)

Download OpenAPI specification:Download

ProblemService

下载题目

Request Body schema: application/json
ids
Array of integers <int32> [ items <int32 > ]

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ]
}

Response samples

Content type
application/json
{
  • "url": "string"
}

运行题目文件

path Parameters
sid
required
integer <int32>
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{ }

题目列表

query Parameters
id
integer <int32>
keyword
string
author
string
Default: "ALL"
Enum: "ALL" "ONLYME"
username
string
status
Array of integers <int32> [ items <int32 > ]
type
Array of integers <int32> [ items <int32 > ]
filter
string
orderBy
string
page
integer <int32>
perPage
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "total": "string"
}

创建题目

Request Body schema: application/json
name
string (题目名称)
type
string (题目类型:标准输入输出、函数题、客观题)
Default: "DEFAULT"
Enum: "DEFAULT" "FUNCTION" "OBJECTIVE"

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "type": "DEFAULT"
}

Response samples

Content type
application/json
{
  • "id": 0
}

获取题目描述详情

path Parameters
id_1
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "problemId": 0,
  • "language": "string",
  • "name": "string",
  • "legend": "string",
  • "input": "string",
  • "output": "string",
  • "note": "string",
  • "type": "CODE"
}

获取题目测试点详情

path Parameters
id_1
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "order": 0,
  • "problemId": 0,
  • "isExample": true,
  • "isTestPoint": true,
  • "name": "string",
  • "inputSize": "string",
  • "inputPreview": "string",
  • "inputFileContent": "string",
  • "outputSize": "string",
  • "outputPreview": "string",
  • "outputFileContent": "string",
  • "remark": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

题目详情

path Parameters
id
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "type": "DEFAULT",
  • "timeLimit": 0,
  • "memoryLimit": 0,
  • "statements": [
    ],
  • "acceptedCount": 0,
  • "submitCount": 0,
  • "status": 0,
  • "checkerId": 0,
  • "source": "string",
  • "tags": [
    ],
  • "userId": 0,
  • "nickname": "string",
  • "allowDownload": true,
  • "sampleTests": [
    ],
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

修改题目

path Parameters
id
required
integer <int32>
Request Body schema: application/json
name
string
timeLimit
string <int64>
memoryLimit
string <int64>
status
integer <int32>
source
string
tags
Array of strings

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "timeLimit": "string",
  • "memoryLimit": "string",
  • "status": 0,
  • "source": "string",
  • "tags": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "type": "DEFAULT",
  • "timeLimit": 0,
  • "memoryLimit": 0,
  • "statements": [
    ],
  • "acceptedCount": 0,
  • "submitCount": 0,
  • "status": 0,
  • "checkerId": 0,
  • "source": "string",
  • "tags": [
    ],
  • "userId": 0,
  • "nickname": "string",
  • "allowDownload": true,
  • "sampleTests": [
    ],
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

设置裁判程序

path Parameters
id
required
integer <int32>
Request Body schema: application/json
checkerId
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "checkerId": 0
}

Response samples

Content type
application/json
{ }

获取题目文件列表

path Parameters
id
required
integer <int32>
query Parameters
fileType
string
type
string
name
string
page
integer <int32>
perPage
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "total": "string"
}

创建题目文件

path Parameters
id
required
integer <int32>
Request Body schema: application/json
name
string
language
integer <int32>
content
string
type
string
fileType
string
filename
string
fileContent
string <byte>

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "language": 0,
  • "content": "string",
  • "type": "string",
  • "fileType": "string",
  • "filename": "string",
  • "fileContent": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "language": 0,
  • "content": "string",
  • "type": "string",
  • "userId": 0,
  • "fileType": "string",
  • "fileSize": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

获取题目文件详情

path Parameters
id
required
integer <int32>
sid
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "language": 0,
  • "content": "string",
  • "type": "string",
  • "userId": 0,
  • "fileType": "string",
  • "fileSize": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

删除题目文件

path Parameters
id
required
integer <int32>
sid
required
integer <int32>

Responses

Response samples

Content type
application/json
{ }

更新题目文件

path Parameters
id
required
integer <int32>
sid
required
integer <int32>
Request Body schema: application/json
name
string
content
string
type
string

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "content": "string",
  • "type": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "language": 0,
  • "content": "string",
  • "type": "string",
  • "userId": 0,
  • "fileType": "string",
  • "fileSize": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

打包题目

path Parameters
id
required
integer <int32>
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{ }

获取题目描述列表

path Parameters
id
required
integer <int32>
query Parameters
page
integer <int32>
perPage
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "total": "string"
}

创建题目描述

path Parameters
id
required
integer <int32>
Request Body schema: application/json
language
string

Responses

Request samples

Content type
application/json
{
  • "language": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "problemId": 0,
  • "language": "string",
  • "name": "string",
  • "legend": "string",
  • "input": "string",
  • "output": "string",
  • "note": "string",
  • "type": "CODE"
}

删除题目描述

path Parameters
id
required
integer <int32>
sid
required
integer <int32>

Responses

Response samples

Content type
application/json
{ }

更新题目描述

path Parameters
id
required
integer <int32>
sid
required
integer <int32>
Request Body schema: application/json
language
string
name
string
input
string
output
string
note
string
legend
string
type
string (v1ProblemStatementType)
Default: "CODE"
Enum: "CODE" "CHOICE" "MULTIPLE" "FILLBLANK"

Responses

Request samples

Content type
application/json
{
  • "language": "string",
  • "name": "string",
  • "input": "string",
  • "output": "string",
  • "note": "string",
  • "legend": "string",
  • "type": "CODE"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "problemId": 0,
  • "language": "string",
  • "name": "string",
  • "legend": "string",
  • "input": "string",
  • "output": "string",
  • "note": "string",
  • "type": "CODE"
}

获取std裁判程序

path Parameters
id
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

删除题目测试点

path Parameters
id
required
integer <int32>
query Parameters
testIds
Array of integers <int32> [ items <int32 > ]

Responses

Response samples

Content type
application/json
{ }

对题目测试点进行排序

path Parameters
id
required
integer <int32>
Request Body schema: application/json
setSampleFirst
boolean
sortByName
boolean
ids
Array of integers <int32> [ items <int32 > ]

Responses

Request samples

Content type
application/json
{
  • "setSampleFirst": true,
  • "sortByName": true,
  • "ids": [
    ]
}

Response samples

Content type
application/json
{ }

获取题目测试点列表

path Parameters
id
required
integer <int32>
query Parameters
page
integer <int32>
perPage
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "total": "string",
  • "isSampleFirst": true
}

创建题目测试点

path Parameters
id
required
integer <int32>
Request Body schema: application/json
fileContent
string <byte>
filename
string

Responses

Request samples

Content type
application/json
{
  • "fileContent": "string",
  • "filename": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "order": 0,
  • "problemId": 0,
  • "isExample": true,
  • "isTestPoint": true,
  • "name": "string",
  • "inputSize": "string",
  • "inputPreview": "string",
  • "inputFileContent": "string",
  • "outputSize": "string",
  • "outputPreview": "string",
  • "outputFileContent": "string",
  • "remark": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

更新题目测试点

path Parameters
id
required
integer <int32>
tid
required
integer <int32>
Request Body schema: application/json
isExample
boolean
isTestPoint
boolean
remark
string

Responses

Request samples

Content type
application/json
{
  • "isExample": true,
  • "isTestPoint": true,
  • "remark": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "order": 0,
  • "problemId": 0,
  • "isExample": true,
  • "isTestPoint": true,
  • "name": "string",
  • "inputSize": "string",
  • "inputPreview": "string",
  • "inputFileContent": "string",
  • "outputSize": "string",
  • "outputPreview": "string",
  • "outputFileContent": "string",
  • "remark": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

获取题目验证状态

path Parameters
id
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "problemId": 0,
  • "verificationStatus": 0,
  • "verificaitonInfo": [
    ]
}

验证题目完整性

path Parameters
id
required
integer <int32>
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{ }

语言列表

path Parameters
problemId
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "total": "string"
}

创建语言文件

path Parameters
problemId
required
integer <int32>
Request Body schema: application/json
userContent
string
mainContent
string
language
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "userContent": "string",
  • "mainContent": "string",
  • "language": 0
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "languageCode": 0,
  • "languageName": "string",
  • "userContent": "string",
  • "mainContent": "string"
}

语言文件详情

path Parameters
problemId
required
integer <int32>
id
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "languageCode": 0,
  • "languageName": "string",
  • "userContent": "string",
  • "mainContent": "string"
}

删除语言文件

path Parameters
problemId
required
integer <int32>
id
required
integer <int32>

Responses

Response samples

Content type
application/json
{ }

修改语言文件

path Parameters
problemId
required
integer <int32>
id
required
integer <int32>
Request Body schema: application/json
userContent
string
mainContent
string

Responses

Request samples

Content type
application/json
{
  • "userContent": "string",
  • "mainContent": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "languageCode": 0,
  • "languageName": "string",
  • "userContent": "string",
  • "mainContent": "string"
}

题单列表

query Parameters
name
string
type
Array of strings
Items Enum: "SIMPLE" "EXAM"
page
integer <int32>
perPage
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "total": "string"
}

创建题单

Request Body schema: application/json
name
string
description
string
type
string (v1ProblemsetType)
Default: "SIMPLE"
Enum: "SIMPLE" "EXAM"

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "type": "SIMPLE"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "type": "SIMPLE",
  • "user": {
    },
  • "description": "string",
  • "membership": "ALLOW_ANYONE",
  • "invitationCode": "string",
  • "problemCount": 0,
  • "memberCount": 0,
  • "role": "GUEST",
  • "problems": [
    ],
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

获取题单

path Parameters
id
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "type": "SIMPLE",
  • "user": {
    },
  • "description": "string",
  • "membership": "ALLOW_ANYONE",
  • "invitationCode": "string",
  • "problemCount": 0,
  • "memberCount": 0,
  • "role": "GUEST",
  • "problems": [
    ],
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

删除题单

path Parameters
id
required
integer <int32>

Responses

Response samples

Content type
application/json
{ }

修改题单

path Parameters
id
required
integer <int32>
Request Body schema: application/json
name
string
description
string
membership
string (v1ProblemsetMembership)
Default: "ALLOW_ANYONE"
Enum: "ALLOW_ANYONE" "INVITATION_CODE"
invitationCode
string

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "membership": "ALLOW_ANYONE",
  • "invitationCode": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "type": "SIMPLE",
  • "user": {
    },
  • "description": "string",
  • "membership": "ALLOW_ANYONE",
  • "invitationCode": "string",
  • "problemCount": 0,
  • "memberCount": 0,
  • "role": "GUEST",
  • "problems": [
    ],
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

获取题单回答列表

path Parameters
id
required
integer <int32>
query Parameters
userId
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "total": 0
}

创建新的题单回答

path Parameters
id
required
integer <int32>
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "id": 0,
  • "problemsetId": 0,
  • "userId": 0,
  • "answer": "string",
  • "answeredProblemIds": "string",
  • "unansweredProblemIds": "string",
  • "correctProblemIds": "string",
  • "wrongProblemIds": "string",
  • "submissionIds": "string",
  • "submissions": [
    ],
  • "submittedAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z"
}

获取题单回答

path Parameters
id
required
integer <int32>
answerId
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "problemsetId": 0,
  • "userId": 0,
  • "answer": "string",
  • "answeredProblemIds": "string",
  • "unansweredProblemIds": "string",
  • "correctProblemIds": "string",
  • "wrongProblemIds": "string",
  • "submissionIds": "string",
  • "submissions": [
    ],
  • "submittedAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z"
}

修改题单回答

path Parameters
id
required
integer <int32>
answerId
required
integer <int32>
Request Body schema: application/json
answer
string
submittedAt
string <date-time>

Responses

Request samples

Content type
application/json
{
  • "answer": "string",
  • "submittedAt": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{ }

批量创建题单

path Parameters
id
required
integer <int32>
Request Body schema: application/json
problemIds
Array of integers <int32> [ items <int32 > ]
Array of objects (v1ProblemsetProblem)

Responses

Request samples

Content type
application/json
{
  • "problemIds": [
    ],
  • "problems": [
    ]
}

Response samples

Content type
application/json
{
  • "failedReason": [
    ]
}

上传Excel,预览批量添加题目到题单的结果

path Parameters
id
required
integer <int32>
Request Body schema: application/json
method
string (BatchAddProblemToProblemsetPreviewRequestMethod)
Default: "EXCEL"
Value: "EXCEL"
content
string

Responses

Request samples

Content type
application/json
{
  • "method": "EXCEL",
  • "content": "string"
}

Response samples

Content type
application/json
{
  • "problems": [
    ],
  • "total": 0,
  • "failedReason": [
    ]
}

对题单的题目进行排序

path Parameters
id
required
integer <int32>
Request Body schema: application/json
Array of objects (SortProblemsetProblemsRequestProblemsetProblems)
Array
order
integer <int32>
id
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ]
}

Response samples

Content type
application/json
{ }

获取题单的题目

path Parameters
id
required
integer <int32>
query Parameters
keyword
string
page
integer <int32>
perPage
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "total": "string"
}

添加题目到题单

path Parameters
id
required
integer <int32>
Request Body schema: application/json
problemId
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "problemId": 0
}

Response samples

Content type
application/json
{ }

获取题单的题目

path Parameters
id
required
integer <int32>
pid
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "type": "DEFAULT",
  • "timeLimit": 0,
  • "memoryLimit": 0,
  • "statements": [
    ],
  • "acceptedCount": 0,
  • "submitCount": 0,
  • "status": 0,
  • "checkerId": 0,
  • "source": "string",
  • "tags": [
    ],
  • "userId": 0,
  • "nickname": "string",
  • "allowDownload": true,
  • "sampleTests": [
    ],
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

获取旁边的题目,上一题、下一题

path Parameters
id
required
integer <int32>
pid
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "previous": 0,
  • "next": 0
}

从题单中删除题目

path Parameters
id
required
integer <int32>
problemId
required
integer <int32>

Responses

Response samples

Content type
application/json
{ }

获取题单的用户

path Parameters
id
required
integer <int32>
query Parameters
page
integer <int32>
perPage
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "total": 0
}

添加用户到题单

path Parameters
id
required
integer <int32>
Request Body schema: application/json
username
string
invitationCode
string

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "invitationCode": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "userId": 0,
  • "userNickname": "string",
  • "userAvatar": "string",
  • "acceptedCount": 0,
  • "createdAt": "2019-08-24T14:15:22Z"
}

删除题单用户

path Parameters
id
required
integer <int32>
userId
required
integer <int32>

Responses

Response samples

Content type
application/json
{ }