Skip to content

Commit

Permalink
feat: migrate /problem/level
Browse files Browse the repository at this point in the history
  • Loading branch information
RanolP committed Mar 8, 2024
1 parent 95b816f commit 28d39ae
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 35 deletions.
2 changes: 0 additions & 2 deletions src/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ paths:
description: "TODO"
/problem/class:
$ref: "./paths/problem/class.yaml#/paths/Path"
/problem/level:
$ref: "./paths/problem/level.yaml#/paths/Path"
/ranking/tier:
$ref: "./paths/ranking/tier.yaml#/paths/Path"
/ranking/class:
Expand Down
1 change: 1 addition & 0 deletions src/operations/problem/_barrel.tsp
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import "./show.tsp";
import "./lookup.tsp";
import "./level.tsp";
74 changes: 74 additions & 0 deletions src/operations/problem/level.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
using TypeSpec.Http;
using TypeSpec.OpenAPI;

namespace SolvedAC;

/**
* 난이도별 문제 수를 가져옵니다.
*
* @return
* 난이도별 문제 수
*/
@summary("난이도별 문제 수 가져오기")
@tag("problem")
@get
@route("/problem/level")
op getProblemsCountGroupByLevel(
/**
* 응답을 받을 언어입니다.
*/
@header
`x-solvedac-language`?: Language,
): GetProblemsCountGroupByLevel.Ok;

namespace GetProblemsCountGroupByLevel {
/**
* @example
* [
* { "level": 0, "count": 7159 },
* { "level": 1, "count": 154 },
* { "level": 2, "count": 271 },
* { "level": 3, "count": 696 },
* { "level": 4, "count": 893 },
* { "level": 5, "count": 782 },
* { "level": 6, "count": 771 },
* { "level": 7, "count": 828 },
* { "level": 8, "count": 914 },
* { "level": 9, "count": 959 },
* { "level": 10, "count": 1021 },
* { "level": 11, "count": 973 },
* { "level": 12, "count": 1386 },
* { "level": 13, "count": 1291 },
* { "level": 14, "count": 1126 },
* { "level": 15, "count": 1023 },
* { "level": 16, "count": 1178 },
* { "level": 17, "count": 1121 },
* { "level": 18, "count": 1165 },
* { "level": 19, "count": 1126 },
* { "level": 20, "count": 891 },
* { "level": 21, "count": 904 },
* { "level": 22, "count": 850 },
* { "level": 23, "count": 602 },
* { "level": 24, "count": 440 },
* { "level": 25, "count": 352 },
* { "level": 26, "count": 281 },
* { "level": 27, "count": 149 },
* { "level": 28, "count": 93 },
* { "level": 29, "count": 32 },
* { "level": 30, "count": 28 }
* ]
*/
@extension(XInternal, true)
model Ok {
@statusCode status: 200;
items: LevelEntry[];
}
model LevelEntry {
level: ProblemLevel;

/**
* 문제 수입니다.
*/
count: uint64;
}
}
33 changes: 0 additions & 33 deletions src/paths/problem/level.yaml

This file was deleted.

0 comments on commit 28d39ae

Please sign in to comment.