-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi-document.yml
231 lines (227 loc) · 5.75 KB
/
api-document.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
openapi: 3.0.2
info:
title: DeNA Autumn Hackathon C Team
version: 1.0.0
servers:
- url: http://localhost:8081/api/v1
tags:
- name: geo
description: 位置情報関連 API
- name: locus
description: 移動軌跡関連 API
paths:
/geo:
get:
tags:
- geo
summary: 位置情報取得 API
description: |
位置情報を取得します。
parameters:
- in: query
name: top
schema:
type: number
format: float
required: true
- in: query
name: bottom
schema:
type: number
format: float
required: true
- in: query
name: left
schema:
type: number
format: float
required: true
- in: query
name: right
schema:
type: number
format: float
required: true
responses:
200:
description: A successful response.
content:
application/json:
schema:
$ref: "#/components/schemas/GetGeoResponse"
post:
tags:
- geo
summary: 位置情報アップロード API
description: |
位置情報をアップロードします。
もし、リクエストしたユーザが前回位置情報を送信してから誰かに囲まれていた場合、囲まれた情報を返します。
requestBody:
description: Request Body
content:
application/json:
schema:
$ref: "#/components/schemas/PostGeoRequest"
required: true
responses:
200:
description: A successful response.
content:
application/json:
schema:
$ref: "#/components/schemas/PostGeoResponse"
/locus:
post:
tags:
- locus
summary: 移動軌跡チェック API
description: |
移動軌跡を送信します。
もし、軌跡の中にユーザが存在すれば、囲んだユーザとその位置情報を返します。
requestBody:
description: Request Body
content:
application/json:
schema:
$ref: "#/components/schemas/PostLocusRequest"
required: true
responses:
200:
description: A successful response.
content:
application/json:
schema:
$ref: "#/components/schemas/PostLocusResponse"
/locus/{id}:
get:
tags:
- locus
summary: 移動軌跡取得 API
description: |
移動軌跡を取得します。
parameters:
- in: path
name: id
schema:
type: integer
required: true
responses:
200:
description: A successful response.
content:
application/json:
schema:
$ref: "#/components/schemas/GetLocusResponse"
components:
schemas:
GetGeoResponse:
type: object
properties:
users:
type: array
items:
type: object
properties:
id:
type: integer
description: ユーザ ID
username:
type: string
description: ユーザネーム
latitude:
type: number
format: float
longitude:
type: number
format: float
PostGeoRequest:
type: object
properties:
user_id:
type: integer
description: ユーザ ID
latitude:
type: number
format: float
description: 緯度
longitude:
type: number
format: float
description: 経度
PostGeoResponse:
type: object
properties:
locus_id:
type: integer
description: 軌跡 ID
user_id:
type: integer
description: ユーザ ID
username:
type: string
description: ユーザネーム
datetime:
type: string
format: date-time
description: 囲まれた日時
GetLocusResponse:
type: object
properties:
user_id:
type: integer
description: ユーザ ID
username:
type: string
description: ユーザネーム
locus:
type: array
items:
type: object
properties:
latitude:
type: number
format: float
description: 緯度
longitude:
type: number
format: float
description: 経度
PostLocusRequest:
type: object
properties:
user_id:
type: integer
description: ユーザID
locus:
type: array
items:
type: object
properties:
latitude:
type: number
format: float
description: 緯度
longitude:
type: number
format: float
description: 経度
PostLocusResponse:
type: object
properties:
users:
type: array
items:
type: object
properties:
id:
type: integer
description: ユーザ ID
username:
type: string
description: ユーザネーム
latitude:
type: number
format: float
longitude:
type: number
format: float