Skip to content

Commit

Permalink
feat: migrate badge + better web ui
Browse files Browse the repository at this point in the history
  • Loading branch information
RanolP committed Mar 1, 2024
1 parent 2798f2e commit a4a4c73
Show file tree
Hide file tree
Showing 10 changed files with 186 additions and 167 deletions.
60 changes: 60 additions & 0 deletions src/models/Badge.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using TypeSpec.OpenAPI;

namespace SolvedAC;

/**
* 사용자가 획득할 수 있는 뱃지입니다.
*/
model Badge {
/**
* 뱃지의 고유 ID입니다.
* @example "anniversary_1st"
*/
badgeId: string;

/**
* 뱃지 사진으로 가는 하이퍼링크입니다.
* @example "https://static.solved.ac/profile_badge/anniversary_1st.png"
*/
badgeImageUrl: url;

/**
* 뱃지가 표시되는 이름입니다.
* @example "1솔브"
*/
displayName: string;

/**
* 뱃지의 설명입니다.
* @example "solved.ac의 1주년과 함께했다"
*/
displayDescription: string;

/**
* 뱃지를 획득한 사용자 수입니다.
* @example 5000
*/
unlockedUserCount: int64;

/**
* @example "gold"
*/
badgeTier: BadgeTier;

/**
* @example "season"
*/
badgeCategory: BadgeCategory;

/**
* solved.ac 회사가 권리를 보유하는지 여부입니다.
* @example true
*/
solvedCompanyRights: boolean;

/**
* 뱃지가 만들어진 시각입니다.
* @example "2021-06-05T15:00:00.000Z"
*/
createdAt: offsetDateTime;
}
27 changes: 27 additions & 0 deletions src/models/BadgeCategory.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
namespace SolvedAC;

/**
* 뱃지 획득 유형 분류입니다.
* @example "season"
*/
enum BadgeCategory {
/**
* 업적 달성으로 획득
*/
Achievement: "achievement",

/**
* 시즌 변경을 함께해 획득
*/
Season: "season",

/**
* 이벤트 미션 수행으로 획득
*/
Event: "event",

/**
* 대회 참여 후 조건 만족으로 획득
*/
Contest: "contest",
}
12 changes: 12 additions & 0 deletions src/models/BadgeTier.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace SolvedAC;

