Skip to content

Solvedac update #54

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 7 commits into from
Mar 18, 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
16 changes: 16 additions & 0 deletions src/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ servers:
tags:
- name: "account"
description: "계정과 관련이 있는 API입니다"
- name: "badge"
description: "뱃지와 관련이 있는 API입니다"
- name: "background"
description: "배경과 관련이 있는 API입니다"
- name: "coins"
description: "코인/별조각과 관련이 있는 API입니다"
- name: "other"
Expand All @@ -46,6 +50,10 @@ paths:
$ref: "./paths/account/update_settings.yaml#/paths/Path"
/account/verify_credentials:
$ref: "./paths/account/verify_credentials.yaml#/paths/Path"
/background/show:
$ref: "./paths/background/show.yaml#/paths/Path"
/badge/show:
$ref: "./paths/badge/show.yaml#/paths/Path"
/coins/exchange_rate:
$ref: "./paths/coins/exchange_rate.yaml#/paths/Path"
/coins/shop/list:
Expand Down Expand Up @@ -106,6 +114,8 @@ paths:
responses:
"200":
description: "TODO"
/user/organizations:
$ref: "./paths/user/organizations.yaml#/paths/Path"
/user/problem_stats:
$ref: "./paths/user/problem_stats.yaml#/paths/Path"
/user/problem_tag_stats:
Expand All @@ -126,8 +136,14 @@ components:
$ref: "./schemas/class-decoration.yaml#/components/schemas/ClassDecoration"
CoinshopProduct:
$ref: "./schemas/coinshop-product.yaml#/components/schemas/CoinshopProduct"
Background:
$ref: "./schemas/background.yaml#/components/schemas/Background"
Badge:
$ref: "./schemas/badge.yaml#/components/schemas/Badge"
BadgeCategory:
$ref: "./schemas/badge-category.yaml#/components/schemas/BadgeCategory"
BadgeTier:
$ref: "./schemas/badge-tier.yaml#/components/schemas/BadgeTier"
FullUser:
$ref: "./schemas/full-user.yaml#/components/schemas/FullUser"
IconScheme:
Expand Down
30 changes: 30 additions & 0 deletions src/paths/background/show.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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:
- background
operationId: getBackground

parameters:
- name: "backgroundId"
in: "query"
description: "배경 ID"
required: true
schema:
type: "string"

responses:
"200":
description: "서버가 반환에 성공한 경우입니다."
content:
application/json:
schema:
$ref: "../../schemas/background.yaml#/components/schemas/Background"
30 changes: 30 additions & 0 deletions src/paths/badge/show.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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:
- badge
operationId: getBadge

parameters:
- name: "badgeId"
in: "query"
description: "뱃지 ID"
required: true
schema:
type: "string"

responses:
"200":
description: "서버가 반환에 성공한 경우입니다."
content:
application/json:
schema:
$ref: "../../schemas/badge.yaml#/components/schemas/Badge"
37 changes: 37 additions & 0 deletions src/paths/user/organizations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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:
- user
operationId: getUserOrganizations

security:
- {}
- solvedacToken: []

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

responses:
"200":
description: "서버가 반환에 성공한 경우입니다."
content:
application/json:
schema:
type: "array"
items:
type: "object"
$ref: "../../schemas/organization.yaml#/components/schemas/Organization"
104 changes: 104 additions & 0 deletions src/schemas/background.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# 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:
Background:
title: Background
description: |
사용자가 사용할 수 있는 배경입니다.
type: "object"
required:
- backgroundId
- backgroundImageUrl
- unlockedUserCount
- displayName
- displayDescription
- conditions
- hiddenConditions
- isIllust
- authors
properties:
backgroundId:
description: "배경의 ID입니다."
type: "string"
example: "hanbyeol_stars"
backgroundImageUrl:
description: "배경 사진으로 가는 하이퍼링크입니다."
type: "string"
example: "https://static.solved.ac/profile_bg/hanbyeol_stars/hanbyeol_stars.jpg"
fallbackBackgroundImageUrl:
description: "배경 사진이 없을 때 대체로 사용할 사진으로 가는 하이퍼링크입니다."
type: "string"
nullable: true
example: null
backgroundVideoUrl:
description: "배경 비디오로 가는 하이퍼링크입니다."
type: "string"
nullable: true
example: null
unlockedUserCount:
description: "해당 배경을 획득한 사용자의 수입니다."
type: "integer"
format: "int64"
example: 1394
displayName:
description: "배경의 이름입니다."
type: "string"
example: "Stars in the Evening Sky"
displayDescription:
description: "배경의 설명입니다."
type: "string"
example: "She who has a star in her heart never gets lost in the dark"
conditions:
description: "해당 배경을 얻을 수 있는 조건입니다."
type: "string"
example: "Bought the background at the coin shop"
hiddenConditions:
description: "해당 배경을 얻을 수 있는 조건이 숨겨져 있는지 여부입니다."
type: "boolean"
example: false
isIllust:
description: "해당 배경이 일러스트인지 여부입니다."
type: "boolean"
example: true
authors:
description: "해당 배경을 만든 사람들의 정보입니다."
type: "array"
items:
type: "object"
properties:
authorId:
description: "작가의 ID입니다."
type: "string"
example: "havana723"
role:
description: "작가의 역할입니다."
type: "string"
example: "Illustration"
authorUrl:
description: "작가의 홈페이지로 가는 하이퍼링크입니다."
type: "string"
nullable: true
example: null
handle:
description: "작가의 사용자 ID입니다."
type: "string"
example: "havana723"
twitter:
description: "작가의 트위터 ID입니다."
type: "string"
nullable: true
example: null
instagram:
description: "작가의 인스타그램 ID입니다."
type: "string"
nullable: true
example: null
displayName:
description: "작가의 이름입니다."
type: "string"
example: "havana723"
18 changes: 18 additions & 0 deletions src/schemas/badge-category.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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:
BadgeCategory:
title: BadgeCategory
type: "string"
enum:
- "achievement"
- "season"
- "event"
- "contest"
description: |
뱃지 종류입니다.
18 changes: 18 additions & 0 deletions src/schemas/badge-tier.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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:
BadgeTier:
title: BadgeTier
type: "string"
enum:
- "bronze"
- "silver"
- "gold"
- "master"
description: |
뱃지 티어입니다.
6 changes: 6 additions & 0 deletions src/schemas/badge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ components:
description: "뱃지의 설명입니다."
type: "string"
example: "solved.ac의 1주년과 함께했다"
badgeTier:
type: "string"
$ref: "./badge-tier.yaml#/components/schemas/BadgeTier"
badgeCategory:
type: "string"
$ref: "./badge-category.yaml#/components/schemas/BadgeCategory"
4 changes: 0 additions & 4 deletions src/schemas/full-user.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ components:
- $ref: "./user.yaml#/components/schemas/User"
- type: "object"
properties:
rank:
description: "사용자의 순위입니다."
type: "integer"
format: "int64"
isRival:
description: "라이벌 여부입니다."
type: "boolean"
Expand Down
Loading