Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,4 @@ coverage

.idea
.codex
.claude
4 changes: 3 additions & 1 deletion apps/backend/apps/admin/src/contest/contest.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import { ContestRole } from '@prisma/client'
import {
AuthenticatedRequest,
UseContestRolesGuard,
UseDisableContestRolesGuard
UseDisableContestRolesGuard,
UseManagerGuard
} from '@libs/auth'
import {
CursorValidationPipe,
Expand Down Expand Up @@ -56,6 +57,7 @@ export class ContestResolver {

@Query(() => [ContestWithParticipants])
@UseDisableContestRolesGuard()
@UseManagerGuard()
async getContests(
@Args(
'take',
Expand Down
10 changes: 3 additions & 7 deletions apps/backend/apps/admin/src/contest/contest.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class ContestService {

/**
* 대회 목록을 조회합니다.
* (SuperAdmin 제외) 자신이 'Admin', 'Manager', 'Reviewer'로 속한 대회만 조회합니다.
* (SuperAdmin 제외) 자신이 'Admin', 'Manager'로 속한 대회만 조회합니다.
*
* @param {number} userId 사용자 ID
* @param {number} take 페이지당 가져올 대회 수
Expand All @@ -44,7 +44,7 @@ export class ContestService {
where: {
userId,
role: {
in: [ContestRole.Admin, ContestRole.Manager, ContestRole.Reviewer]
in: [ContestRole.Admin, ContestRole.Manager]
Comment thread
hjkim24 marked this conversation as resolved.
Comment thread
hjkim24 marked this conversation as resolved.
}
},
select: { contestId: true }
Expand All @@ -71,11 +71,7 @@ export class ContestService {
some: {
userId,
role: {
in: [
ContestRole.Admin,
ContestRole.Manager,
ContestRole.Reviewer
]
in: [ContestRole.Admin, ContestRole.Manager]
}
}
}
Expand Down
95 changes: 91 additions & 4 deletions apps/backend/schema.gql
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ type Contest {
createdById: Int
description: String

"""�� Contest에 포함된 문제의 코드 에디터에서 복사-붙여넣기를 허용합니다."""
""" Contest에 포함된 문제의 코드 에디터에서 복사-붙여넣기를 허용합니다."""
enableCopyPaste: Boolean!
endTime: DateTime!

Expand Down Expand Up @@ -1426,7 +1426,7 @@ type ContestWithParticipants {
createdById: Int
description: String

"""�� Contest에 포함된 문제의 코드 에디터에서 복사-붙여넣기를 허용합니다."""
""" Contest에 포함된 문제의 코드 에디터에서 복사-붙여넣기를 허용합니다."""
enableCopyPaste: Boolean!
endTime: DateTime!

Expand Down Expand Up @@ -1476,7 +1476,7 @@ type ContestWithScores {
createdById: Int
description: String

"""�� Contest에 포함된 문제의 코드 에디터에서 복사-붙여넣기를 허용합니다."""
""" Contest에 포함된 문제의 코드 에디터에서 복사-붙여넣기를 허용합니다."""
enableCopyPaste: Boolean!
endTime: DateTime!

Expand Down Expand Up @@ -2068,11 +2068,13 @@ type FindGroup {
createTime: DateTime!
description: String
groupName: String!
groupTag: [GroupTag!]
Comment thread
hjkim24 marked this conversation as resolved.
Comment thread
hjkim24 marked this conversation as resolved.
groupType: GroupType!
id: ID!
invitation: String
memberNum: Int!
sharedProblems: [Problem!]
studyInfo: StudyInfo
updateTime: DateTime!
userGroup: [UserGroup!]
workbook: [Workbook!]
Expand Down Expand Up @@ -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!]
Expand All @@ -2166,6 +2170,7 @@ type GroupCount {
GroupWhitelist: Int!
assignment: Int!
courseQnA: Int!
groupTag: Int!
sharedProblems: Int!
userGroup: Int!
workbook: Int!
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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!]
Expand Down Expand Up @@ -3897,6 +3981,7 @@ type SubmissionsWithTotal {
type Tag {
_count: TagCount!
createTime: DateTime!
groupTag: [GroupTag!]
id: ID!
name: String!
problemTag: [ProblemTag!]
Expand All @@ -3908,6 +3993,7 @@ type TagAvgAggregate {
}

type TagCount {
groupTag: Int!
problemTag: Int!
}

Expand Down Expand Up @@ -4332,7 +4418,7 @@ type User {
userGroup: [UserGroup!]
userProfile: UserProfile
username: String!
useroauth: UserOAuth
useroauth: [UserOAuth!]
workbook: [Workbook!]
}

Expand Down Expand Up @@ -4462,6 +4548,7 @@ type UserCount {
testSubmission: Int!
userContest: Int!
userGroup: Int!
useroauth: Int!
workbook: Int!
}

Expand Down
30 changes: 15 additions & 15 deletions collection/admin/Contest/Get Contests/Succeed.bru
Original file line number Diff line number Diff line change
Expand Up @@ -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)을 맡은 대회
Comment thread
hjkim24 marked this conversation as resolved.
Comment thread
hjkim24 marked this conversation as resolved.
Comment thread
hjkim24 marked this conversation as resolved.
- **정렬 순서**: 진행 상태(진행 중 > 예정 > 종료), 시작 시간, 종료 시간, 생성 시간 순 정렬

---

### 🔒 Authentication

✅ Required

---

### 📥 Request Variables

| Name | Type | Required | Description |
|---|---|---|---|
| `take` | Int | ❌ | 가져올 개수 (기본값: 10) |
| `cursor` | Int | ❌ | 페이지네이션 커서 |

---

### 📤 Response Body

#### Content-Type: `application/json`

```json
{
"data": {
Expand All @@ -94,7 +94,7 @@ docs {
}
}
```

| Field | Type | Description |
|--------|------|------|
| `id` | Int | 대회 ID |
Expand Down
Loading