diff --git a/src/openapi.yaml b/src/openapi.yaml index de91216..6f78c30 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -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: diff --git a/src/paths/search/suggestion.yaml b/src/paths/search/suggestion.yaml index 003080b..d3f3bf6 100644 --- a/src/paths/search/suggestion.yaml +++ b/src/paths/search/suggestion.yaml @@ -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 + diff --git a/src/paths/user/top_100.yaml b/src/paths/user/top_100.yaml new file mode 100644 index 0000000..001ad85 --- /dev/null +++ b/src/paths/user/top_100.yaml @@ -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" diff --git a/src/schemas/problem.yaml b/src/schemas/problem.yaml index 76d52ce..9592169 100644 --- a/src/schemas/problem.yaml +++ b/src/schemas/problem.yaml @@ -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" @@ -33,14 +53,22 @@ 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" @@ -48,4 +76,8 @@ components: averageTries: description: "평균 시도 횟수입니다." type: "number" - example: 28.8413 + example: 26.5248 + official: + description: "공식 문제 여부입니다." + type: "boolean" + example: true