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

아레나 업데이트 반영 #63

Closed
wants to merge 7 commits into from
Closed
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
12 changes: 12 additions & 0 deletions src/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ servers:
tags:
- name: "account"
description: "계정과 관련이 있는 API입니다"
- name: "arena"
description: "아레나와 관련이 있는 API입니다"
- name: "badge"
description: "뱃지와 관련이 있는 API입니다"
- name: "background"
Expand All @@ -50,6 +52,8 @@ paths:
$ref: "./paths/account/update_settings.yaml#/paths/Path"
/account/verify_credentials:
$ref: "./paths/account/verify_credentials.yaml#/paths/Path"
/arena/contests:
$ref: "./paths/arena/contests.yaml#/paths/Path"
/background/show:
$ref: "./paths/background/show.yaml#/paths/Path"
/badge/show:
Expand All @@ -72,6 +76,8 @@ paths:
$ref: "./paths/problem/show.yaml#/paths/Path"
/problem/level:
$ref: "./paths/problem/level.yaml#/paths/Path"
/ranking/arena:
$ref: "./paths/ranking/arena.yaml#/paths/Path"
/ranking/tier:
$ref: "./paths/ranking/tier.yaml#/paths/Path"
/ranking/class:
Expand Down Expand Up @@ -108,6 +114,8 @@ paths:
responses:
"200":
description: "TODO"
/user/contests:
$ref: "./paths/user/contests.yaml#/paths/Path"
/user/contribution_stats:
get:
description: "TODO"
Expand All @@ -134,6 +142,10 @@ components:
solvedacToken:
$ref: "./security-schemes/auth.yaml#/components/securitySchemes/SecurityScheme"
schemas:
Arena:
$ref: "./schemas/arena.yaml#/components/schemas/Arena"
ArenaTier:
$ref: "./schemas/arena-tier.yaml#/components/schemas/ArenaTier"
ClassDecoration:
$ref: "./schemas/class-decoration.yaml#/components/schemas/ClassDecoration"
CoinshopProduct:
Expand Down
25 changes: 25 additions & 0 deletions src/paths/arena/contests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# yaml-language-server: $schema=https://spec.openapis.org/oas/3.1/schema/2021-05-20
---
# for the intellisense
openapi: "3.1.0"
info: { title: "", version: "" }

paths:
Path:
get:
summary: 아레나 목록 가져오기
description: 아레나 목록을 가져옵니다.
tags:
- arena
operationId: getContests

responses:
"200":
description: "서버가 반환에 성공한 경우입니다."
content:
application/json:
schema:
description: "문제 목록입니다."
type: "array"
items:
$ref: "../../schemas/arena.yaml#/components/schemas/Arena"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 API 응답에서는 isRegistered 필드가 존재해요. 추가해주세요.

40 changes: 40 additions & 0 deletions src/paths/ranking/arena.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# yaml-language-server: $schema=https://spec.openapis.org/oas/3.1/schema/2021-05-20
---
# for the intellisense
openapi: "3.1.0"
info: { title: "", version: "" }

paths:
Path:
get:
summary: "아레나 순위 가져오기"
description: "아레나에 따른 순위를 가져옵니다."
tags:
- ranking
operationId: getRankingByArena

parameters:
- name: "page"
in: "query"
description: "페이지"
schema:
type: "number"

responses:
"200":
description: "서버가 반환에 성공한 경우입니다."
content:
application/json:
schema:
type: "object"
properties:
count:
description: "순위가 배정된 사용자의 수입니다."
type: "integer"
format: "int64"
example: 40266
items:
description: "아레나 순위로 정렬된 사용자 목록입니다."
type: "array"
items:
$ref: "../../schemas/user.yaml#/components/schemas/User"
68 changes: 68 additions & 0 deletions src/paths/user/contests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# yaml-language-server: $schema=https://spec.openapis.org/oas/3.1/schema/2021-05-20
---
# for the intellisense
openapi: "3.1.0"
info: { title: "", version: "" }

paths:
Path:
get:
summary: 아레나 목록 가져오기
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
summary: 아레나 목록 가져오기
summary: 사용자가 참여한 아레나 목록 가져오기

summary가 다른 API route와 중복되지 않는 게 살펴보기에 좋을 것 같아요.

description: 아레나 목록을 가져옵니다.
tags:
- arena
operationId: getUserContests

parameters:
- name: "handle"
in: "query"
description: "사용자 ID"
required: true
schema:
type: "string"
- name: "page"
in: "query"
description: "페이지 번호"
required: false
schema:
type: "integer"
minimum: 1
default: 1
- name: "sort"
in: "query"
description: |
정렬 기준

<details>
<summary>
열거형 값 설명
</summary>

| 값 | 설명 |
| ----------- | ---------------------- |
| id | 백준에서의 문제 ID |
| performance | 퍼포먼스 |
| rank | 순위 |

</details>
required: false

responses:
"200":
description: "서버가 반환에 성공한 경우입니다."
content:
application/json:
schema:
type: "object"
properties:
count:
description: "사용자가 참여한 아레나 수입니다."
type: "integer"
format: "int64"
example: 1
maximum: 100
items:
description: "사용자가 참여한 아레나 목록입니다."
type: "array"
items:
$ref: "../../schemas/arena.yaml#/components/schemas/Arena"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

