Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/user 엔드포인트 추가 #53

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
35 changes: 35 additions & 0 deletions src/paths/user/grass.yml
Original file line number Diff line number Diff line change
@@ -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"
45 changes: 45 additions & 0 deletions src/schemas/grass.yaml
Original file line number Diff line number Diff line change
@@ -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