From 6746fa52a4cd43e2331a566614cdad776592c2ff Mon Sep 17 00:00:00 2001 From: w8385 Date: Sat, 18 Mar 2023 19:09:20 +0900 Subject: [PATCH 1/7] Update /user/show --- src/schemas/full-user.yaml | 4 -- src/schemas/user.yaml | 81 +++++++++++++++++++++----------------- 2 files changed, 44 insertions(+), 41 deletions(-) diff --git a/src/schemas/full-user.yaml b/src/schemas/full-user.yaml index 4186059..9406513 100644 --- a/src/schemas/full-user.yaml +++ b/src/schemas/full-user.yaml @@ -14,10 +14,6 @@ components: - $ref: "./user.yaml#/components/schemas/User" - type: "object" properties: - rank: - description: "사용자의 순위입니다." - type: "integer" - format: "int64" isRival: description: "라이벌 여부입니다." type: "boolean" diff --git a/src/schemas/user.yaml b/src/schemas/user.yaml index 59ffb18..a01879f 100644 --- a/src/schemas/user.yaml +++ b/src/schemas/user.yaml @@ -15,7 +15,7 @@ components: - handle - bio - organizations - - background + - backgroundId - profileImageUrl - solvedCount - voteCount @@ -31,6 +31,12 @@ components: - rivalCount - reverseRivalCount - maxStreak + - coins + - stardusts + - joinedAt + - bannedUntil + - proUntil + - rank properties: handle: description: "사용자명입니다." @@ -40,42 +46,13 @@ components: description: "사용자의 자기소개입니다." type: "string" example: "🧡 이곳의 개발자입니다." - organizations: - description: "사용자가 속한 조직 목록입니다." - type: "array" - items: - $ref: "./organization.yaml#/components/schemas/Organization" - badge: - description: "사용자가 지금 사용 중인 뱃지입니다." - $ref: "./badge.yaml#/components/schemas/Badge" - background: - description: "사용자의 배경 사진입니다." - type: "object" - properties: - backgroundId: - description: "배경의 고유 ID입니다." - type: "string" - example: "balloon_002" - backgroundImageUrl: - description: "배경 사진으로 가는 하이퍼링크입니다." - type: "string" - example: "https://static.solved.ac/profile_bg/balloon_002/balloon_002.png" - author: - description: "배경의 제작자를 표시하는 문구입니다." - type: "string" - example: "Photo by Al Soot on Unsplash" - authorUrl: - description: "배경의 제작자와 관련된 사이트로 가는 하이퍼링크입니다." - type: "string" - example: "https://unsplash.com/photos/yRjLihK35Yw" - displayName: - description: "배경의 이름입니다." - type: "string" - example: "하늘을 수놓은 풍선" - displayDescription: - description: "배경의 설명입니다." - type: "string" - example: "assorted colored balloons mid airs" + badgeId: + description: "사용자가 지금 사용 중인 뱃지의 아이디입니다." + type: "string" + nullable: true + backgroundId: + description: "사용자가 지금 사용 중인 배경의 아이디입니다." + type: "string" profileImageUrl: description: "사용자의 프로필 사진으로 가는 하이퍼링크입니다." type: "string" @@ -146,3 +123,33 @@ components: 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" + rank: + description: "사용자의 순위입니다." + type: "integer" + format: "int64" + example: 104 From e3ae65bee14fa78878b8856e1e6c93671c565f00 Mon Sep 17 00:00:00 2001 From: w8385 Date: Sat, 18 Mar 2023 19:36:22 +0900 Subject: [PATCH 2/7] Add /user/organizations --- src/openapi.yaml | 2 ++ src/paths/user/organizations.yaml | 37 +++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 src/paths/user/organizations.yaml diff --git a/src/openapi.yaml b/src/openapi.yaml index 80f25d9..95e4267 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -106,6 +106,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: diff --git a/src/paths/user/organizations.yaml b/src/paths/user/organizations.yaml new file mode 100644 index 0000000..553b62e --- /dev/null +++ b/src/paths/user/organizations.yaml @@ -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" From 48818cc4f0dfef3325249f3dab3d2644eca8fa06 Mon Sep 17 00:00:00 2001 From: w8385 Date: Sat, 18 Mar 2023 19:39:26 +0900 Subject: [PATCH 3/7] Add /user/show badgeId, backgroundId example --- src/schemas/user.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/schemas/user.yaml b/src/schemas/user.yaml index a01879f..9a152b0 100644 --- a/src/schemas/user.yaml +++ b/src/schemas/user.yaml @@ -50,9 +50,11 @@ components: description: "사용자가 지금 사용 중인 뱃지의 아이디입니다." type: "string" nullable: true + example: "ghudegy2022-1" backgroundId: - description: "사용자가 지금 사용 중인 배경의 아이디입니다." - type: "string" + description: "사용자가 지금 사용 중인 배경의 아이디입니다." + type: "string" + example: "boardgame_7" profileImageUrl: description: "사용자의 프로필 사진으로 가는 하이퍼링크입니다." type: "string" From 9105b093a07c3f06f5c2d65c0bc5ce538578101e Mon Sep 17 00:00:00 2001 From: w8385 Date: Sat, 18 Mar 2023 21:44:19 +0900 Subject: [PATCH 4/7] Add `/badge/show` `/background/show` --- src/openapi.yaml | 14 +++++ src/paths/background/show.yaml | 30 +++++++++ src/paths/badge/show.yaml | 30 +++++++++ src/schemas/background.yaml | 105 ++++++++++++++++++++++++++++++++ src/schemas/badge-category.yaml | 18 ++++++ src/schemas/badge-tier.yaml | 18 ++++++ src/schemas/badge.yaml | 14 +++++ 7 files changed, 229 insertions(+) create mode 100644 src/paths/background/show.yaml create mode 100644 src/paths/badge/show.yaml create mode 100644 src/schemas/background.yaml create mode 100644 src/schemas/badge-category.yaml create mode 100644 src/schemas/badge-tier.yaml diff --git a/src/openapi.yaml b/src/openapi.yaml index 95e4267..de91216 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -28,6 +28,10 @@ servers: tags: - name: "account" description: "계정과 관련이 있는 API입니다" + - name: "badge" + description: "뱃지와 관련이 있는 API입니다" + - name: "background" + description: "배경과 관련이 있는 API입니다" - name: "coins" description: "코인/별조각과 관련이 있는 API입니다" - name: "other" @@ -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: @@ -128,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: diff --git a/src/paths/background/show.yaml b/src/paths/background/show.yaml new file mode 100644 index 0000000..c543b13 --- /dev/null +++ b/src/paths/background/show.yaml @@ -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" diff --git a/src/paths/badge/show.yaml b/src/paths/badge/show.yaml new file mode 100644 index 0000000..36c4fc5 --- /dev/null +++ b/src/paths/badge/show.yaml @@ -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" diff --git a/src/schemas/background.yaml b/src/schemas/background.yaml new file mode 100644 index 0000000..8d114e3 --- /dev/null +++ b/src/schemas/background.yaml @@ -0,0 +1,105 @@ +# 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" + example: [ { "authorId": "havana723","role": "Illustration","authorUrl": null,"handle": "havana723","twitter": null,"instagram": null,"displayName": "havana723" } ] + 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" diff --git a/src/schemas/badge-category.yaml b/src/schemas/badge-category.yaml new file mode 100644 index 0000000..7b6fa5f --- /dev/null +++ b/src/schemas/badge-category.yaml @@ -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: | + 뱃지 종류입니다. diff --git a/src/schemas/badge-tier.yaml b/src/schemas/badge-tier.yaml new file mode 100644 index 0000000..0b027e5 --- /dev/null +++ b/src/schemas/badge-tier.yaml @@ -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: | + 뱃지 치장입니다. diff --git a/src/schemas/badge.yaml b/src/schemas/badge.yaml index b8854d2..302db26 100644 --- a/src/schemas/badge.yaml +++ b/src/schemas/badge.yaml @@ -33,3 +33,17 @@ components: description: "뱃지의 설명입니다." type: "string" example: "solved.ac의 1주년과 함께했다" + badgeTier: + type: "string" + enum: + - "bronze" + - "silver" + - "gold" + - "master" + badgeCategory: + type: "string" + enum: + - "achievement" + - "season" + - "event" + - "contest" \ No newline at end of file From b95253c6f0944be5517ae80396cf6b468fd15f1b Mon Sep 17 00:00:00 2001 From: w8385 Date: Sat, 18 Mar 2023 23:31:41 +0900 Subject: [PATCH 5/7] Fix `badgeTier` `badgeCategory` to $ref --- src/schemas/badge.yaml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/schemas/badge.yaml b/src/schemas/badge.yaml index 302db26..e86d23b 100644 --- a/src/schemas/badge.yaml +++ b/src/schemas/badge.yaml @@ -35,15 +35,7 @@ components: example: "solved.ac의 1주년과 함께했다" badgeTier: type: "string" - enum: - - "bronze" - - "silver" - - "gold" - - "master" + $ref: "./badge-tier.yaml#/components/schemas/BadgeTier" badgeCategory: type: "string" - enum: - - "achievement" - - "season" - - "event" - - "contest" \ No newline at end of file + $ref: "./badge-category.yaml#/components/schemas/BadgeCategory" \ No newline at end of file From cac38d4821cd490110ef88c667cba5e0e2797cfa Mon Sep 17 00:00:00 2001 From: w8385 Date: Sat, 18 Mar 2023 23:32:21 +0900 Subject: [PATCH 6/7] =?UTF-8?q?Fix=20=EB=B1=83=EC=A7=80=20`=EC=B9=98?= =?UTF-8?q?=EC=9E=A5`=20to=20`=ED=8B=B0=EC=96=B4`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/schemas/badge-tier.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schemas/badge-tier.yaml b/src/schemas/badge-tier.yaml index 0b027e5..2835e6d 100644 --- a/src/schemas/badge-tier.yaml +++ b/src/schemas/badge-tier.yaml @@ -15,4 +15,4 @@ components: - "gold" - "master" description: | - 뱃지 치장입니다. + 뱃지 티어입니다. From 28d99e29ecc3f52b8a089a6bc61bc2750fa6d9d0 Mon Sep 17 00:00:00 2001 From: w8385 Date: Sat, 18 Mar 2023 23:55:12 +0900 Subject: [PATCH 7/7] Delete unnecessary author example --- src/schemas/background.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/src/schemas/background.yaml b/src/schemas/background.yaml index 8d114e3..51a36a1 100644 --- a/src/schemas/background.yaml +++ b/src/schemas/background.yaml @@ -70,7 +70,6 @@ components: type: "array" items: type: "object" - example: [ { "authorId": "havana723","role": "Illustration","authorUrl": null,"handle": "havana723","twitter": null,"instagram": null,"displayName": "havana723" } ] properties: authorId: description: "작가의 ID입니다."