응답 형식이 변경되었어요. UserArenaDiff 등의 새로운 타입을 필요로 할 것 같아요.

38 changes: 38 additions & 0 deletions src/schemas/arena-tier.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# yaml-language-server: $schema=https://spec.openapis.org/oas/3.1/schema/2021-05-20
---
# for the intellisense
openapi: "3.1.0"
info: { title: "", version: "" }

components:
schemas:
ArenaTier:
title: ArenaTier
type: "integer"
format: "int64"
description: |
C를 1, C+를 2, ..., SSS+을 12, X를 13으로 표현하는 아레나 티어입니다.
자세한 값 정보는 표1. 수치 - 이름 표를 펼쳐 참고하십시오.

<details>
<summary>
표1. 수치 - 이름 표
</summary>

| 수치 | 이름 |
| ---: | ------------ |
| 1 | C |
| 2 | C+ |
| 3 | B |
| 4 | B+ |
| 5 | A |
| 6 | A+ |
| 7 | S |
| 8 | S+ |
| 9 | SS |
| 10 | SS+ |
| 11 | SSS |
| 12 | SSS+ |
| 13 | X |

</details>
130 changes: 130 additions & 0 deletions src/schemas/arena.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# yaml-language-server: $schema=https://spec.openapis.org/oas/3.1/schema/2021-05-20
---
# for the intellisense
openapi: "3.1.0"
info: { title: "", version: "" }

components:
schemas:
Arena:
title: Arena
description: |
아레나 정보입니다.
type: "object"
required:
- arenaId
- arenaIdFixed
- arenaBojContestId
- title
- isGrandArena
- grandArenaId
- startTime
- endTime
- registerEndTime
- ratedRangeStart
- ratedRangeEnd
- isRated
- ratedContestants
- totalContestants
- isScoreBased
- isLevelSorted
- givesLanguageBonus
- penaltyMinutes
- bojNoticeLink
- registrationOpen
- languages
properties:
arenaId:
description: "아레나의 ID입니다."
type: "integer"
example: 1
arenaIdFixed:
description: "아레나의 ID가 고정되었는지 여부입니다."
type: "boolean"
example: true
arenaBojContestId:
description: "아레나의 백준 대회 ID입니다."
type: "integer"
example: 1065
title:
description: "아레나의 제목입니다."
type: "string"
example: "solved.ac Grand Arena #1"
isGrandArena:
description: "아레나가 그랜드 아레나인지 여부입니다."
type: "boolean"
example: true
grandArenaId:
description: "그랜드 아레나의 ID입니다."
type: "integer"
example: 1
startTime:
description: "아레나의 시작 시간입니다."
type: "string"
format: "date-time"
example: "2023-08-06T05:00:00.000Z"
endTime:
description: "아레나의 종료 시간입니다."
type: "string"
format: "date-time"
example: "2023-08-06T08:00:00.000Z"
registerEndTime:
description: "아레나의 등록 종료 시간입니다."
type: "string"
format: "date-time"
example: "2023-08-06T04:55:00.000Z"
ratedRangeStart:
description: "아레나의 레이팅 범위의 시작입니다."
type: "integer"
format: "int64"
example: 0
ratedRangeEnd:
description: "아레나의 레이팅 범위의 끝입니다."
type: "integer"
format: "int64"
example: 10
isRated:
description: "아레나가 레이팅 대상인지 여부입니다."
type: "boolean"
example: true
ratedContestants:
description: "아레나에 등록한 사람 중 레이팅 대상인 사람의 수입니다."
type: "integer"
format: "int64"
example: 1363
totalContestants:
description: "아레나에 등록한 사람의 수입니다."
type: "integer"
format: "int64"
example: 1363
isScoreBased:
description: "아레나가 점수 기반인지 여부입니다."
type: "boolean"
example: false
isLevelSorted:
description: "아레나의 문제가 난이도 순으로 정렬되는지 여부입니다."
type: "boolean"
example: false
givesLanguageBonus:
description: "아레나가 언어 보너스를 주는지 여부입니다."
type: "boolean"
example: true
penaltyMinutes:
description: "아레나의 페널티 시간입니다."
type: "integer"
format: "int64"
example: 20
bojNoticeLink:
description: "아레나의 백준 공지 링크입니다."
type: "string"
example: "https://www.acmicpc.net/board/view/121450"
registrationOpen:
description: "아레나의 등록이 열려있는지 여부입니다."
type: "boolean"
example: true
languages:
description: "아레나에서 사용할 수 있는 언어의 목록입니다."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: "아레나에서 사용할 수 있는 언어의 목록입니다."
description: "아레나 문제 본문 등에 사용된 자연어 목록입니다."

프로그래밍 언어로 설명을 착각하기 쉬워보여요. 아레나 문제 본문의 언어임을 설명하는 게 더 좋을 듯 해요.

type: "array"
items:
type: "string"
example: [ "ko", "en" ]
6 changes: 6 additions & 0 deletions src/schemas/full-user.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ components:
isReverseRival:
description: "역라이벌 여부입니다."
type: "boolean"
blocked:
description: "차단 여부입니다."
type: "boolean"
reverseBlocked:
description: "역차단 여부입니다."
type: "boolean"
Loading