/**
* 뱃지의 등급입니다.
* @example "bronze"
*/
enum BadgeTier {
Bronze: "bronze",
Silver: "silver",
Gold: "gold",
Master: "master",
}
166 changes: 83 additions & 83 deletions src/models/SolveTier.tsp
Original file line number Diff line number Diff line change
@@ -1,84 +1,84 @@
namespace SolvedAC {
/**
* <solved-icon type="solve-tier:1"></solved-icon> <span class="solve-tier-bronze">Bronze V</span>를 1,
* <solved-icon type="solve-tier:2"></solved-icon> <span class="solve-tier-bronze">Bronze IV</span>를 2,
* ...,
* <solved-icon type="solve-tier:30"></solved-icon> <span class="solve-tier-ruby">Ruby I</span>을 30,
* <solved-icon type="solve-tier:31"></solved-icon> <span class="solve-tier-master">Master</span>를 31로 표현하는 문제해결 티어입니다.
* 자세한 값 정보는 표1. 수치 - 이름 표를 펼쳐 참고하십시오.
*
* <details>
* <summary>
* 표1. 수치 - 이름 표
* </summary>
*
* | 수치 | 이름 |
* | ---: | ------------ |
* | 1 | <solved-icon type="solve-tier:1"></solved-icon> <span class="solve-tier-bronze">Bronze V</span> |
* | 2 | <solved-icon type="solve-tier:2"></solved-icon> <span class="solve-tier-bronze">Bronze IV</span> |
* | 3 | <solved-icon type="solve-tier:3"></solved-icon> <span class="solve-tier-bronze">Bronze III</span> |
* | 4 | <solved-icon type="solve-tier:4"></solved-icon> <span class="solve-tier-bronze">Bronze II</span> |
* | 5 | <solved-icon type="solve-tier:5"></solved-icon> <span class="solve-tier-bronze">Bronze I</span> |
* | 6 | <solved-icon type="solve-tier:6"></solved-icon> <span class="solve-tier-silver">Silver V</span> |
* | 7 | <solved-icon type="solve-tier:7"></solved-icon> <span class="solve-tier-silver">Silver IV</span> |
* | 8 | <solved-icon type="solve-tier:8"></solved-icon> <span class="solve-tier-silver">Silver III</span> |
* | 9 | <solved-icon type="solve-tier:9"></solved-icon> <span class="solve-tier-silver">Silver II</span> |
* | 10 | <solved-icon type="solve-tier:10"></solved-icon> <span class="solve-tier-silver">Silver I</span> |
* | 11 | <solved-icon type="solve-tier:11"></solved-icon> <span class="solve-tier-gold">Gold V</span> |
* | 12 | <solved-icon type="solve-tier:12"></solved-icon> <span class="solve-tier-gold">Gold IV</span> |
* | 13 | <solved-icon type="solve-tier:13"></solved-icon> <span class="solve-tier-gold">Gold III</span> |
* | 14 | <solved-icon type="solve-tier:14"></solved-icon> <span class="solve-tier-gold">Gold II</span> |
* | 15 | <solved-icon type="solve-tier:15"></solved-icon> <span class="solve-tier-gold">Gold I</span> |
* | 16 | <solved-icon type="solve-tier:16"></solved-icon> <span class="solve-tier-platinum">Platinum V</span> |
* | 17 | <solved-icon type="solve-tier:17"></solved-icon> <span class="solve-tier-platinum">Platinum IV</span> |
* | 18 | <solved-icon type="solve-tier:18"></solved-icon> <span class="solve-tier-platinum">Platinum III</span> |
* | 19 | <solved-icon type="solve-tier:19"></solved-icon> <span class="solve-tier-platinum">Platinum II</span> |
* | 20 | <solved-icon type="solve-tier:20"></solved-icon> <span class="solve-tier-platinum">Platinum I</span> |
* | 21 | <solved-icon type="solve-tier:21"></solved-icon> <span class="solve-tier-diamond">Diamond V</span> |
* | 22 | <solved-icon type="solve-tier:22"></solved-icon> <span class="solve-tier-diamond">Diamond IV</span> |
* | 23 | <solved-icon type="solve-tier:23"></solved-icon> <span class="solve-tier-diamond">Diamond III</span> |
* | 24 | <solved-icon type="solve-tier:24"></solved-icon> <span class="solve-tier-diamond">Diamond II</span> |
* | 25 | <solved-icon type="solve-tier:25"></solved-icon> <span class="solve-tier-diamond">Diamond I</span> |
* | 26 | <solved-icon type="solve-tier:26"></solved-icon> <span class="solve-tier-ruby">Ruby V</span> |
* | 27 | <solved-icon type="solve-tier:27"></solved-icon> <span class="solve-tier-ruby">Ruby IV</span> |
* | 28 | <solved-icon type="solve-tier:28"></solved-icon> <span class="solve-tier-ruby">Ruby III</span> |
* | 29 | <solved-icon type="solve-tier:29"></solved-icon> <span class="solve-tier-ruby">Ruby II</span> |
* | 30 | <solved-icon type="solve-tier:30"></solved-icon> <span class="solve-tier-ruby">Ruby I</span> |
* | 31 | <solved-icon type="solve-tier:31"></solved-icon> <span class="solve-tier-master">Master</span> |
*
* </details>
*/
enum SolveTier {
Bronze5: 1,
Bronze4: 2,
Bronze3: 3,
Bronze2: 4,
Bronze1: 5,
Silver5: 6,
Silver4: 7,
Silver3: 8,
Silver2: 9,
Silver1: 10,
Gold5: 11,
Gold4: 12,
Gold3: 13,
Gold2: 14,
Gold1: 15,
Platinum5: 16,
Platinum4: 17,
Platinum3: 18,
Platinum2: 19,
Platinum1: 20,
Diamond5: 21,
Diamond4: 22,
Diamond3: 23,
Diamond2: 24,
Diamond1: 25,
Ruby5: 26,
Ruby4: 27,
Ruby3: 28,
Ruby2: 29,
Ruby1: 30,
Master: 31,
}
namespace SolvedAC;

/**
* <solved-icon type="solve-tier:1"></solved-icon> <span class="solve-tier-bronze">Bronze V</span>를 1,
* <solved-icon type="solve-tier:2"></solved-icon> <span class="solve-tier-bronze">Bronze IV</span>를 2,
* ...,
* <solved-icon type="solve-tier:30"></solved-icon> <span class="solve-tier-ruby">Ruby I</span>을 30,
* <solved-icon type="solve-tier:31"></solved-icon> <span class="solve-tier-master">Master</span>를 31로 표현하는 문제해결 티어입니다.
* 자세한 값 정보는 표1. 수치 - 이름 표를 펼쳐 참고하십시오.
*
* <details>
* <summary>
* 표1. 수치 - 이름 표
* </summary>
*
* | 수치 | 이름 |
* | ---: | ------------ |
* | 1 | <solved-icon type="solve-tier:1"></solved-icon> <span class="solve-tier-bronze">Bronze V</span> |
* | 2 | <solved-icon type="solve-tier:2"></solved-icon> <span class="solve-tier-bronze">Bronze IV</span> |
* | 3 | <solved-icon type="solve-tier:3"></solved-icon> <span class="solve-tier-bronze">Bronze III</span> |
* | 4 | <solved-icon type="solve-tier:4"></solved-icon> <span class="solve-tier-bronze">Bronze II</span> |
* | 5 | <solved-icon type="solve-tier:5"></solved-icon> <span class="solve-tier-bronze">Bronze I</span> |
* | 6 | <solved-icon type="solve-tier:6"></solved-icon> <span class="solve-tier-silver">Silver V</span> |
* | 7 | <solved-icon type="solve-tier:7"></solved-icon> <span class="solve-tier-silver">Silver IV</span> |
* | 8 | <solved-icon type="solve-tier:8"></solved-icon> <span class="solve-tier-silver">Silver III</span> |
* | 9 | <solved-icon type="solve-tier:9"></solved-icon> <span class="solve-tier-silver">Silver II</span> |
* | 10 | <solved-icon type="solve-tier:10"></solved-icon> <span class="solve-tier-silver">Silver I</span> |
* | 11 | <solved-icon type="solve-tier:11"></solved-icon> <span class="solve-tier-gold">Gold V</span> |
* | 12 | <solved-icon type="solve-tier:12"></solved-icon> <span class="solve-tier-gold">Gold IV</span> |
* | 13 | <solved-icon type="solve-tier:13"></solved-icon> <span class="solve-tier-gold">Gold III</span> |
* | 14 | <solved-icon type="solve-tier:14"></solved-icon> <span class="solve-tier-gold">Gold II</span> |
* | 15 | <solved-icon type="solve-tier:15"></solved-icon> <span class="solve-tier-gold">Gold I</span> |
* | 16 | <solved-icon type="solve-tier:16"></solved-icon> <span class="solve-tier-platinum">Platinum V</span> |
* | 17 | <solved-icon type="solve-tier:17"></solved-icon> <span class="solve-tier-platinum">Platinum IV</span> |
* | 18 | <solved-icon type="solve-tier:18"></solved-icon> <span class="solve-tier-platinum">Platinum III</span> |
* | 19 | <solved-icon type="solve-tier:19"></solved-icon> <span class="solve-tier-platinum">Platinum II</span> |
* | 20 | <solved-icon type="solve-tier:20"></solved-icon> <span class="solve-tier-platinum">Platinum I</span> |
* | 21 | <solved-icon type="solve-tier:21"></solved-icon> <span class="solve-tier-diamond">Diamond V</span> |
* | 22 | <solved-icon type="solve-tier:22"></solved-icon> <span class="solve-tier-diamond">Diamond IV</span> |
* | 23 | <solved-icon type="solve-tier:23"></solved-icon> <span class="solve-tier-diamond">Diamond III</span> |
* | 24 | <solved-icon type="solve-tier:24"></solved-icon> <span class="solve-tier-diamond">Diamond II</span> |
* | 25 | <solved-icon type="solve-tier:25"></solved-icon> <span class="solve-tier-diamond">Diamond I</span> |
* | 26 | <solved-icon type="solve-tier:26"></solved-icon> <span class="solve-tier-ruby">Ruby V</span> |
* | 27 | <solved-icon type="solve-tier:27"></solved-icon> <span class="solve-tier-ruby">Ruby IV</span> |
* | 28 | <solved-icon type="solve-tier:28"></solved-icon> <span class="solve-tier-ruby">Ruby III</span> |
* | 29 | <solved-icon type="solve-tier:29"></solved-icon> <span class="solve-tier-ruby">Ruby II</span> |
* | 30 | <solved-icon type="solve-tier:30"></solved-icon> <span class="solve-tier-ruby">Ruby I</span> |
* | 31 | <solved-icon type="solve-tier:31"></solved-icon> <span class="solve-tier-master">Master</span> |
*
* </details>
*/
enum SolveTier {
Bronze5: 1,
Bronze4: 2,
Bronze3: 3,
Bronze2: 4,
Bronze1: 5,
Silver5: 6,
Silver4: 7,
Silver3: 8,
Silver2: 9,
Silver1: 10,
Gold5: 11,
Gold4: 12,
Gold3: 13,
Gold2: 14,
Gold1: 15,
Platinum5: 16,
Platinum4: 17,
Platinum3: 18,
Platinum2: 19,
Platinum1: 20,
Diamond5: 21,
Diamond4: 22,
Diamond3: 23,
Diamond2: 24,
Diamond1: 25,
Ruby5: 26,
Ruby4: 27,
Ruby3: 28,
Ruby2: 29,
Ruby1: 30,
Master: 31,
}
3 changes: 3 additions & 0 deletions src/models/_barrel.tsp
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
import "./SolveTier.tsp";
import "./Badge.tsp";
import "./BadgeTier.tsp";
import "./BadgeCategory.tsp";
6 changes: 0 additions & 6 deletions src/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@ components:
$ref: "./schemas/coinshop-product.yaml#/components/schemas/CoinshopProduct"
Background:

Check notice on line 112 in src/openapi.yaml

View workflow job for this annotation

GitHub Actions / Lint (pull_request)

oas3-unused-component

Potentially unused component has been detected.
$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:

Check notice on line 114 in src/openapi.yaml

View workflow job for this annotation

GitHub Actions / Lint (pull_request)

oas3-unused-component

Potentially unused component has been detected.
$ref: "./schemas/full-user.yaml#/components/schemas/FullUser"
IconScheme:

Check notice on line 116 in src/openapi.yaml

View workflow job for this annotation

GitHub Actions / Lint (pull_request)

oas3-unused-component

Potentially unused component has been detected.
Expand Down
18 changes: 0 additions & 18 deletions src/schemas/badge-category.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions src/schemas/badge-tier.yaml

This file was deleted.

41 changes: 0 additions & 41 deletions src/schemas/badge.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion vendors/stoplight-elements.min.js

Large diffs are not rendered by default.

0 comments on commit a4a4c73

Please sign in to comment.