diff --git a/src/openapi.yaml b/src/openapi.yaml index 6f78c30..5db9b16 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -28,6 +28,8 @@ servers: tags: - name: "account" description: "계정과 관련이 있는 API입니다" + - name: "arena" + description: "아레나와 관련이 있는 API입니다" - name: "badge" description: "뱃지와 관련이 있는 API입니다" - name: "background" @@ -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: @@ -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: @@ -108,6 +114,8 @@ paths: responses: "200": description: "TODO" + /user/contests: + $ref: "./paths/user/contests.yaml#/paths/Path" /user/contribution_stats: get: description: "TODO" @@ -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: diff --git a/src/paths/arena/contests.yaml b/src/paths/arena/contests.yaml new file mode 100644 index 0000000..8c52c2b --- /dev/null +++ b/src/paths/arena/contests.yaml @@ -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" \ No newline at end of file diff --git a/src/paths/ranking/arena.yaml b/src/paths/ranking/arena.yaml new file mode 100644 index 0000000..fdf5f0e --- /dev/null +++ b/src/paths/ranking/arena.yaml @@ -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" diff --git a/src/paths/user/contests.yaml b/src/paths/user/contests.yaml new file mode 100644 index 0000000..9910ac4 --- /dev/null +++ b/src/paths/user/contests.yaml @@ -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: 아레나 목록 가져오기 + 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: | + 정렬 기준 + +
+ + 열거형 값 설명 + + + | 값 | 설명 | + | ----------- | ---------------------- | + | id | 백준에서의 문제 ID | + | performance | 퍼포먼스 | + | rank | 순위 | + +
+ 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" diff --git a/src/schemas/arena-tier.yaml b/src/schemas/arena-tier.yaml new file mode 100644 index 0000000..282da26 --- /dev/null +++ b/src/schemas/arena-tier.yaml @@ -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. 수치 - 이름 표를 펼쳐 참고하십시오. + +
+ + 표1. 수치 - 이름 표 + + + | 수치 | 이름 | + | ---: | ------------ | + | 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 | + +
diff --git a/src/schemas/arena.yaml b/src/schemas/arena.yaml new file mode 100644 index 0000000..714f2dd --- /dev/null +++ b/src/schemas/arena.yaml @@ -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: "아레나에서 사용할 수 있는 언어의 목록입니다." + type: "array" + items: + type: "string" + example: [ "ko", "en" ] diff --git a/src/schemas/full-user.yaml b/src/schemas/full-user.yaml index 9406513..d0e73e6 100644 --- a/src/schemas/full-user.yaml +++ b/src/schemas/full-user.yaml @@ -20,3 +20,9 @@ components: isReverseRival: description: "역라이벌 여부입니다." type: "boolean" + blocked: + description: "차단 여부입니다." + type: "boolean" + reverseBlocked: + description: "역차단 여부입니다." + type: "boolean" diff --git a/src/schemas/user.yaml b/src/schemas/user.yaml index a101339..4a38699 100644 --- a/src/schemas/user.yaml +++ b/src/schemas/user.yaml @@ -19,16 +19,21 @@ components: - profileImageUrl - solvedCount - voteCount + - class + - classDecoration + - rivalCount + - reverseRivalCount - tier - rating - ratingByProblemsSum - ratingByClass - ratingBySolvedCount - ratingByVoteCount - - class - - classDecoration - - rivalCount - - reverseRivalCount + - arenaTier + - arenaRating + - arenaMaxTier + - arenaMaxRating + - arenaCompetedRoundCount - maxStreak - coins - stardusts @@ -149,3 +154,23 @@ components: type: "integer" format: "int64" example: 104 + arenaTier: + description: "사용자의 아레나 티어입니다." + type: "integer" + format: "int64" + example: 12 + arenaRating: + description: "사용자의 아레나 레이팅입니다." + type: "integer" + format: "int64" + example: 2641 + arenaMaxTier: + description: "사용자의 아레나 최고 티어입니다." + type: "integer" + format: "int64" + example: 12 + arenaMaxRating: + description: "사용자의 아레나 최고 레이팅입니다." + type: "integer" + format: "int64" + example: 2641 \ No newline at end of file