-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi-docs.yml
627 lines (617 loc) · 18 KB
/
api-docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
openapi: 3.1.0
info:
description: |
2024 멋쟁이사자처럼 중앙해커톤 남송리3번지팀 데모 API 명세
version: 0.1.0
title: stepper
contact:
name: zionhann
email: [email protected]
servers:
- url: https://api.zionhann.com/stepper
description: production
- url: http://localhost:8080
description: local
security:
- X-CSRF-TOKEN: [ ]
tags:
- name: auth
description: 인증
- name: image
description: 이미지
- name: goals
description: 성장목표
- name: journals
description: 일지
- name: chats
description: AI 대화
paths:
# auth
/v1/csrf:
get:
tags:
- auth
summary: csrf 토큰 발급
description: " "
operationId: issueCsrfToken
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CsrfToken'
examples:
CsrfTokenExample:
value:
parameterName: _csrf
token: inU6CJ2UNMf
headerName: X-CSRF-TOKEN
/logout:
post:
tags:
- auth
summary: 로그아웃
description: " "
operationId: logout
responses:
"200":
description: OK
# image
/v1/images:
post:
tags:
- image
summary: 이미지 업로드
description: " "
operationId: uploadImage
requestBody:
required: true
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/S3Request'
responses:
"201":
description: Created
content:
application/json:
schema:
type: object
properties:
imageUrl:
type: string
description: 이미지 URL
examples:
S3ResponseExample:
value:
imageUrl: https://3-namsong-st.s3.ap-northeast-2.amazonaws.com/goals/b46f73d9-fa83-4331-b37d-996897280aa6.jpeg...
# goals
/v1/goals:
post:
tags:
- goals
summary: 목표 추가
description: 목표를 추가한다.
operationId: addGoal
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GoalRequest'
examples:
GoalRequestExample:
value:
title: 중앙해커톤 대상
startDate: 2024-08-06
endDate: 2024-08-07
thumbnail: https://3-namsong-st.s3.ap-northeast-2.amazonaws.com/goals/b46f73d9-fa83-4331-b37d-996897280aa6.jpeg...
responses:
"201":
description: Created
get:
tags:
- goals
summary: 내 목표 목록 조회
description: 내 목표 목록을 불러온다.
operationId: getGoals
parameters:
- name: sort
in: query
schema:
type: string
enum:
- NEWEST
- ASC
- DESC
description: |
정렬 순서.
`NEWEST`: 최신순(기본값, 생성 날짜 기준)
`ASC`: 오름차순(이름 기준)
`DESC`: 내림차순(이름 기준)
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GoalResponse'
examples:
GoalResponseExample:
value:
goals:
- goalId: 1
title: 중앙해커톤 대상
streak: 3
status: OPEN
startDate: 24.08.06
endDate: 24.08.07
thumbnail: https://3-namsong-st.s3.ap-northeast-2.amazonaws.com/goals/b46f73d9-fa83-4331-b37d-996897280aa6.jpeg...
- goalId: 2
title: 5kg 다이어트
streak: 0
status: CLOSED
/v1/goals/{goalId}:
put:
tags:
- goals
summary: 목표 수정(달성 상태 변경 포함)
description: " "
operationId: modifyGoal
parameters:
- name: goalId
in: path
required: true
schema:
type: string
description: 목표 ID
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GoalUpdateRequest'
examples:
GoalUpdateRequestExample:
value:
title: 중앙해커톤 대상
startDate: 2024-08-06
endDate: 2024-08-07
thumbnail: https://3-namsong-st.s3.ap-northeast-2.amazonaws.com/goals/b46f73d9-fa83-4331-b37d-996897280aa6.jpeg...
status: CLOSED
responses:
"200":
description: OK
delete:
tags:
- goals
summary: 목표 삭제
description: " "
operationId: deleteGoal
parameters:
- name: goalId
in: path
required: true
schema:
type: string
description: 목표 ID
responses:
"200":
description: OK
# journals
/v1/goals/{goalId}/journals:
post:
tags:
- journals
summary: 특정 목표의 일지 생성
description: " "
operationId: addJournal
parameters:
- name: goalId
in: path
description: 목표 번호
required: true
schema:
type: number
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/JournalRequest'
examples:
JournalRequestExample:
value:
title: 진행상황 공유
content: |
미팅 시간에 돌아가면서 진행상황을 공유했다. 각자의 역할은 존중하면서 하나의 프로덕트를 다같이 만들어간다는 느낌이 들어 기분이 좋았다.
thumbnail: https://3-namsong-st.s3.ap-northeast-2.amazonaws.com/goals/b46f73d9-fa83-4331-b37d-996897280aa6.jpeg...
responses:
"201":
description: Created
get:
tags:
- journals
summary: 특정 목표의 일지 목록 조회
description: " "
operationId: getJournalsOfGoal
parameters:
- name: goalId
in: path
description: 목표 번호
required: true
schema:
type: number
- name: q
in: query
description: 검색 키워드(제목+내용)
schema:
type: string
- name: sort
in: query
description: |
정렬순서
`NEWEST`: 최신순(기본값, 작성일 기준)
`OLDEST`: 오래된순(작성일 기준)
schema:
type: string
enum:
- NEWEST
- OLDEST
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
properties:
goals:
$ref: '#/components/schemas/GoalResponse'
journals:
type: array
items:
$ref: '#/components/schemas/JournalResponse'
examples:
JournalResponseExample:
value:
goal:
goalId: 1
title: 중앙해커톤 대상
streak: 3
status: OPEN
startDate: 24.08.06
endDate: 24.08.07
thumbnail: https://3-namsong-st.s3.ap-northeast-2.amazonaws.com/goals/b46f73d9-fa83-4331-b37d-996897280aa6.jpeg...
journals:
- journalId: 1
title: 진행상황 공유
createdDate: 24.07.17
thumbnail: https://3-namsong-st.s3.ap-northeast-2.amazonaws.com/goals/b46f73d9-fa83-4331-b37d-996897280aa6.jpeg...
- journalId: 2
title: 아이디어 디벨롭
createdDate: 24.07.16
thumbnail: https://3-namsong-st.s3.ap-northeast-2.amazonaws.com/goals/b46f73d9-fa83-4331-b37d-996897280aa6.jpeg...
/v1/journals/{journalId}:
get:
tags:
- journals
summary: 일지 상세정보 조회
description: " "
operationId: getJournalDetail
parameters:
- name: journalId
in: path
required: true
schema:
type: string
description: 일지 ID
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/JournalDetailResponse'
examples:
JournalDetailResponseExample:
value:
journalId: 1
title: 진행상황 공유
content: |
미팅 시간에 돌아가면서 진행상황을 공유했다. 각자의 역할은 존중하면서 하나의 프로덕트를 다같이 만들어간다는 느낌이 들어 기분이 좋았다.
createdDate: 24.07.17
put:
tags:
- journals
summary: 일지 수정
description: " "
operationId: updateJournal
parameters:
- name: journalId
in: path
required: true
schema:
type: string
description: 일지 ID
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/JournalRequest'
examples:
JournalUpdateRequestExample:
value:
title: 중앙해커톤 대상(수정)
content: 수정할 내용
thumbnail: https://3-namsong-st.s3.ap-northeast-2.amazonaws.com/goals/b46f73d9-fa83-4331-b37d-996897280aa6.jpeg...
responses:
"200":
description: OK
delete:
tags:
- journals
summary: 일지 삭제
description: " "
operationId: deleteJournal
parameters:
- name: journalId
in: path
required: true
schema:
type: string
description: 일지 ID
responses:
"200":
description: OK
# chat
/v1/goals/{goalId}/chats:
post:
tags:
- chats
summary: 특정 목표에 대해 AI로 일지 작성 채팅방 생성
description: " "
operationId: initChat
parameters:
- name: goalId
in: path
description: 목표 ID
required: true
schema:
type: number
responses:
"201":
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/ChatResponse'
examples:
ChatResponseExample:
value:
chatId: thread_StEPpEr
/v1/chats/{chatId}/history:
get:
tags:
- chats
summary: 특정 채팅방의 대화내역 조회
description: " "
operationId: getChatMessages
parameters:
- name: chatId
in: path
description: 채팅방 ID
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
properties:
messages:
type: array
items:
$ref: '#/components/schemas/ChatHistoryResponse'
examples:
ChatHistoryResponseExample:
value:
messages:
- role: CHATBOT
content: "안녕하세요 😊\n저는 당신의 성장 여정을 함께할 AI (챗봇 이름)입니다 :)"
- role: CHATBOT
content: "자신의 생각과 감정을 솔직하게 기록하면서, 매일 조금씩 더 나은 나를 발견해 보세요.\n오늘의 기록이 내일의 당신을 더욱 빛나게 할 거예요.\n자, 이제 시작해 볼까요? 당신의 이야기를 들려주세요!"
- role: CHATBOT
content: "어떤 계기로 ‘중앙해커톤 우승'이라는 목표를 가지게 되었나요?"
- role: USER
content: "한동 멋사에서 아기사자로 활동하는 동안 우승하고 싶어!"
/v1/chats/{chatId}/summary:
post:
tags:
- chats
summary: 특정 채팅방의 대화 내용 요약 (일지 초안 작성)
description: " "
operationId: chatSummary
parameters:
- name: chatId
in: path
description: 채팅방 ID
required: true
schema:
type: string
responses:
"201":
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/ChatSummaryResponse'
examples:
ChatSummaryResponseExample:
value:
content: "중앙해커톤에 참여하면서 '우승'이라는 목표를 세웠다. 활동 기간 동안 우승하고 싶다는 열망이 커졌고, 이를 위해 매주 두 번씩 모여 서비스에 대한 회의를 진행했다. 지속적으로 피드백을 주고받고, AI 챗봇 기능이 정말 중요하다는 이야기를 듣고 반드시 선보여야겠다는 다짐을 했다.\n\nAI 챗봇 기능의 발전을 위해 기능 플로우에 대한 시퀀스 다이어그램을 만들고 순차적으로 구현해 나갔다."
components:
securitySchemes:
X-CSRF-TOKEN:
type: apiKey
in: header
name: X-CSRF-TOKEN
schemas:
S3Request:
type: object
required:
- file
properties:
file:
type: string
format: binary
GoalRequest:
type: object
required:
- title
properties:
title:
type: string
description: 목표 이름
startDate:
type: string
description: 목표 시작일
endDate:
type: string
description: 목표 종료일
thumbnail:
type: string
description: 목표 썸네일 이미지
GoalUpdateRequest:
type: object
properties:
title:
type: string
description: 목표 이름
startDate:
type: string
description: 목표 시작일
endDate:
type: string
description: 목표 종료일
thumbnail:
type: string
description: 썸네일 이미지 URL
status:
type: string
enum:
- OPEN
- CLOSED
- OVERDUE
description: 목표 상태
GoalResponse:
type: object
properties:
goalId:
type: number
description: 목표 ID
title:
type: string
description: 목표 이름
streak:
type: number
description: 연속작성일수
status:
type: string
enum:
- OPEN
- CLOSED
- OVERDUE
description: 목표 상태
startDate:
type: string
description: 목표 시작일
endDate:
type: string
description: 목표 종료일
thumbnail:
type: string
description: 목표 썸네일 이미지
JournalRequest:
type: object
required:
- title
- content
properties:
title:
type: string
description: 일지제목
content:
type: string
description: 일지내용
thumbnail:
type: string
description: 썸네일 이미지 URL
JournalResponse:
type: object
properties:
journalId:
type: number
description: 일지 ID
title:
type: string
description: 일지 제목
createdDate:
type: string
description: 작성일자
thumbnail:
type: string
description: 썸네일 이미지 URL
JournalDetailResponse:
type: object
properties:
journalId:
type: number
description: 일지 ID
title:
type: string
description: 일지 제목
content:
type: string
description: 일지 내용
createdDate:
type: string
description: 작성일
CsrfToken:
type: object
properties:
parameterName:
type: string
description: csrf 파라미터 키값
token:
type: string
description: csrf 토큰
headerName:
type: string
description: csrf 헤더 키값
ChatResponse:
type: object
properties:
chatId:
type: string
description: 채팅방 ID
ChatHistoryResponse:
type: object
properties:
role:
type: string
description: 메시지 주체
content:
type: string
description: 메시지 내용
ChatSummaryResponse:
type: object
properties:
content:
type: string
description: 요약한 내용