Skip to content

/user/top_100 엔드포인트 추가, Problem 스키마 수정 #58

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

Merged
merged 4 commits into from
May 24, 2023
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
2 changes: 2 additions & 0 deletions src/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ paths:
description: "TODO"
/user/show:
$ref: "./paths/user/show.yaml#/paths/Path"
/user/top_100:
$ref: "./paths/user/top_100.yaml#/paths/Path"

components:
securitySchemes:
Expand Down
211 changes: 199 additions & 12 deletions src/paths/search/suggestion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,36 +37,223 @@ paths:
caption:
description: "자동완성 제목입니다. 해당 값으로 자동완성됩니다."
type: "string"
example: "tree"
description:
description: "자동완성 요소에 대한 설명입니다."
type: "string"
example: ""
problems:
description: "찾은 문제 목록입니다."
description: "찾은 문제 목록입니다. 최대 5문제까지 표시됩니다."
type: "array"
items:
$ref: "../../schemas/problem.yaml#/components/schemas/Problem"
type: "object"
properties:
id:
type: int
description: "문제 ID입니다."
example: 1763
title:
type: str
description: "문제 제목입니다."
example: "트리 색칠"
level:
$ref: "../../schemas/problem-level.yaml#/components/schemas/ProblemLevel"
solved:
type: int
description: "문제를 푼 사람 수입니다."
example: 126
caption:
type: str
example: "트리 색칠"
description:
type: str
example: "#1763"
href:
type: str
example: "https://www.acmicpc.net/problem/1763"
problemCount:
description: "찾은 문제 수입니다."
type: "integer"
format: "int64"
example: 1
users:
description: "찾은 사용자 목록입니다."
tags:
description: "찾은 태그 목록입니다. 최대 5개까지 표시됩니다."
type: "array"
items:
$ref: "../../schemas/user.yaml#/components/schemas/User"
userCount:
description: "찾은 사용자 수입니다."
type: "object"
properties:
key:
description: "태그의 ID입니다."
type: "string"
example: "trees"
name:
description: "태그의 이름입니다."
type: "string"
example: "tree"
problemCount:
description: "이 태그를 포함하는 문제의 수입니다."
type: "integer"
example: 1080
caption:
type: "string"
example: "tag:trees"
description:
type: "string"
example: "1080 problems"
href:
type: "string"
example: "/problems/tags/trees"
tagCount:
description: "찾은 태그 수입니다."
type: "integer"
format: "int64"
example: 1
tags:
description: "찾은 태그 목록입니다."
users:
description: "찾은 사용자 목록입니다. 최대 5명까지 표시됩니다."
type: "array"
items:
$ref: "../../schemas/problem-tag.yaml#/components/schemas/ProblemTag"
tagCount:
description: "찾은 태그 수입니다."
type: "object"
required:
- handle
- bio
- organizations
- backgroundId
- profileImageUrl
- solvedCount
- voteCount
- exp
- tier
- rating
- ratingByProblemsSum
- ratingByClass
- ratingBySolvedCount
- ratingByVoteCount
- class
- classDecoration
- rivalCount
- reverseRivalCount
- maxStreak
- coins
- stardusts
- joinedAt
- bannedUntil
- proUntil
properties:
handle:
description: "사용자명입니다."
type: "string"
example: "shiftpsh"
bio:
description: "사용자의 자기소개입니다."
type: "string"
example: "🧡 이곳의 개발자입니다."
badgeId:
description: "사용자가 지금 사용 중인 뱃지의 아이디입니다."
type: "string"
nullable: true
example: "ghudegy2022-1"
backgroundId:
description: "사용자가 지금 사용 중인 배경의 아이디입니다."
type: "string"
example: "boardgame_7"
profileImageUrl:
description: "사용자의 프로필 사진으로 가는 하이퍼링크입니다."
type: "string"
nullable: true
example: "https://static.solved.ac/uploads/profile/0565b63f0b204e990d1b163018a1c358992519b8.png"
solvedCount:
description: "사용자가 푼 문제 수입니다."
type: "integer"
format: "int64"
example: 2658
voteCount:
description: "사용자가 난이도 기여를 한 횟수입니다."
type: "integer"
format: "int64"
example: 1326
class:
description: "사용자가 취득한 Class입니다."
type: "integer"
format: "int64"
example: 8
classDecoration:
description: "사용자가 취득한 Class의 수준입니다."
$ref: "../../schemas/class-decoration.yaml#/components/schemas/ClassDecoration"
rivalCount:
description: "사용자의 라이벌 수입니다."
type: "integer"
format: "int64"
example: 38
reverseRivalCount:
description: "사용자의 역라이벌 수입니다."
type: "integer"
format: "int64"
example: 53
tier:
$ref: "../../schemas/user-tier.yaml#/components/schemas/UserTier"
rating:
description: "사용자의 레이팅입니다."
type: "integer"
format: "int64"
example: 2641
exp:
description: "사용자가 여태까지 획득한 경험치량입니다."
type: "integer"
format: "int64"
example: 498605585
ratingByProblemsSum:
description: "푼 문제의 난이도 합으로 계산한 사용자의 레이팅입니다."
type: "integer"
format: "int64"
example: 2211
ratingByClass:
description: "취득한 클래스에 따른 사용자의 레이팅입니다."
type: "integer"
format: "int64"
example: 230
ratingBySolvedCount:
description: "푼 문제 수로 계산한 사용자의 레이팅입니다."
type: "integer"
format: "int64"
example: 175
ratingByVoteCount:
description: "문제 난이도에 기여한 횟수로 계산한 사용자의 레이팅입니다."
type: "integer"
format: "int64"
example: 25
maxStreak:
description: "최대 연속 문제 풀이일 수입니다."
type: "integer"
format: "int64"
example: 6
coins:
description: "사용자가 가지고 있는 코인의 수입니다."
type: "integer"
format: "int64"
example: 3845
stardusts:
description: "사용자가 가지고 있는 별가루의 수입니다."
type: "integer"
format: "int64"
example: 264680
joinedAt:
description: "사용자가 가입한 날짜입니다."
type: "string"
format: "date-time"
example: "2021-06-19T00:00:00.000Z"
bannedUntil:
description: "사용자의 정지 종료 날짜입니다."
type: "string"
format: "date-time"
example: "1970-01-01T00:00:00.000Z"
proUntil:
description: "사용자의 PRO 종료 날짜입니다."
type: "string"
format: "date-time"
example: "9999-12-31T00:00:00.000Z"
userCount:
description: "찾은 사용자 수입니다."
type: "integer"
format: "int64"
example: 1

