diff --git a/src/openapi.yaml b/src/openapi.yaml index 80f25d9..8017075 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -116,6 +116,8 @@ paths: description: "TODO" /user/show: $ref: "./paths/user/show.yaml#/paths/Path" + /user/grass: + $ref: "./paths/user/grass.yaml#/paths/Path" components: securitySchemes: diff --git a/src/paths/user/grass.yml b/src/paths/user/grass.yml new file mode 100644 index 0000000..4583109 --- /dev/null +++ b/src/paths/user/grass.yml @@ -0,0 +1,35 @@ +# 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: getGrass + + parameters: + - name: "handle" + in: "query" + description: "사용자 ID" + required: true + schema: + type: "string" + - name: "topic" + in: "query" + description: "아직 밝혀지지 않았습니다. 항상 `today-solved`입니다." + required: true + schema: + type: "string" + responses: + "200": + description: "서버가 반환에 성공한 경우입니다." + content: + application/json: + schema: + $ref: "../../schemas/full-user.yaml#/components/schemas/FullUser" diff --git a/src/schemas/grass.yaml b/src/schemas/grass.yaml new file mode 100644 index 0000000..c5534cb --- /dev/null +++ b/src/schemas/grass.yaml @@ -0,0 +1,45 @@ +# 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: + Grass: + title: Grass + description: | + 사용자의 스트릭 및 문제를 푼 날 정보입니다. + type: "object" + required: + - grass + - currentStreak + - longestStreak + properties: + grass: + description: "문제를 푼 날짜별 푼 문제 수 목록입니다." + type: "array" + items: + type: "object" + properties: + date: + description: "문제를 푼 날짜입니다." + type: "string" + format: "YYYY-MM-dd" + example: "2023-01-26" + value: + description: "푼 문제의 수입니다." + type: "integer" + example: 35 + theme: + description: "스트릭 색상입니다." + type: "string" + example: "special_hanbyeol" + currentStreak: + description: "현재 스트릭 기간입니다." + type: "integer" + example: 0 + longestStreak: + description: "최대 스트릭 기간입니다." + type: "integer" + example: 186