-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspecialforces.v1.yaml
More file actions
1169 lines (1162 loc) · 35.6 KB
/
specialforces.v1.yaml
File metadata and controls
1169 lines (1162 loc) · 35.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
openapi: 3.0.0
info:
title: specialforces
version: '1.0'
contact:
name: Seong Cheol Park
url: '-'
email: gorae02@gmail.com
description: |-
Special Forces API documentation
>
모든 API는 로그인 시 발급되는 access_token을 이용해 액세스 하여야 하며,<br>
access_token이 없거나, 유효하지 않을 시 401 에러와 오류 메시지를 반환합니다.
> 운동 종류<br>
{<br>
0: 팔굽<br>
1: 윗몸<br>
2: 뜀뛰기<br>
3: 벤치프레스<br>
4: 렛풀다운 <br>
5: 레그 익스텐션 <br>
6: 레그 프레스 <br>
7: 케이블 크로스오버<br>
}
servers:
- url: 'https://spefor.ml'
paths:
/api/v1/auth/login:
post:
summary: Login API
operationId: post-api-v1-auth-login
responses:
'200':
description: 토큰 정보 응답
content:
application/json:
schema:
type: object
properties:
access_token:
type: string
expires_in:
type: integer
token_type:
type: string
scope: {}
refresh_token:
type: string
examples:
example-1:
value:
access_token: 3acfb3bea5cefc3aecc0b25f50b9539b6f5df3dc
expires_in: 3600
token_type: Bearer
scope: null
refresh_token: 636b6291c0398a16244f08b3fae42a4b277342ab
description: 로그인
requestBody:
content:
application/json:
schema:
type: object
properties:
grant_type:
type: string
client_id:
type: string
user_id:
type: string
password:
type: string
required:
- grant_type
- client_id
- user_id
- password
examples:
example-1:
value:
grant_type: password
client_id: app
user_id: someuser
password: verystrongpassword
description: |-
>앱에서 요청 시 grant_type="password", client_id="app" 입니다.<br>
Content-Type 에 유의하시기 바랍니다.(application/json)
parameters: []
security: []
tags:
- 멤버
/api/v1/test/testapi:
get:
summary: API 접근 테스트 API
tags:
- 테스트
responses:
'200':
description: API 접근 성공
headers: {}
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
message:
type: string
examples:
example-1:
value:
success: true
message: API 접근 성공!
'401':
description: Unauthorized (접근 권한 없음 - Token Invalid)
operationId: get-api-v1-test-testapi
description: API 사용 테스트
/api/v1/test/testconnection:
get:
summary: 서버 접속 테스트 API
tags:
- 테스트
responses:
'200':
description: 서버 접속 성공
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
message:
type: string
examples:
example-1:
value:
success: true
message: server all good!
operationId: get-api-v1-test-test2
description: 서버 접속 테스트 API
security: []
parameters: []
/api/v1/member/register:
parameters: []
post:
summary: 회원가입 API
operationId: post-api-v1-member-register
responses:
'200':
description: 회원가입 성공
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
message:
type: string
examples:
example-1:
value:
success: true
message: ''
headers: {}
'400':
description: '회원가입 실패(중복, 생략등의 이유)'
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
message:
type: string
examples:
example-1:
value:
success: false
message: 소속은(는) 공백일 수 없습니다
description: |-
회원가입 API
계급은 class 입니다 0: 이병, 1:일병, 2:상병, 3:병장
requestBody:
content:
application/json:
schema:
type: object
properties:
user_id:
type: string
password:
type: string
class:
type: integer
description: |-
계급입니다.
입력되지 않을 시 자동으로 이병(기본값 0)
cadre_flag:
type: boolean
description: |-
간부 여부입니다.
입력되지 않을 시 자동으로 병사(기본값 false)
army_num:
type: string
unit_id:
type: integer
email:
type: string
phone:
type: string
required:
- user_id
- password
- army_num
- unit_id
- email
- phone
examples:
example-1:
value:
user_id: someuser
password: verystrongpassword
class: 1
cadre_flag: false
army_num: 20-00000000
unit_id: 8839
email: em@i.l
phone: 010-0000-0000
description: 회원가입 요청
security: []
tags:
- 멤버
/api/v1/member/find_afflication:
get:
summary: 부대 검색 API
tags:
- 멤버
responses:
'200':
description: OK
headers: {}
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
result:
type: array
items:
type: string
examples:
example-1:
value:
success: true
result:
- 지상작전사령부 정보통신여단 111대대
- 지상작전사령부 정보통신여단 112대대
- 지상작전사령부 정보통신여단 311대대
- 지상작전사령부 정보통신여단 312대대
operationId: get-api-v1-member-findafflication
description: |-
부대를 substring 으로 검색하여 결과를 반환합니다.
(미구현 상태)
requestBody:
content:
application/json:
schema:
type: object
properties:
substring:
type: string
required:
- substring
examples:
example-1:
value:
substring: 정보통신여단
security: []
parameters: []
/api/v1/exercise/add_exercise_profile:
post:
summary: 운동 프로필 추가 API
operationId: post-api-v1-exercise-add_exercise_profile
responses:
'200':
description: 처리결과 반환
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
message:
type: string
examples: {}
'400':
description: Bad Request
content:
application/json:
schema:
description: ''
type: object
properties:
success:
type: boolean
message:
type: string
minLength: 1
required:
- success
- message
examples:
example-1:
value:
success: false
message: 입력 된 기록이 없습니다
'':
content:
application/json:
schema:
type: object
description: |
자신의 아이디에 운동 프로필을 추가합니다.
> !! exercise_weight, exercise_count, exercise_time 중 하나는 입력해야 합니다.
>운동 종류는 ___/exercise/get_exercises 에서 가져올 수 있음. 실 데이터는 Overview 참고
requestBody:
content:
application/json:
schema:
type: object
properties:
exercise_id:
type: integer
description: 운동 종류 코드입니다
exercise_weight:
type: integer
exercise_count:
type: integer
exercise_time:
type: integer
description: 분 단위
required:
- exercise_id
examples:
example-1:
value:
exercise_id: 0
exercise_weight: 0
exercise_count: 100
exercise_time: 30
description: |-
1번 예제
> 윗몸일으키기 100개, 30분 동안 함
tags:
- 운동
parameters: []
/api/v1/profile/set_weight:
post:
summary: 체중 입력 API
operationId: post-api-v1-profile-setweight
responses:
'200':
description: 처리 결과 반환
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
message:
type: string
examples:
example-1:
value:
success: true
message: ''
description: |-
자신의 체중을 입력합니다. <br>
>체중 기입일 ~ 미기입기간 ~ 기입일 사이는 현재 입력하는 체중으로 채워집니다.<br> 예) 7월 15일, 7월 20일에 180kg 입력했다면, 7/15 ~ 7/20은 180kg.
requestBody:
content:
application/json:
schema:
type: object
properties:
weight:
type: integer
required:
- weight
examples:
example-1:
value:
weight: 180
description: 체중 입력
tags:
- 프로필
parameters: []
/api/v1/profile/set_sleeptime:
parameters: []
post:
summary: 수면시간 입력 API
operationId: post-api-v1-profile-set_sleeptime
responses:
'200':
description: 처리 결과 반환
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
message:
type: string
examples:
example-1:
value:
success: true
message: ''
description: 수면 시간 입력 API입니다. 수면 시간을 입력받아 오늘의 profile에 저장합니다.
tags:
- 프로필
requestBody:
content:
application/json:
schema:
type: object
properties:
sleep_time:
type: integer
description: 분단위
examples:
example-1:
value:
sleep_time: 480
/api/v1/friend/get_friend_list:
get:
summary: 전우 목록 API
tags:
- 전우
responses:
'200':
description: OK
content:
application/json:
schema:
description: ''
type: object
properties:
success:
type: boolean
result:
type: object
properties:
requested:
type: array
uniqueItems: true
minItems: 1
items:
required:
- user_id
properties:
user_id:
type: string
minLength: 1
friend:
type: array
items:
required: []
properties: {}
required:
- requested
- friend
required:
- success
- result
examples:
example-1:
value:
success: true
result:
requested:
- user_id: string
friend:
- user_id: somefriend
operationId: get-api-friend-list
description: |-
자신의 전우 목록을 리스팅합니다
> requested 는 친구 요청 받으나, 아직 본인이 수락하지 않은 상대의 아이디.<br>
friend 는 상호 수락으로 친구가 된 상대의 아이디입니다.
parameters: []
/api/v1/friend/add_friend:
post:
summary: 전우 추가 API
operationId: post-api-v1-friend-add_friend
description: 상대를 전우로 추가합니다. 수락은 별도입니다.
requestBody:
content:
application/json:
schema:
type: object
properties:
target:
type: string
description: 상대의 아이디입니다
required:
- target
examples:
example-1:
value:
target: id_of_target
description: ''
tags:
- 전우
responses:
'200':
description: 처리 결과 반환
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
message:
type: string
examples:
example-1:
value:
success: true
message: ''
example-2:
value:
success: false
message: 이미 요청되었습니다
example-3:
value:
success: false
message: 그런 대상은 없습니다
example-4:
value:
success: false
message: 자신은 추가할 수 없습니다
parameters: []
/api/v1/friend/accept_friend:
post:
summary: 전우 추가 수락 API
operationId: post-api-v1-friend-accept_friend
responses:
'200':
description: OK
headers: {}
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
message:
type: string
examples:
example-1:
value:
success: true
message: ''
description: 상대의 전우 추가 요청을 수락합니다
requestBody:
content:
application/json:
schema:
type: object
properties:
target:
type: string
required:
- target
examples:
example-1:
value:
target: someone_to_accept
tags:
- 전우
parameters: []
/api/v1/friend/decline_friend:
post:
summary: 전우 추가 거절 API
operationId: post-api-v1-friend-decline_friend
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
message:
type: string
examples:
example-1:
value:
success: true
message: ''
description: 상대의 전우 추가 요청을 거절합니다.
requestBody:
content:
application/json:
schema:
type: object
properties:
target:
type: string
required:
- target
examples:
example-1:
value:
target: someone_to_decline
tags:
- 전우
parameters: []
/api/v1/member/get_userinfo:
get:
summary: 유저 정보 API
tags:
- 멤버
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
result:
type: array
items:
type: object
properties:
user_id:
type: string
class:
type: integer
description: 계급
army_num:
type: string
description: 군번
unit_id:
type: integer
description: 소속ID
email:
type: string
phone:
type: string
created_at:
type: string
description: 가입 시각
examples:
example-1:
value:
success: true
result:
- user_id: string
class: '0'
army_num: string
unit_id: '123'
email: string
phone: string
created_at: '2020-09-29 23:44:40'
'':
content:
application/json:
schema:
description: ''
type: object
properties:
success:
type: boolean
result:
type: array
uniqueItems: true
minItems: 1
items:
required:
- user_id
- class
- army_num
- unit_id
- email
- phone
- created_at
properties:
user_id:
type: string
minLength: 1
class:
type: string
minLength: 1
army_num:
type: string
minLength: 1
unit_id:
type: string
minLength: 1
email:
type: string
minLength: 1
phone:
type: string
minLength: 1
created_at:
type: string
minLength: 1
required:
- success
- result
examples:
example-1:
value:
success: true
result:
- user_id: string
class: '0'
army_num: string
unit_id: '123'
email: string
phone: string
created_at: '2020-09-29 23:44:40'
operationId: get-api-v1-member-get_userinfo
description: |-
유저의 정보를 반환하는 API 입니다.
주로 로그인 직후에 유저 정보를 받아오거나, 유저 정보를 갱신할 필요가 있을 때 사용합니다.
parameters: []
/api/v1/exercise/get_exercise_ids:
get:
summary: 운동 종목 모두 가져오기 API
tags:
- 운동
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
result:
type: array
items:
type: string
examples:
example-2:
value:
success: true
result:
- exercise_id: '0'
exercise_name: 팔굽혀펴기
exercise_part: ''
- exercise_id: '1'
exercise_name: 윗몸일으키기
exercise_part: ''
- exercise_id: '2'
exercise_name: 뜀뛰기
exercise_part: ''
- exercise_id: '3'
exercise_name: 벤치프레스
exercise_part: ''
- exercise_id: '4'
exercise_name: 렛풀다운
exercise_part: ''
- exercise_id: '5'
exercise_name: 레그 익스텐션
exercise_part: ''
- exercise_id: '6'
exercise_name: 레그 프레스
exercise_part: ''
- exercise_id: '7'
exercise_name: 케이블 크로스오버
exercise_part: ''
'':
content:
application/json:
schema:
description: ''
type: object
properties:
success:
type: boolean
result:
type: array
uniqueItems: true
minItems: 1
items:
required:
- exercise_id
- exercise_name
- exercise_part
properties:
exercise_id:
type: string
minLength: 1
exercise_name:
type: string
minLength: 1
exercise_part:
type: string
required:
- success
- result
examples:
example-1:
value:
success: true
result:
- exercise_id: '0'
exercise_name: 팔굽혀펴기
exercise_part: ''
- exercise_id: '1'
exercise_name: 윗몸일으키기
exercise_part: ''
- exercise_id: '2'
exercise_name: 뜀뛰기
exercise_part: ''
- exercise_id: '3'
exercise_name: 벤치프레스
exercise_part: ''
- exercise_id: '4'
exercise_name: 렛풀다운
exercise_part: ''
- exercise_id: '5'
exercise_name: 레그 익스텐션
exercise_part: ''
- exercise_id: '6'
exercise_name: 레그 프레스
exercise_part: ''
- exercise_id: '7'
exercise_name: 케이블 크로스오버
exercise_part: ''
description: 결과
operationId: get-api-v1-exercise-get_exercises_ids
description: 가능한 운동(종목) 정보 을 모두 가져옵니다.
parameters: []
/api/v1/profile/set_height:
post:
summary: 신장 입력 API
operationId: post-api-v1-profile-set_height
responses:
'200':
description: OK
content:
application/json:
schema:
description: ''
type: object
properties:
success:
type: boolean
message:
type: string
required:
- success
- message
examples:
example-1:
value:
success: true
message: ''
tags:
- 프로필
description: 신장 입력(cm)
requestBody:
content:
application/json:
schema:
type: object
properties:
height:
type: integer
examples:
example-1:
value:
height: 180
/api/v1/profile/set_calorie:
post:
summary: 칼로리 입력 API
operationId: post-api-v1-profile-set_calorie
responses:
'200':
description: OK
content:
application/json:
schema:
description: ''
type: object
properties:
success:
type: boolean
message:
type: string
required:
- success
- message
examples:
example-1:
value:
success: true
message: ''
tags:
- 프로필
description: 칼로리 입력 (kcal)
requestBody:
content:
application/json:
schema:
type: object
properties:
calorie:
type: integer
examples:
example-1:
value:
calorie: 2200
/api/v1/profile/get_profile:
post:
summary: 일일 프로필 가져오기 API
operationId: post-api-v1-profile-get_profile
responses:
'200':
description: OK
content:
application/json:
schema:
description: ''
type: object
properties:
success:
type: boolean
result:
type: array
items:
type: object
properties:
profile_id:
type: integer
user_id:
type: string
date:
type: string
description: YYYY-MM-DD
weight:
type: integer
height:
type: integer
calorie:
type: integer
sleep_time:
type: integer
examples:
example-1:
value:
success: true
result:
- profile_id: '19'
user_id: string
date: '2020-10-06'
weight: '3'
height: null
calorie: null
sleep_time: null
example-2:
value:
success: true
result:
- profile_id: '16'
user_id: string
date: '2020-10-05'
weight: '3'
height: '190'
calorie: '2200'
sleep_time: '240'