-
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.
feat(be): add get-contest-submission-informations api (#1894)
* feat(be): add contest-submission-result model * chore(be): rename contest-submission-result to contest-submission-information * chore(be): set nullability of fields in contest-submission-information * feat(be): add get-contest-submission-informations api * chore(be): rename * test(be): add test * docs(be): add docs * chore(be): rename files and add fields on contest-submission-summary-for-one * feat(be): implement combine score summary and submissions * chore(be): comment test * feat(be): add problem-id option * fix(be): fix wrong type * docs(be): rename files * docs(be): rename file * docs(be): rename files * fix(be): fix ContestSubmissionSummaryForOne model * docs(be): remove resolved todo * chore(be): lint contest.service.spec * fix(be): don't throw error when no submission --------- Co-authored-by: 강민석 <[email protected]> Co-authored-by: jimin9038 <[email protected]>
- Loading branch information
Showing
5 changed files
with
270 additions
and
6 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
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
45 changes: 45 additions & 0 deletions
45
apps/backend/apps/admin/src/contest/model/contest-submission-summary-for-user.model.ts
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,45 @@ | ||
import { Field, Int, ObjectType } from '@nestjs/graphql' | ||
import { Language, ResultStatus } from '@admin/@generated' | ||
import { UserContestScoreSummary } from './score-summary' | ||
|
||
@ObjectType({ description: 'ContestSubmissionSummaryForUser' }) | ||
export class ContestSubmissionSummaryForUser { | ||
@Field(() => UserContestScoreSummary, { nullable: false }) | ||
scoreSummary: UserContestScoreSummary | ||
|
||
@Field(() => [ContestSubmissionSummaryForOne], { nullable: false }) | ||
submissions: ContestSubmissionSummaryForOne[] | ||
} | ||
|
||
/** | ||
* 특정 User의 특정 Contest에 대한 Submission 정보 (!== model SubmissionResult) | ||
*/ | ||
@ObjectType({ description: 'ContestSubmissionSummaryForOne' }) | ||
export class ContestSubmissionSummaryForOne { | ||
@Field(() => Int, { nullable: false }) | ||
contestId: number | ||
|
||
@Field(() => String, { nullable: false }) | ||
problemTitle: string | ||
|
||
@Field(() => String, { nullable: false }) | ||
username: string | ||
|
||
@Field(() => String, { nullable: false }) | ||
studentId: string | ||
|
||
@Field(() => ResultStatus, { nullable: false }) | ||
submissionResult: ResultStatus // Accepted, RuntimeError, ... | ||
|
||
@Field(() => Language, { nullable: false }) | ||
language: Language | ||
|
||
@Field(() => String, { nullable: false }) | ||
submissionTime: Date | ||
|
||
@Field(() => Int, { nullable: true }) | ||
codeSize?: number | ||
|
||
@Field(() => String, { nullable: true }) | ||
ip?: string | ||
} |
48 changes: 48 additions & 0 deletions
48
collection/admin/Contest/Get Contest Submission Summaries of User/Succeed.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,48 @@ | ||
meta { | ||
name: Succeed | ||
type: graphql | ||
seq: 1 | ||
} | ||
|
||
post { | ||
url: {{gqlUrl}} | ||
body: graphql | ||
auth: none | ||
} | ||
|
||
body:graphql { | ||
query getContestSubmissionSummariesByUserId($contestId: Int!, $userId: Int!) { | ||
getContestSubmissionSummaryByUserId(contestId: $contestId, userId: $userId) { | ||
scoreSummary { | ||
contestPerfectScore | ||
problemScores { | ||
problemId | ||
score | ||
} | ||
submittedProblemCount | ||
totalProblemCount | ||
userContestScore | ||
} | ||
submissions { | ||
contestId | ||
problemTitle | ||
studentId | ||
username | ||
submissionResult | ||
language | ||
submissionTime | ||
codeSize | ||
ip | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
body:graphql:vars { | ||
{ | ||
"contestId": 1, | ||
"userId": 4 | ||
// "problemId": 1 | ||
} | ||
} |