-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathswagger.yaml
More file actions
1150 lines (1150 loc) · 31.6 KB
/
swagger.yaml
File metadata and controls
1150 lines (1150 loc) · 31.6 KB
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
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
swagger: '2.0'
info:
description: 라이블 API
version: 1.0.0
title: Livle App API
host: api.livle.kr
basePath: /dev
tags:
- name: user
description: 라이블 일반 회원 (앱)
- name: partner
description: 공연기획사 회원 (웹)
- name: ticket
description: 콘서트 정보
- name: reservation
description: '콘서트 예약 정보 [미구현]'
- name: subscription
description: 구독 정보
- name: file
description: 파일 관리
schemes:
- https
paths:
/user:
post:
tags:
- user
summary: 회원가입
description: '이메일, 비밀번호 validation은 클라이언트에서 해주세요.'
consumes:
- application/json
parameters:
- name: user
in: body
description: 가입할 유저의 아이디와 비밀번호
required: true
schema:
type: object
properties:
email:
type: string
example: [email protected]
password:
type: string
example: '12345'
nickname:
type: string
example: 라이블
description: optional
fcmToken:
type: string
description: 푸시 알림을 보내기 위한 기기 식별토큰
responses:
'200':
description: 가입 성공
schema:
$ref: '#/definitions/UserSession'
'400':
description: 잘못된 요청 (이메일이나 비밀번호가 없음)
'403':
description: 이미 존재하는 아이디
'404':
description: 존재하지 않는 이메일 주소
'405':
description: 잘못된 이메일 형식
delete:
tags:
- user
summary: 탈퇴
description: '이메일, 비밀번호 validation은 클라이언트에서 해주세요.'
consumes:
- application/json
parameters:
- name: user
in: body
description: 탈퇴할 유저의 아이디와 비밀번호
required: true
schema:
type: object
properties:
email:
type: string
example: [email protected]
password:
type: string
example: '12345'
responses:
'200':
description: 탈퇴 성공
'400':
description: 잘못된 요청 (이메일이나 비밀번호가 없음)
'403':
description: 비밀번호가 틀립니다.
'404':
description: 해당 이메일의 유저가 없습니다.
'405':
description: 구독 중인 유저입니다. 탈퇴 전에 구독을 취소해야 합니다.
get:
tags:
- user
summary: 회원정보 가져오기
consumes:
- application/json
produces:
- application/json
parameters:
- name: Authorization
in: header
type: string
description: JWT Token
required: true
- name: fcmToken
in: query
description: 현재 기기의 fcm 토큰
required: true
type: string
responses:
'200':
description: 성공
schema:
$ref: '#/definitions/UserData'
'401':
description: 헤더에 토큰이 없음
'403':
description: 헤더에 토큰이 있지만 유효하지 않음
/user/facebook:
post:
tags:
- user
summary: 페이스북 가입 / 로그인
parameters:
- name: accessToken
in: body
required: true
schema:
type: object
properties:
accessToken:
type: string
fcmToken:
type: string
description: 푸시 알림을 보내기 위한 기기 식별토큰
responses:
'200':
description: '기존 계정을 발견, 로그인'
schema:
$ref: '#/definitions/UserSession'
'201':
description: '기존 유저가 아님, 신규가입됨'
schema:
$ref: '#/definitions/UserSession'
'400':
description: access_token이 없음
'401':
description: access_token이 유효하지 않음
'403':
description: 이메일로 가입한 내용이 있음. 이메일로 로그인할 것
/user/password:
get:
tags:
- user
summary: 비밀번호 재설정 이메일 보내기
consumes:
- application/json
produces:
- application/json
parameters:
- name: email
in: query
description: 비밀번호를 재설정할 이메일
required: true
type: string
responses:
'200':
description: 이메일 전송
'400':
description: 이메일이 없거나 잘못된 형식
'404':
description: 해당하는 유저가 없음
post:
tags:
- user
summary: 비밀번호 재설정하기
consumes:
- application/json
produces:
- application/json
parameters:
- name: params
in: body
schema:
type: object
properties:
password:
type: string
example: abcde
description: 새로운 비밀번호
token:
type: string
example: f7QdxGje
description: 이메일에 포함된 비밀번호 변경 토큰
responses:
'200':
description: 변경 성공
'400':
description: 비밀번호나 토큰이 없음
'404':
description: 잘못된 토큰
/user/session:
post:
tags:
- user
summary: 로그인
consumes:
- application/json
produces:
- application/json
parameters:
- name: user
in: body
description: 로그인할 유저의 아이디와 비밀번호
required: true
schema:
type: object
properties:
email:
type: string
example: [email protected]
password:
type: string
example: '12345'
fcmToken:
type: string
description: 푸시 알림을 보내기 위한 기기 식별토큰
responses:
'200':
description: 로그인 성공
schema:
$ref: '#/definitions/UserSession'
'400':
description: 이메일 또는 비밀번호가 없거나 잘못됨
'403':
description: 해당 아이디로 가입된 정보는 있으나 비밀번호가 틀림
'404':
description: 해당 아이디로 가입된 정보가 없음
delete:
tags:
- user
summary: 로그아웃 - Session Storage 이용하지 않으므로 불필요
responses:
'200':
description: 로그아웃 성공
/user/list:
get:
tags:
- user
summary: '모든 회원정보 가져오기 [관리자]'
consumes:
- application/json
produces:
- application/json
parameters:
- name: Authorization
in: header
type: string
description: 관리자의 Partner 계정의 토큰입니다.
required: true
- name: page
in: query
type: string
required: true
- name: email
in: query
type: string
responses:
'200':
description: 성공
schema:
type: object
properties:
total_pages:
type: integer
example: 10
current_page:
type: integer
example: 1
data:
type: array
items:
$ref: '#/definitions/UserData'
'401':
description: 헤더에 토큰이 없음
'403':
description: 헤더에 토큰이 있지만 유효하지 않음
'/user/{userId}/suspend':
delete:
tags:
- user
summary: '[관리자] 유저 이용정지 해제하기'
parameters:
- name: Authorization
in: header
type: string
description: 관리자의 Partner 계정의 토큰입니다.
required: true
- name: userId
in: path
required: true
type: integer
format: int64
responses:
'200':
description: '성공, 상세 구독 정보는 제외하고 리턴됩니다'
schema:
$ref: '#/definitions/UserData'
'401':
description: 로그인되지 않음
'403':
description: 권한이 없음
/partner:
post:
tags:
- partner
summary: 회원가입
description: '이메일, 비밀번호 validation은 클라이언트에서 해주세요.'
consumes:
- application/json
parameters:
- name: partner
in: body
description: 가입할 유저의 아이디와 비밀번호
required: true
schema:
type: object
properties:
company:
type: string
example: 라이블
username:
type: string
example: livle
password:
type: string
example: '12345'
responses:
'200':
description: 가입 성공
schema:
$ref: '#/definitions/Partner'
'400':
description: 잘못된 요청 (이메일이나 비밀번호가 없음)
'403':
description: 이미 존재하는 아이디
'405':
description: 잘못된 이메일 형식
get:
tags:
- partner
summary: 세션 체크
consumes:
- application/json
produces:
- application/json
parameters:
- name: Authorization
in: header
description: 세션 정보를 담고 있는 토큰
required: true
type: string
responses:
'200':
description: 로그인된 유저
schema:
$ref: '#/definitions/Partner'
'401':
description: 로그인되지 않은 상태
'403':
description: 유효하지 않은 세션
/partner/session:
post:
tags:
- partner
summary: 로그인
consumes:
- application/json
produces:
- application/json
parameters:
- name: body
in: body
schema:
type: object
properties:
username:
type: string
example: [email protected]
password:
type: string
example: '12345'
responses:
'200':
description: 로그인 성공
schema:
$ref: '#/definitions/Partner'
'400':
description: 이메일 또는 비밀번호가 없거나 잘못됨
'401':
description: 아직 승인되지 않은 계정임
'403':
description: 일치하는 회원이 없음
/partner/list:
get:
tags:
- partner
summary: '모든 파트너 정보 [관리자]'
consumes:
- application/json
parameters:
- name: Authorization
in: header
description: 세션 정보를 담고 있는 토큰
required: true
type: string
- name: page
in: query
type: string
required: true
- name: username
in: query
type: string
- name: company
in: query
type: string
- name: approved
in: query
type: string
description: true | false
responses:
'200':
description: 성공
schema:
type: object
properties:
total_pages:
type: integer
example: 10
current_page:
type: integer
example: 1
data:
type: array
items:
$ref: '#/definitions/Partner'
'401':
description: 헤더에 토큰이 없음
'403':
description: 헤더에 토큰이 있지만 유효하지 않음
'/partner/{partnerId}/approve':
post:
tags:
- partner
summary: '파트너 가입 승인 [관리자]'
parameters:
- name: partnerId
in: path
required: true
type: integer
format: int64
- name: Authorization
in: header
description: 세션 정보를 담고 있는 토큰
required: true
type: string
responses:
'200':
description: 성공
schema:
$ref: '#/definitions/Partner'
'401':
description: 헤더에 토큰이 없음
'403':
description: 헤더에 토큰이 있지만 유효하지 않거나 권한이 없음
/ticket:
get:
tags:
- ticket
summary: 일주일 간의 티켓 정보 가져오기
produces:
- application/json
responses:
'200':
description: 성공
schema:
type: array
items:
$ref: '#/definitions/Ticket'
post:
tags:
- ticket
summary: '[관리자] 새로운 티켓 등록하기'
parameters:
- name: Authorization
in: header
description: 세션 정보를 담고 있는 토큰
required: true
type: string
- name: ticket
in: body
required: true
description: >-
Required: partner_id, title, start_at, end_at, image, capacity /
Forbidden: id와 reservations는 없어야 합니다.
schema:
$ref: '#/definitions/TicketDetail'
responses:
'200':
description: 성공
schema:
$ref: '#/definitions/Ticket'
'401':
description: 로그인되지 않음
'403':
description: 관리자가 아님
'/ticket/{ticketId}':
patch:
tags:
- ticket
summary: '[관리자] 등록된 티켓 정보 수정하기'
parameters:
- name: Authorization
in: header
description: 세션 정보를 담고 있는 토큰
required: true
type: string
- name: ticketId
in: path
required: true
type: integer
format: int64
- name: ticket
in: body
required: true
schema:
$ref: '#/definitions/Ticket'
responses:
'200':
description: 성공
schema:
$ref: '#/definitions/Ticket'
'401':
description: 로그인되지 않음
'403':
description: 관리자가 아님
delete:
tags:
- ticket
summary: '[관리자] 등록된 티켓 정보 삭제하기'
parameters:
- name: Authorization
in: header
description: 세션 정보를 담고 있는 토큰
required: true
type: string
- name: ticketId
in: path
required: true
type: integer
format: int64
responses:
'200':
description: 성공
'401':
description: 로그인되지 않음
'403':
description: 관리자가 아님
'405':
description: 이 공연의 취소되지 않은 예약이 남아있음
'/ticket/{ticketId}/stats':
get:
tags:
- ticket
summary: (파트너) 티켓 하나의 상세 정보
parameters:
- name: Authorization
in: header
description: 세션 정보를 담고 있는 토큰
required: true
type: string
- name: ticketId
in: path
required: true
type: integer
format: int64
responses:
'200':
description: 성공
schema:
$ref: '#/definitions/TicketDetail'
'401':
description: 로그인되지 않음 (세션토큰이 없음)
'403':
description: 권한이 없음
'404':
description: 해당 아이디의 공연을 찾을 수 없음
'/ticket/{ticketId}/reserve':
post:
tags:
- ticket
summary: 티켓 예약하기
produces:
- application/json
parameters:
- name: Authorization
in: header
description: 세션 정보를 담고 있는 토큰
required: true
type: string
- name: ticketId
in: path
description: 예약할 티켓 아이디
required: true
type: integer
format: int64
responses:
'200':
description: 예약 성공
schema:
$ref: '#/definitions/Reservation'
'400':
description: 이미 시작한 공연
'403':
description: 구독 중인 유저가 아니거나 패널티를 받고 있음
'404':
description: 해당 티켓을 찾을 수 없음
'405':
description: >-
예약 실패 (case 1) 이미 예약한 공연 (case 2) 잔여 좌석이 없음 (case 3) 예약 기회가 소진됨 (기간
내에 2개 예약함)
/ticket/list:
get:
tags:
- ticket
summary: (파트너) 티켓 정보 가져오기
description: >-
관리자의 경우 partnerId 쿼리를 설정하지 않으면 모든 티켓 정보를 가져오고, 설정하는 경우 해당 파트너의 티켓 정보를
가져옵니다. 파트너의 경우 자신의 티켓 정보를 가져오며, partnerId를 설정하는 경우 403 에러를 반환합니다.
parameters:
- name: Authorization
in: header
description: 세션토큰
required: true
type: string
- name: page
in: query
type: string
required: true
- name: parnterId
in: query
type: string
description: 관리자만 설정할 수 있습니다. 관리자가 아닌데 설정한 경우 403 에러
- name: title
in: query
type: string
- name: state
in: query
type: string
description: due | end
responses:
'200':
description: 성공
schema:
type: object
properties:
total_pages:
type: integer
example: 10
current_page:
type: integer
example: 1
data:
type: array
items:
$ref: '#/definitions/Ticket'
'401':
description: 로그인되지 않음
/reservation:
get:
tags:
- reservation
summary: 예약 정보 가져오기
description: '입장된 것, 미입장된 것 모두 가져옵니다. checked_at이 null이면 아직 미입장.'
parameters:
- name: Authorization
in: header
description: 세션토큰
required: true
type: string
responses:
'200':
description: 성공
schema:
type: array
items:
$ref: '#/definitions/Reservation'
'401':
description: 로그인되지 않음
'/reservation/{reservationId}':
delete:
tags:
- reservation
summary: 예약 취소하기
parameters:
- name: reservationId
in: path
description: 예약 아이디
required: true
type: integer
format: int64
- name: Authorization
in: header
description: 세션토큰
required: true
type: string
responses:
'200':
description: 성공
'401':
description: 로그인되지 않음
'403':
description: 공연 시작까지 4시간보다 적게 남음
'404':
description: 잘못된 예약 아이디이거나 이 유저의 예약이 아님
'405':
description: 이미 체크인처리가 된 예약
'/reservation/{reservationId}/check':
post:
tags:
- reservation
summary: 체크인하기
parameters:
- name: reservationId
in: path
description: 예약 아이디
required: true
type: integer
format: int64
- name: Authorization
in: header
description: 세션토큰
required: true
type: string
- name: code
in: body
required: true
schema:
type: object
properties:
code:
type: string
example: '1234'
responses:
'200':
description: 체크인 성공
schema:
$ref: '#/definitions/Reservation'
'400':
description: 요청에 코드가 없음
'401':
description: 로그인되지 않음
'403':
description: 잘못된 체크인 코드
'404':
description: 잘못된 예약 아이디이거나 이 유저의 예약이 아님
'405':
description: 이미 체크인 함
/subscription:
post:
tags:
- subscription
summary: 구독
description: 결제 Validation 등
parameters:
- name: Authorization
in: header
description: 세션토큰
required: true
type: string
- name: payment
in: body
required: true
schema:
$ref: '#/definitions/PaymentParams'
responses:
'200':
description: 구독 성공
schema:
$ref: '#/definitions/UserData'
'400':
description: 결제 정보 중 누락된 것이 있음
'401':
description: 로그인되지 않음
'402':
description: 결제 정보 인증은 되었으나 결제 실패
'403':
description: 결제 정보 인증에 실패
'405':
description: 이미 구독 중
'406':
description: 이미 무료 체험을 시도한 카드
patch:
tags:
- subscription
summary: 구독 정보 변경
parameters:
- name: Authorization
in: header
description: 세션토큰
required: true
type: string
- name: payment
in: body
required: true
schema:
$ref: '#/definitions/PaymentParams'
responses:
'200':
description: '업데이트 성공, 결제는 이루어지지 않음'
schema:
$ref: '#/definitions/UserData'
'201':
description: '업데이트 성공, 결제 실패 내용 결제됨'
schema:
$ref: '#/definitions/UserData'
'400':
description: 결제 정보 중 누락된 것이 있음
'401':
description: 로그인되지 않음
'402':
description: 결제 정보 인증은 되었으나 결제 실패
'403':
description: 결제 정보 인증에 실패
'404':
description: 구독 중이 아님
delete:
tags:
- subscription
summary: 구독 취소
parameters:
- name: Authorization
in: header
description: 세션토큰
required: true
type: string
responses:
'200':
description: 구독 취소 성공
schema:
$ref: '#/definitions/UserData'
'401':
description: 로그인되지 않음
'404':
description: 구독 중인 내역이 없음
/subscription/restore:
post:
tags:
- subscription
summary: 취소한 구독을 복원
parameters:
- name: Authorization
in: header
description: 세션토큰
required: true
type: string
responses:
'200':
description: '업데이트 성공, 결제는 이루어지지 않음'
schema:
$ref: '#/definitions/UserData'
'401':
description: 로그인되지 않음
'403':
description: 복구할 수 있는 상태가 아님 (미납이거나 취소한 적이 없음)
'404':
description: 복구할 구독이 없음
'/subscription/{subscriptionId}/limit':
patch:
tags:
- subscription
summary: '[관리자] 유저의 예약 가능 횟수를 변경'
parameters:
- name: Authorization
in: header
description: 세션토큰
required: true
type: string
- name: subscriptionId
in: path
required: true
type: string
- name: limit
in: body
required: true
schema:
type: object
properties:
limit:
type: integer
example: 3
responses:
'200':
description: 업데이트 성공
'401':
description: 로그인되어 있지 않음
'403':
description: 권한이 없음
/file:
get:
tags:
- file
summary: S3에 업로드하기 위해 인증
parameters:
- name: Authorization
in: header
description: 세션 정보를 담고 있는 토큰
required: true
type: string
responses:
'200':
description: 인증됨
schema:
type: object
properties:
signedUrl:
type: string
description: 파일을 업로드할 action의 주소
example: 'https://livle.s3.aws.com/upload/token12345'
filePath:
type: string
description: 업로드될 파일 주소
example: >-
https://s3.ap-northeast-2.amazonaws.com/livle/55b48f00-cf71-11e7-b3f4-ddd786cc1c81
'401':
description: 로그인되지 않음
'403':
description: 권한이 없음 ([email protected]만 가능)
definitions:
UserSession:
type: object
properties:
email:
type: string
example: [email protected]
nickname:
type: string
example: 라이블
token:
type: string
description: >-
회원가입 또는 로그인 시에만 전달됨. 클라이언트에 저장해두고 요청보낼 때 header에 Authorization이라는 이름으로
포함하기.
UserData:
type: object
properties:
email:
type: string
example: [email protected]
nickname:
type: string
example: 라이블
cardName:
type: string
example: 신한카드
lastFourDigits:
type: string
example: '1234'
description: 카드 마지막 4자리
suspendedBy:
type: string
description: 패널티로 라이블을 이용할 수 없는 기간
freeTrial:
type: object
properties:
createdAt:
type: string
description: '무료 체험 일련번호, 체험한 적이 없으면 null'
currentSubscription:
$ref: '#/definitions/Subscription'
nextSubscription:
$ref: '#/definitions/Subscription'
Subscription:
type: object
properties:
from:
type: string
example: '2018-01-03T15:00:00.467Z'
description: 이 구독 유효기간의 시작
to:
type: string
example: '2018-01-10T14:59:59.467Z'
description: 이 구독 유효기간의 끝