Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(be): add docs for contest overall apis #2052

Merged
merged 1 commit into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 13 additions & 20 deletions apps/backend/apps/admin/src/contest/contest.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ import { DuplicatedContestResponse } from './model/duplicated-contest-response.o
import { ProblemScoreInput } from './model/problem-score.input'
import { PublicizingRequest } from './model/publicizing-request.model'
import { PublicizingResponse } from './model/publicizing-response.output'
import {
UserContestScoreSummary,
UserContestScoreSummaryWithUserInfo
} from './model/score-summary'
import { UserContestScoreSummaryWithUserInfo } from './model/score-summary'

@Resolver(() => Contest)
export class ContestResolver {
Expand Down Expand Up @@ -233,6 +230,12 @@ export class ContestResolver {
}
}

/**
* 특정 User의 Contest 제출 내용 요약 정보를 가져옵니다.
*
* Contest Overall 페이지에서 특정 유저를 선택했을 때 사용
* https://github.com/skkuding/codedang/pull/1894
*/
@Query(() => ContestSubmissionSummaryForUser)
async getContestSubmissionSummaryByUserId(
@Args('contestId', { type: () => Int }, IDValidationPipe) contestId: number,
Expand Down Expand Up @@ -287,22 +290,12 @@ export class ContestResolver {
}
}

@Query(() => UserContestScoreSummary)
async getContestScoreSummary(
@Args('userId', { type: () => Int }) userId: number,
@Args('contestId', { type: () => Int }) contestId: number
) {
try {
return await this.contestService.getContestScoreSummary(userId, contestId)
} catch (error) {
if (error instanceof EntityNotExistException) {
throw error.convert2HTTPException()
}
this.logger.error(error)
throw new InternalServerErrorException()
}
}

/**
* Contest에 참여한 User와, 점수 요약을 함께 불러옵니다.
*
* Contest Overall 페이지의 Participants 탭의 정보
* https://github.com/skkuding/codedang/pull/2029
*/
@Query(() => [UserContestScoreSummaryWithUserInfo])
async getContestScoreSummaries(
@Args('take', { type: () => Int, defaultValue: 10 }) take: number,
Expand Down
6 changes: 6 additions & 0 deletions apps/backend/apps/admin/src/submission/submission.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ export class SubmissionResolver {
private readonly logger = new Logger(SubmissionResolver.name)
constructor(private readonly submissionService: SubmissionService) {}

/**
* 특정 Contest의 모든 제출 내역에 대한 요약을 불러옵니다.
*
* Contest Overall page의 'All submission' 탭에서 보여지는 정보를 불러오는 API
* https://github.com/skkuding/codedang/pull/1924
*/
@Query(() => [ContestSubmission])
async getContestSubmissions(
@Args('input', {
Expand Down
65 changes: 0 additions & 65 deletions collection/admin/Contest/Get Contest Score Summaries /Succeed.bru

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ body:graphql {
}
}
}

}

body:graphql:vars {
Expand All @@ -39,7 +39,10 @@ body:graphql:vars {
docs {
## Get Contest Score Summary of User
유저의 특정 Contest에 대한 점수 요약을 반환합니다.


Contest Overall 페이지에서 특정 유저를 선택했을 때 사용
https://github.com/skkuding/codedang/pull/1894

- submittedProblemCount
- 제출된 문제의 개수(정답 여부와 관계 없음)
- totalProblemCount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,11 @@ body:graphql:vars {
// "problemId": 1
}
}

docs {
## Get Contest Submission Summaries of Users

* Contest에 참여한 User와, 점수 요약을 함께 불러옵니다.
* Contest Overall 페이지의 Participants 탭의 정보
* https://github.com/skkuding/codedang/pull/2029
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ docs {
## Get Contest Submissions

- Contest Overall 페이지 중 All Submissions 탭에서 표시할 데이터를 반환합니다.
- https://github.com/skkuding/codedang/pull/1924

#### 필요 인자
|`input`|`take`|`cursor`|
Expand Down
Loading