42 changes: 42 additions & 0 deletions src/paths/user/top_100.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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: "상위 100문제 가져오기"
description: "사용자가 푼 문제 중 상위 100문제를 가져옵니다."
tags:
- user
operationId: getTop100

parameters:
- name: "handle"
in: "query"
description: "사용자 ID"
required: true
schema:
type: "string"

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/tagged-problem.yaml#/components/schemas/TaggedProblem"
38 changes: 35 additions & 3 deletions src/schemas/problem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@ components:
description: "한국어 문제 제목입니다. HTML 엔티티나 LaTeX 수식을 포함할 수 있습니다."
type: "string"
example: "Ax+Bsin(x)=C"
titles:
description: "언어별 문제 제목입니다."
type: "array"
items:
type: "object"
properties:
language:
$ref: "./language.yaml#/components/schemas/Language"
languageDisplayName:
description: "표시되는 언어의 이름입니다."
type: "string"
example: "ko"
title:
description: "문제의 제목입니다."
type: "string"
example: "Ax+Bsin(x)=C"
isOriginal:
description: "원본과 동일한지 여부입니다."
type: "boolean"
example: true
isSolvable:
description: "채점 가능 여부입니다."
type: "boolean"
Expand All @@ -33,19 +53,31 @@ components:
description: "맞은 사람 수입니다."
type: "integer"
format: "int64"
example: 189
example: 423
level:
$ref: "./problem-level.yaml#/components/schemas/ProblemLevel"
votedUserCount:
description: "난이도 기여자의 수입니다."
type: "integer"
format: "int64"
example: 62
example: 129
sprout:
description: "새싹 문제인지 여부입니다."
type: "boolean"
example: false
givesNoRating:
description: "레이팅을 주지 않는지 여부입니다."
type: "boolean"
example: false
isLevelLocked:
description: "난이도 기여 제한 여부입니다."
type: "boolean"
example: false
averageTries:
description: "평균 시도 횟수입니다."
type: "number"
example: 28.8413
example: 26.5248
official:
description: "공식 문제 여부입니다."
type: "boolean"
example: true