diff --git a/.gitignore b/.gitignore index 6070dd1d80..bb5a3fcf2a 100644 --- a/.gitignore +++ b/.gitignore @@ -149,3 +149,4 @@ coverage .idea .codex +.claude diff --git a/apps/backend/apps/admin/src/contest/contest.resolver.ts b/apps/backend/apps/admin/src/contest/contest.resolver.ts index bfd78e510e..f88eb2de95 100644 --- a/apps/backend/apps/admin/src/contest/contest.resolver.ts +++ b/apps/backend/apps/admin/src/contest/contest.resolver.ts @@ -20,7 +20,8 @@ import { ContestRole } from '@prisma/client' import { AuthenticatedRequest, UseContestRolesGuard, - UseDisableContestRolesGuard + UseDisableContestRolesGuard, + UseManagerGuard } from '@libs/auth' import { CursorValidationPipe, @@ -56,6 +57,7 @@ export class ContestResolver { @Query(() => [ContestWithParticipants]) @UseDisableContestRolesGuard() + @UseManagerGuard() async getContests( @Args( 'take', diff --git a/apps/backend/apps/admin/src/contest/contest.service.ts b/apps/backend/apps/admin/src/contest/contest.service.ts index cda1434aee..02dcb424d8 100644 --- a/apps/backend/apps/admin/src/contest/contest.service.ts +++ b/apps/backend/apps/admin/src/contest/contest.service.ts @@ -27,7 +27,7 @@ export class ContestService { /** * 대회 목록을 조회합니다. - * (SuperAdmin 제외) 자신이 'Admin', 'Manager', 'Reviewer'로 속한 대회만 조회합니다. + * (SuperAdmin 제외) 자신이 'Admin', 'Manager'로 속한 대회만 조회합니다. * * @param {number} userId 사용자 ID * @param {number} take 페이지당 가져올 대회 수 @@ -44,7 +44,7 @@ export class ContestService { where: { userId, role: { - in: [ContestRole.Admin, ContestRole.Manager, ContestRole.Reviewer] + in: [ContestRole.Admin, ContestRole.Manager] } }, select: { contestId: true } @@ -71,11 +71,7 @@ export class ContestService { some: { userId, role: { - in: [ - ContestRole.Admin, - ContestRole.Manager, - ContestRole.Reviewer - ] + in: [ContestRole.Admin, ContestRole.Manager] } } } diff --git a/apps/backend/schema.gql b/apps/backend/schema.gql index 56fde73310..7857a46712 100644 --- a/apps/backend/schema.gql +++ b/apps/backend/schema.gql @@ -779,7 +779,7 @@ type Contest { createdById: Int description: String - """�� Contest에 포함된 문제의 코드 에디터에서 복사-붙여넣기를 허용합니다.""" + """이 Contest에 포함된 문제의 코드 에디터에서 복사-붙여넣기를 허용합니다.""" enableCopyPaste: Boolean! endTime: DateTime! @@ -1426,7 +1426,7 @@ type ContestWithParticipants { createdById: Int description: String - """�� Contest에 포함된 문제의 코드 에디터에서 복사-붙여넣기를 허용합니다.""" + """이 Contest에 포함된 문제의 코드 에디터에서 복사-붙여넣기를 허용합니다.""" enableCopyPaste: Boolean! endTime: DateTime! @@ -1476,7 +1476,7 @@ type ContestWithScores { createdById: Int description: String - """�� Contest에 포함된 문제의 코드 에디터에서 복사-붙여넣기를 허용합니다.""" + """이 Contest에 포함된 문제의 코드 에디터에서 복사-붙여넣기를 허용합니다.""" enableCopyPaste: Boolean! endTime: DateTime! @@ -2068,11 +2068,13 @@ type FindGroup { createTime: DateTime! description: String groupName: String! + groupTag: [GroupTag!] groupType: GroupType! id: ID! invitation: String memberNum: Int! sharedProblems: [Problem!] + studyInfo: StudyInfo updateTime: DateTime! userGroup: [UserGroup!] workbook: [Workbook!] @@ -2149,9 +2151,11 @@ type Group { createTime: DateTime! description: String groupName: String! + groupTag: [GroupTag!] groupType: GroupType! id: ID! sharedProblems: [Problem!] + studyInfo: StudyInfo updateTime: DateTime! userGroup: [UserGroup!] workbook: [Workbook!] @@ -2166,6 +2170,7 @@ type GroupCount { GroupWhitelist: Int! assignment: Int! courseQnA: Int! + groupTag: Int! sharedProblems: Int! userGroup: Int! workbook: Int! @@ -2215,6 +2220,45 @@ type GroupSumAggregate { id: Int } +type GroupTag { + group: Group! + groupId: Int! + id: ID! + tag: Tag! + tagId: Int! +} + +type GroupTagAvgAggregate { + groupId: Float + id: Float + tagId: Float +} + +type GroupTagCountAggregate { + _all: Int! + groupId: Int! + id: Int! + tagId: Int! +} + +type GroupTagMaxAggregate { + groupId: Int + id: Int + tagId: Int +} + +type GroupTagMinAggregate { + groupId: Int + id: Int + tagId: Int +} + +type GroupTagSumAggregate { + groupId: Int + id: Int + tagId: Int +} + enum GroupType { Course Study @@ -3621,6 +3665,46 @@ input Solution { language: Language! } +type StudyInfo { + capacity: Int! + endTime: DateTime! + group: Group! + groupId: ID! + invitationCode: String +} + +type StudyInfoAvgAggregate { + capacity: Float + groupId: Float +} + +type StudyInfoCountAggregate { + _all: Int! + capacity: Int! + endTime: Int! + groupId: Int! + invitationCode: Int! +} + +type StudyInfoMaxAggregate { + capacity: Int + endTime: DateTime + groupId: Int + invitationCode: String +} + +type StudyInfoMinAggregate { + capacity: Int + endTime: DateTime + groupId: Int + invitationCode: String +} + +type StudyInfoSumAggregate { + capacity: Int + groupId: Int +} + type Submission { FirstCheckResult: [CheckResult!] SecondCheckResult: [CheckResult!] @@ -3897,6 +3981,7 @@ type SubmissionsWithTotal { type Tag { _count: TagCount! createTime: DateTime! + groupTag: [GroupTag!] id: ID! name: String! problemTag: [ProblemTag!] @@ -3908,6 +3993,7 @@ type TagAvgAggregate { } type TagCount { + groupTag: Int! problemTag: Int! } @@ -4332,7 +4418,7 @@ type User { userGroup: [UserGroup!] userProfile: UserProfile username: String! - useroauth: UserOAuth + useroauth: [UserOAuth!] workbook: [Workbook!] } @@ -4462,6 +4548,7 @@ type UserCount { testSubmission: Int! userContest: Int! userGroup: Int! + useroauth: Int! workbook: Int! } diff --git a/collection/admin/Contest/Get Contests/Succeed.bru b/collection/admin/Contest/Get Contests/Succeed.bru index 978175982e..986c93c4ea 100644 --- a/collection/admin/Contest/Get Contests/Succeed.bru +++ b/collection/admin/Contest/Get Contests/Succeed.bru @@ -43,38 +43,38 @@ script:pre-request { docs { # 📘 Get Contests - + **POST** `/graphql (query: getContests)` - + Retrieves a paginated list of contests accessible to the user. - + 사용자가 접근할 수 있는 대회의 목록을 페이지네이션하여 조회합니다. - + - **SuperAdmin**: 모든 대회 - **Admin/Manager/Reviewer**: 자신이 역할(Admin, Manager, Reviewer)을 맡은 대회 - **정렬 순서**: 진행 상태(진행 중 > 예정 > 종료), 시작 시간, 종료 시간, 생성 시간 순 정렬 - + --- - + ### 🔒 Authentication - + ✅ Required - + --- - + ### 📥 Request Variables - + | Name | Type | Required | Description | |---|---|---|---| | `take` | Int | ❌ | 가져올 개수 (기본값: 10) | | `cursor` | Int | ❌ | 페이지네이션 커서 | - + --- - + ### 📤 Response Body - + #### Content-Type: `application/json` - + ```json { "data": { @@ -94,7 +94,7 @@ docs { } } ``` - + | Field | Type | Description | |--------|------|------| | `id` | Int | 대회 ID |