From 1c3e8c65e37531a7a2c2c5e59ef87e9bcd3b589f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EA=B7=BC=ED=98=95?= Date: Fri, 3 May 2024 05:13:27 +0900 Subject: [PATCH] feat: /tag/list /tag/show --- src/operations/_barrel.tsp | 1 + src/operations/tag/_barrel.tsp | 2 ++ src/operations/tag/list.tsp | 30 ++++++++++++++++++++++++++++++ src/operations/tag/show.tsp | 30 ++++++++++++++++++++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 src/operations/tag/_barrel.tsp create mode 100644 src/operations/tag/list.tsp create mode 100644 src/operations/tag/show.tsp diff --git a/src/operations/_barrel.tsp b/src/operations/_barrel.tsp index 6560acd..283a177 100644 --- a/src/operations/_barrel.tsp +++ b/src/operations/_barrel.tsp @@ -8,3 +8,4 @@ import "./search/_barrel.tsp"; import "./site/_barrel.tsp"; import "./user/_barrel.tsp"; import "./post/_barrel.tsp"; +import "./tag/_barrel.tsp"; diff --git a/src/operations/tag/_barrel.tsp b/src/operations/tag/_barrel.tsp new file mode 100644 index 0000000..0d7726b --- /dev/null +++ b/src/operations/tag/_barrel.tsp @@ -0,0 +1,2 @@ +import "./list.tsp"; +import "./show.tsp"; diff --git a/src/operations/tag/list.tsp b/src/operations/tag/list.tsp new file mode 100644 index 0000000..d73371f --- /dev/null +++ b/src/operations/tag/list.tsp @@ -0,0 +1,30 @@ +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace SolvedAC; + +/** + * 태그 목록을 가져옵니다. + * + * @return + * 태그 목록을 가져옵니다. + */ +@summary("태그 목록 가져오기") +@tag("tag") +@get +@route("/tag/list") +op getTagList( + /** + * 페이지 + */ + @query + page?: uint32, +): GetTagList.Ok; + +namespace GetTagList { + @extension(XInternal, true) + model Ok { + @statusCode status: 200; + @body data: PaginatedList; + } +} diff --git a/src/operations/tag/show.tsp b/src/operations/tag/show.tsp new file mode 100644 index 0000000..d8e2a04 --- /dev/null +++ b/src/operations/tag/show.tsp @@ -0,0 +1,30 @@ +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace SolvedAC; + +/** + * 태그 ID로 태그 정보를 가져옵니다. + * + * @return + * 태그 정보를 가져옵니다. + */ +@summary("태그 ID로 태그 정보 가져오기") +@tag("tag") +@get +@route("/tag/show") +op getTagByKey( + /** + * 태그 ID + */ + @query + key: string, +): GetTagByKey.Ok; + +namespace GetTagByKey { + @extension(XInternal, true) + model Ok { + @statusCode status: 200; + @body tag: ProblemTag; + } +}