Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SMART
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UNI-KLU
SMART
Commits
a4d43462
Commit
a4d43462
authored
5 years ago
by
Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added support for posting multiple locations at once
parent
62768e5d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
6 deletions
+43
-6
swagger.yml
.../community-detection-microservice/app/configs/swagger.yml
+33
-5
location.py
...hub/community-detection-microservice/app/rest/location.py
+10
-1
No files found.
src/data-hub/community-detection-microservice/app/configs/swagger.yml
View file @
a4d43462
...
...
@@ -57,8 +57,27 @@ paths:
200
:
description
:
"
Successful
operation"
schema
:
$ref
:
"
#/definitions/Location"
$ref
:
"
#/definitions/Location
Collection
"
/location-collections
:
post
:
operationId
:
"
rest.location.post_many"
tags
:
-
"
Locations"
summary
:
"
Add
new
location
data
collection"
parameters
:
-
in
:
body
name
:
"
Locations"
description
:
"
The
location
data
collection
to
be
added"
required
:
true
schema
:
$ref
:
"
#/definitions/LocationCollection"
responses
:
201
:
description
:
"
Successful
operation"
400
:
description
:
"
Invalid
input"
/clusters
:
get
:
operationId
:
"
rest.cluster.get"
...
...
@@ -70,7 +89,7 @@ paths:
200
:
description
:
"
Successful
operation"
schema
:
$ref
:
"
#/definitions/UserCluster"
$ref
:
"
#/definitions/UserCluster
Collection
"
/clusters/cluster.png
:
get
:
...
...
@@ -96,7 +115,7 @@ paths:
200
:
description
:
"
Successful
operation"
schema
:
$ref
:
"
#/definitions/UserCluster"
$ref
:
"
#/definitions/UserCluster
Collection
"
/agi/clusters/cluster.png
:
get
:
...
...
@@ -117,7 +136,7 @@ definitions:
properties
:
id
:
type
:
string
user
name
:
user
:
type
:
"
string"
latitude
:
type
:
"
number"
...
...
@@ -128,6 +147,11 @@ definitions:
timestamp
:
type
:
"
number"
LocationCollection
:
type
:
array
items
:
$ref
:
"
#/definitions/Location"
UserCluster
:
type
:
"
object"
properties
:
...
...
@@ -145,4 +169,8 @@ definitions:
type
:
string
example
:
0
:
[
1dc61b1a0602de0eaee9dba7eece9279c2844202
,
b4b31bbe5e12f55737e3a910827c81595fbca3eb
]
\ No newline at end of file
UserClusterCollection
:
type
:
array
items
:
$ref
:
"
#/definitions/UserCluster"
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/data-hub/community-detection-microservice/app/rest/location.py
View file @
a4d43462
...
...
@@ -6,8 +6,17 @@ repo = Repository()
def
post
():
body
=
request
.
json
repo
.
add_location
(
Location
(
body
))
insert_location
(
body
)
return
Response
(
status
=
201
)
def
post_many
():
body
=
request
.
json
for
location
in
body
:
insert_location
(
location
)
return
Response
(
status
=
201
)
def
get
():
return
[
l
.
to_serializable_dict
()
for
l
in
repo
.
get_locations
()]
def
insert_location
(
location_data
:
dict
):
repo
.
add_location
(
Location
(
location_data
))
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment