-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(be): re-write admin problem module api docs (#1296)
* docs(be): re-write admin problem module api docs * fix(be): add missing await - prisma 접근 코드에 await 처리 안되어있는 부분 수정 - docs 에러코드 작성 * docs(be): modify assert option * docs(be): delete args table - 새롭게 정해진 convention에 따라 args를 설명하는 표 삭제 * docs(be): modify assert * fix(be): apply http error * docs(be): modify api docs Co-authored-by: cho-to <[email protected]> Co-authored-by: SH9480P <[email protected]>
- Loading branch information
1 parent
8dc036f
commit ff258d3
Showing
24 changed files
with
728 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
meta { | ||
name: Succeed | ||
type: graphql | ||
seq: 1 | ||
} | ||
|
||
post { | ||
url: {{gqlUrl}} | ||
body: graphql | ||
auth: none | ||
} | ||
|
||
body:graphql { | ||
mutation CreateProblem($groupId: Int!, $input: CreateProblemInput!) { | ||
createProblem(groupId: $groupId, input: $input) { | ||
id | ||
createdById | ||
groupId | ||
title | ||
description | ||
inputDescription | ||
outputDescription | ||
hint | ||
} | ||
} | ||
} | ||
|
||
body:graphql:vars { | ||
{ | ||
"groupId": 1, | ||
"input": { | ||
"title": "createdProblem", | ||
"description": "description", | ||
"inputDescription": "input description", | ||
"outputDescription": "output description", | ||
"hint": "hint", | ||
"template": { | ||
"language": "Cpp", | ||
"code": [ | ||
{ | ||
"id": 1, | ||
"text": "int main() {}", | ||
"locked": false | ||
} | ||
] | ||
}, | ||
"languages": ["Cpp"], | ||
"timeLimit": 0, | ||
"memoryLimit": 0, | ||
"difficulty": "Level2", | ||
"source": "source", | ||
"inputExamples": [], | ||
"outputExamples": [], | ||
"testcases": [ | ||
{ | ||
"input": "input", | ||
"output": "output" | ||
} | ||
], | ||
"tagIds": [1] | ||
} | ||
} | ||
} | ||
|
||
assert { | ||
res.body.data.createProblem: isDefined | ||
} | ||
|
||
docs { | ||
## Create Problem | ||
Problem을 생성합니다. | ||
|
||
### Error Cases | ||
#### UNPROCESSABLE(1) | ||
Problem은 최소 1개 이상의 프로그래밍 언어를 지원해야 합니다. | ||
#### UNPROCESSABLE(2) | ||
Problem은 Template에 존재하는 프로그래밍 언어를 지원해야 합니다. | ||
} |
68 changes: 68 additions & 0 deletions
68
collection/admin/Problem/Create Problem/UNPROCESSABLE (1).bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
meta { | ||
name: UNPROCESSABLE (1) | ||
type: graphql | ||
seq: 2 | ||
} | ||
|
||
post { | ||
url: {{gqlUrl}} | ||
body: graphql | ||
auth: none | ||
} | ||
|
||
body:graphql { | ||
mutation CreateProblem($groupId: Int!, $input: CreateProblemInput!) { | ||
createProblem(groupId: $groupId, input: $input) { | ||
id | ||
createdById | ||
groupId | ||
title | ||
description | ||
inputDescription | ||
outputDescription | ||
hint | ||
} | ||
} | ||
} | ||
|
||
body:graphql:vars { | ||
{ | ||
"groupId": 1, | ||
"input": { | ||
"title": "createdProblem", | ||
"description": "description", | ||
"inputDescription": "input description", | ||
"outputDescription": "output description", | ||
"hint": "hint", | ||
"template": { | ||
"language": "Cpp", | ||
"code": [ | ||
{ | ||
"id": 1, | ||
"text": "int main() {}", | ||
"locked": false | ||
} | ||
] | ||
}, | ||
"languages": [], | ||
"timeLimit": 0, | ||
"memoryLimit": 0, | ||
"difficulty": "Level2", | ||
"source": "source", | ||
"inputExamples": [], | ||
"outputExamples": [], | ||
"testcases": [ | ||
{ | ||
"input": "input", | ||
"output": "output" | ||
} | ||
], | ||
"tagIds": [1] | ||
} | ||
} | ||
} | ||
|
||
assert { | ||
res.body.errors[0].extensions.code: eq UNPROCESSABLE | ||
res.body.errors[0].message: eq A problem should support at least one language | ||
} |
68 changes: 68 additions & 0 deletions
68
collection/admin/Problem/Create Problem/UNPROCESSABLE (2).bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
meta { | ||
name: UNPROCESSABLE (2) | ||
type: graphql | ||
seq: 3 | ||
} | ||
|
||
post { | ||
url: {{gqlUrl}} | ||
body: graphql | ||
auth: none | ||
} | ||
|
||
body:graphql { | ||
mutation CreateProblem($groupId: Int!, $input: CreateProblemInput!) { | ||
createProblem(groupId: $groupId, input: $input) { | ||
id | ||
createdById | ||
groupId | ||
title | ||
description | ||
inputDescription | ||
outputDescription | ||
hint | ||
} | ||
} | ||
} | ||
|
||
body:graphql:vars { | ||
{ | ||
"groupId": 1, | ||
"input": { | ||
"title": "createdProblem", | ||
"description": "description", | ||
"inputDescription": "input description", | ||
"outputDescription": "output description", | ||
"hint": "hint", | ||
"template": { | ||
"language": "Cpp", | ||
"code": [ | ||
{ | ||
"id": 1, | ||
"text": "int main() {}", | ||
"locked": false | ||
} | ||
] | ||
}, | ||
"languages": ["Python3"], | ||
"timeLimit": 0, | ||
"memoryLimit": 0, | ||
"difficulty": "Level2", | ||
"source": "source", | ||
"inputExamples": [], | ||
"outputExamples": [], | ||
"testcases": [ | ||
{ | ||
"input": "input", | ||
"output": "output" | ||
} | ||
], | ||
"tagIds": [1] | ||
} | ||
} | ||
} | ||
|
||
assert { | ||
res.body.errors[0].extensions.code: eq UNPROCESSABLE | ||
res.body.errors[0].message: eq This problem does not support Cpp | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
meta { | ||
name: NOT_FOUND | ||
type: graphql | ||
seq: 2 | ||
} | ||
|
||
post { | ||
url: {{gqlUrl}} | ||
body: graphql | ||
auth: none | ||
} | ||
|
||
body:graphql { | ||
mutation DeleteProblem($groupId: Int!, $id: Int!) { | ||
deleteProblem(groupId: $groupId, id: $id) { | ||
id | ||
createdById | ||
groupId | ||
title | ||
description | ||
inputDescription | ||
outputDescription | ||
hint | ||
} | ||
} | ||
} | ||
|
||
body:graphql:vars { | ||
{ | ||
"groupId": 99999, | ||
"id": 5 | ||
} | ||
} | ||
|
||
assert { | ||
res.body.errors[0].extensions.code: eq NOT_FOUND | ||
res.body.errors[0].message: eq No Problem found | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.