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
f6840670
Commit
f6840670
authored
Oct 08, 2020
by
Bogdan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Schema Mapping
parent
520f4749
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
82 additions
and
321 deletions
+82
-321
add_carsharing_schema.py
...add_use_case_scripts/car_sharing/add_carsharing_schema.py
+7
-5
add_car.py
...e/app/_add_use_case_scripts/car_sharing/tables/add_car.py
+17
-134
add_hash.py
.../app/_add_use_case_scripts/car_sharing/tables/add_hash.py
+6
-34
add_offer.py
...app/_add_use_case_scripts/car_sharing/tables/add_offer.py
+13
-37
add_publication.py
...dd_use_case_scripts/car_sharing/tables/add_publication.py
+14
-60
add_travel.py
...pp/_add_use_case_scripts/car_sharing/tables/add_travel.py
+15
-41
add_user.py
.../app/_add_use_case_scripts/car_sharing/tables/add_user.py
+10
-10
No files found.
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing/add_carsharing_schema.py
View file @
f6840670
...
...
@@ -11,7 +11,7 @@ for modules_path in modules_paths:
# import _add_use_case_scripts.car_sharing.tables.add_user as user
from
_add_use_case_scripts.car_sharing.tables
import
add_user
,
add_car
,
add_hash
from
_add_use_case_scripts.car_sharing.tables
import
add_car
,
add_hash
,
add_offer
,
add_publication
,
add_travel
,
add_user
# import _add_use_case_scripts.car_sharing.tables.add_user as user
# from _add_use_case_scripts.car_sharing.tables import add_car
...
...
@@ -49,7 +49,9 @@ if __name__ == "__main__":
add_use_case
(
use_case
)
add_user
.
main
(
use_case
)
#car.main(use_case)
#offer.main(use_case)
#travel.main(use_case)
#add_hash.main(use_case)
\ No newline at end of file
# add_car.main(use_case)
# add_hash.main(use_case)
# add_offer.main(use_case)
# add_publication.main(use_case)
# add_travel.main(use_case)
\ No newline at end of file
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing/tables/add_car.py
View file @
f6840670
# def add_car_layers():
# use_case = "car-sharing"
# layers = [
# {
# "use_case": use_case,
# "name": "doctype_layer",
# "properties": [
# "UniqueID",
# "doctype",
# ],
# "cluster_properties": [
# "doctype",
# ]
# },
# {
# "use_case": use_case,
# "name": "brand_layer",a
# "properties": [
# "UniqueID",
# "brand",
# ],
# "cluster_properties": [
# "brand",
# ]
# },
# {
# "use_case": use_case,
# "name": "model_layer",
# "properties": [
# "UniqueID",
# "model",
# ],
# "cluster_properties": [
# "model",
# ]
# },
# {
# "use_case": use_case,
# "name": "colour_layer",
# "properties": [
# "UniqueID",
# "colour",
# ],
# "cluster_properties": [
# "colour",
# ]
# },
# {
# "use_case": use_case,
# "name": "seats_layer",
# "properties": [
# "UniqueID",
# "seats",
# ],
# "cluster_properties": [
# "seats",
# ]
# },
# {
# "use_case": use_case,
# "name": "year_layer",
# "properties": [
# "UniqueID",
# "year",
# ],
# "cluster_properties": [
# "year",
# ]
# },
# ]
# jwt = TokenManager.getInstance().getToken()
# for layer in layers:
# url = f"https://articonf1.itec.aau.at:30420/api/layers"
# response = requests.post(
# url,
# verify=False,
# proxies = { "http":None, "https":None },
# headers = { "Authorization": f"Bearer {jwt}"},
# json = layer
# )
# if response.status_code == 200:
# print(f"Response: {response.status_code}")
# else:
# print(f"Response: {response.status_code}: {response.text}")
import
network_constants
as
nc
from
security.token_manager
import
TokenManager
import
requests
from
_add_use_case_scripts.car_sharing.tables.requestPost
import
postLayersToSwagger
,
postTableToSwagger
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
use_case
=
"car-sharing"
columns
=
[
...
...
@@ -109,7 +15,7 @@ def add_table(use_case: str, table_name:str):
"colour"
,
"seats"
,
"year"
,
"ownerI
d
"
,
"ownerI
D
"
,
"deleted"
,
"state"
,
"observations"
...
...
@@ -118,23 +24,13 @@ def add_table(use_case: str, table_name:str):
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"carLicensePlate"
url
=
f
"https://articonf1.itec.aau.at:30420/api/use-cases/{use_case}/tables"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
response
=
requests
.
post
(
url
,
verify
=
False
,
proxies
=
{
"http"
:
None
,
"https"
:
None
},
headers
=
{
"Authorization"
:
f
"Bearer {jwt}"
},
json
=
table
)
postTableToSwagger
(
use_case
,
table
)
print
(
url
+
": "
+
str
(
response
.
status_code
))
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
...
...
@@ -143,13 +39,13 @@ def add_layers(use_case:str, table_name: str):
"table"
:
table_name
,
"name"
:
"GeneralCar_layer"
,
"properties"
:
[
"UniqueI
d
"
,
"UniqueI
D
"
,
"brand"
,
"model"
,
"colour"
,
"seats"
,
"year"
,
"ownerI
d
"
,
"ownerI
D
"
,
"deleted"
,
"state"
],
...
...
@@ -159,7 +55,7 @@ def add_layers(use_case:str, table_name: str):
"model"
,
"seats"
,
"year"
,
"ownerI
d
"
,
"ownerI
D
"
,
"state"
]
},
...
...
@@ -168,19 +64,19 @@ def add_layers(use_case:str, table_name: str):
"table"
:
table_name
,
"name"
:
"Owner_layer"
,
"properties"
:
[
"UniqueI
d
"
,
"UniqueI
D
"
,
"brand"
,
"model"
,
"colour"
,
"seats"
,
"year"
,
"ownerI
d
"
,
"ownerI
D
"
,
"deleted"
,
"state"
],
"cluster_properties"
:
[
"OwnerI
d
"
,
"UniqueI
d
"
"OwnerI
D
"
,
"UniqueI
D
"
]
},
{
...
...
@@ -188,13 +84,13 @@ def add_layers(use_case:str, table_name: str):
"table"
:
table_name
,
"name"
:
"CarAge_layer"
,
"properties"
:
[
"UniqueI
d
"
,
"UniqueI
D
"
,
"brand"
,
"model"
,
"colour"
,
"seats"
,
"year"
,
"ownerI
d
"
,
"ownerI
D
"
,
"deleted"
,
"state"
],
...
...
@@ -209,13 +105,13 @@ def add_layers(use_case:str, table_name: str):
"table"
:
table_name
,
"name"
:
"Model_layer"
,
"properties"
:
[
"UniqueI
d
"
,
"UniqueI
D
"
,
"brand"
,
"model"
,
"colour"
,
"seats"
,
"year"
,
"ownerI
d
"
,
"ownerI
D
"
,
"deleted"
,
"state"
],
...
...
@@ -231,8 +127,8 @@ def add_layers(use_case:str, table_name: str):
"table"
:
table_name
,
"name"
:
"CarState_layer"
,
"properties"
:
[
"UniqueI
d
"
,
"ownerI
d
"
,
"UniqueI
D
"
,
"ownerI
D
"
,
"deleted"
,
"state"
],
...
...
@@ -243,20 +139,7 @@ def add_layers(use_case:str, table_name: str):
}
]
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
for
layer
in
layers
:
url
=
f
"https://articonf1.itec.aau.at:30420/api/layers"
response
=
requests
.
post
(
url
,
verify
=
False
,
proxies
=
{
"http"
:
None
,
"https"
:
None
},
headers
=
{
"Authorization"
:
f
"Bearer {jwt}"
},
json
=
layer
)
print
(
url
+
": "
+
str
(
response
.
status_code
))
postLayersToSwagger
(
use_case
,
layers
)
def
main
(
use_case
:
str
):
print
(
"CAR"
)
...
...
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing/tables/add_hash.py
View file @
f6840670
import
network_constants
as
nc
from
security.token_manager
import
TokenManager
import
requests
from
_add_use_case_scripts.car_sharing.tables.requestPost
import
postLayersToSwagger
,
postTableToSwagger
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
# TODO Manuel: check back with alex
...
...
@@ -33,23 +29,12 @@ def add_table(use_case: str, table_name: str):
columns
[
"username"
]
=
"connection//username"
columns
[
"password"
]
=
"connection//password"
url
=
f
"https://articonf1.itec.aau.at:30420/api/use-cases/{use_case}/tables"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
response
=
requests
.
post
(
url
,
verify
=
False
,
proxies
=
{
"http"
:
None
,
"https"
:
None
},
headers
=
{
"Authorization"
:
f
"Bearer {jwt}"
},
json
=
table
)
print
(
url
+
": "
+
str
(
response
.
status_code
))
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
...
...
@@ -58,7 +43,7 @@ def add_layers(use_case:str, table_name: str):
"table"
:
table_name
,
"name"
:
"document_layer"
,
"properties"
:
[
"UniqueI
d
"
,
"UniqueI
D
"
,
"document1id"
,
"document1collection"
,
"document1hash"
...
...
@@ -76,7 +61,7 @@ def add_layers(use_case:str, table_name: str):
"table"
:
table_name
,
"name"
:
"connection_layer"
,
"properties"
:
[
"UniqueI
d
"
,
"UniqueI
D
"
,
"database"
,
"databaseType"
,
"host"
,
...
...
@@ -95,7 +80,7 @@ def add_layers(use_case:str, table_name: str):
"table"
:
table_name
,
"name"
:
"connection_layer"
,
"properties"
:
[
"UniqueI
d
"
,
"UniqueI
D
"
,
"username"
,
"password"
...
...
@@ -108,20 +93,7 @@ def add_layers(use_case:str, table_name: str):
}
]
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
for
layer
in
layers
:
url
=
f
"https://articonf1.itec.aau.at:30420/api/layers"
response
=
requests
.
post
(
url
,
verify
=
False
,
proxies
=
{
"http"
:
None
,
"https"
:
None
},
headers
=
{
"Authorization"
:
f
"Bearer {jwt}"
},
json
=
layer
)
print
(
url
+
": "
+
str
(
response
.
status_code
))
postLayersToSwagger
(
use_case
,
layers
)
def
main
(
use_case
:
str
):
print
(
"HASH"
)
...
...
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing/tables/add_offer.py
View file @
f6840670
import
network_constants
as
nc
from
security.token_manager
import
TokenManager
import
requests
from
_add_use_case_scripts.car_sharing.tables.requestPost
import
postLayersToSwagger
,
postTableToSwagger
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
# TODO check back with alex
...
...
@@ -33,31 +29,21 @@ def add_table(use_case: str, table_name: str):
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"id"
columns
[
"carI
d
"
]
=
"car//_id"
columns
[
"carI
D
"
]
=
"car//_id"
columns
[
"carOwner"
]
=
"car//ownerID"
##TODO Question: should i get all the data from the car field? or just the car id/owner?
columns
[
"startLatitude"
]
=
"startPlace//latitude"
columns
[
"startLongitude"
]
=
"startPlace//longitude"
#TODO what if there are more end places? how can i define them? i can only get the first index of the array
columns
[
"endLatitudeFirst"
]
=
"endPlace[0]//latitude"
columns
[
"endLongitudeFirst"
]
=
"endPlace[0]//longitude"
url
=
f
"https://articonf1.itec.aau.at:30420/api/use-cases/{use_case}/tables"
columns
[
"endFirstLatitude"
]
=
"endPlace[0]//latitude"
columns
[
"endFirstLongitude"
]
=
"endPlace[0]//longitude"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
response
=
requests
.
post
(
url
,
verify
=
False
,
proxies
=
{
"http"
:
None
,
"https"
:
None
},
headers
=
{
"Authorization"
:
f
"Bearer {jwt}"
},
json
=
table
)
print
(
url
+
": "
+
str
(
response
.
status_code
))
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
...
...
@@ -67,7 +53,7 @@ def add_layers(use_case:str, table_name: str):
"name"
:
"OfferStartLocation_layer"
,
"properties"
:
[
"UniqueID"
,
"carI
d
"
,
"carI
D
"
,
"carOwner"
,
"startLatitude"
,
"startLongitude"
,
...
...
@@ -88,7 +74,7 @@ def add_layers(use_case:str, table_name: str):
"name"
:
"OfferEndLocation_layer"
,
"properties"
:
[
"UniqueID"
,
"carI
d
"
,
"carI
D
"
,
"carOwner"
,
"startLatitude"
,
"startLongitude"
,
...
...
@@ -109,12 +95,12 @@ def add_layers(use_case:str, table_name: str):
"name"
:
"OfferedCar_layer"
,
"properties"
:
[
"UniqueID"
,
"carI
d
"
,
"carI
D
"
,
"carOwner"
],
"cluster_properties"
:
[
"carI
d
"
,
"carI
D
"
,
"carOwner"
]
},
...
...
@@ -124,6 +110,7 @@ def add_layers(use_case:str, table_name: str):
"name"
:
"OfferPrice_layer"
,
"properties"
:
[
"UniqueID"
,
"carOwner"
,
"priceForKm"
,
"priceForTime"
,
"deposit"
...
...
@@ -142,6 +129,7 @@ def add_layers(use_case:str, table_name: str):
"name"
:
"OfferTime_layer"
,
"properties"
:
[
"UniqueID"
,
"carOwner"
,
"startDate"
,
"endDate"
...
...
@@ -158,6 +146,7 @@ def add_layers(use_case:str, table_name: str):
"name"
:
"OfferStatus_layer"
,
"properties"
:
[
"UniqueID"
,
"carOwner"
,
"available"
,
"deleted"
...
...
@@ -170,20 +159,7 @@ def add_layers(use_case:str, table_name: str):
}
]
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
for
layer
in
layers
:
url
=
f
"https://articonf1.itec.aau.at:30420/api/layers"
response
=
requests
.
post
(
url
,
verify
=
False
,
proxies
=
{
"http"
:
None
,
"https"
:
None
},
headers
=
{
"Authorization"
:
f
"Bearer {jwt}"
},
json
=
layer
)
print
(
url
+
": "
+
str
(
response
.
status_code
))
postLayersToSwagger
(
use_case
,
layers
)
def
main
(
use_case
:
str
):
print
(
"OFFER"
)
...
...
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing/tables/add_publication.py
View file @
f6840670
import
network_constants
as
nc
from
security.token_manager
import
TokenManager
import
requests
from
_add_use_case_scripts.car_sharing.tables.requestPost
import
postLayersToSwagger
,
postTableToSwagger
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
use_case
=
"car-sharing"
columns
=
[
# "doctype",
"id"
"text"
"id"
,
"text"
,
#"media"
#"location"
"user"
"date"
"user"
,
"date"
,
#"likesUsers"
#"reportedBy"
"deleted"
"deleted"
,
"answerTo"
]
...
...
@@ -34,51 +30,22 @@ def add_table(use_case: str, table_name: str):
columns
[
"latitude"
]
=
"location//latitude"
columns
[
"longitude"
]
=
"location//longitude"
#TODO get Likes/reportedBy?
url
=
f
"https://articonf1.itec.aau.at:30420/api/use-cases/{use_case}/tables"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
response
=
requests
.
post
(
url
,
verify
=
False
,
proxies
=
{
"http"
:
None
,
"https"
:
None
},
headers
=
{
"Authorization"
:
f
"Bearer {jwt}"
},
json
=
table
)
print
(
url
+
": "
+
str
(
response
.
status_code
))
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"PublicationGeneral_layer"
,
"properties"
:
[
"UniqueId"
,
"text"
,
"user"
,
"mediaUrlFirst"
,
"mediaTypeFirst"
,
"mediaLabelsFirst"
,
"latitude"
,
"longitude"
],
"cluster_properties"
:
[
#TODO What to add?
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"PublicationLocation_layer"
,
"properties"
:
[
"UniqueI
d
"
,
"UniqueI
D
"
,
"user"
,
"latitude"
,
"longitude"
...
...
@@ -94,7 +61,7 @@ def add_layers(use_case:str, table_name: str):
"table"
:
table_name
,
"name"
:
"PublicationTime_layer"
,
"properties"
:
[
"UniqueI
d
"
,
"UniqueI
D
"
,
"user"
,
"latitude"
,
"longitude"
...
...
@@ -109,7 +76,7 @@ def add_layers(use_case:str, table_name: str):
"table"
:
table_name
,
"name"
:
"PublicationUser_layer"
,
"properties"
:
[
"UniqueI
d
"
,
"UniqueI
D
"
,
"text"
,
"user"
,
"mediaUrlFirst"
,
...
...
@@ -126,34 +93,21 @@ def add_layers(use_case:str, table_name: str):
"table"
:
table_name
,
"name"
:
"PublicationStatus_layer"
,
"properties"
:
[
"UniqueI
d
"
,
"UniqueI
D
"
,
"text"
,
"user"
,
"
status
"
,
"
deleted
"
,
"answerTo"
],
"cluster_properties"
:
[
"
status
"
,
"
deleted
"
,
"answerTo"
]
}
]
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
for
layer
in
layers
:
url
=
f
"https://articonf1.itec.aau.at:30420/api/layers"
response
=
requests
.
post
(
url
,
verify
=
False
,
proxies
=
{
"http"
:
None
,
"https"
:
None
},
headers
=
{
"Authorization"
:
f
"Bearer {jwt}"
},
json
=
layer
)
print
(
url
+
": "
+
str
(
response
.
status_code
))
postLayersToSwagger
(
use_case
,
layers
)
def
main
(
use_case
:
str
):
print
(
"PUBLICATION"
)
...
...
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing/tables/add_travel.py
View file @
f6840670
import
network_constants
as
nc
from
security.token_manager
import
TokenManager
import
requests
from
_add_use_case_scripts.car_sharing.tables.requestPost
import
postLayersToSwagger
,
postTableToSwagger
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
# TODO disscuss with others if it looks ok
...
...
@@ -42,7 +38,7 @@ def add_table(use_case: str, table_name: str):
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"id"
columns
[
"user1I
d
"
]
=
"users[0]//userId"
columns
[
"user1I
D
"
]
=
"users[0]//userId"
columns
[
"user1PassengersNr"
]
=
"users[0]//passengers"
columns
[
"isDriver"
]
=
"users[0]//isDriver"
columns
[
"startPlaceLatitude"
]
=
"startPlace//Latitude"
...
...
@@ -63,40 +59,30 @@ def add_table(use_case: str, table_name: str):
columns
[
"startedBy1Moment"
]
=
"startedBy[0]//moment"
columns
[
"startedBy1User"
]
=
"startedBy[0]//user"
#TODO CheckedBy,CanceledBy usefull?
url
=
f
"https://articonf1.itec.aau.at:30420/api/use-cases/{use_case}/tables"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
response
=
requests
.
post
(
url
,
verify
=
False
,
proxies
=
{
"http"
:
None
,
"https"
:
None
},
headers
=
{
"Authorization"
:
f
"Bearer {jwt}"
},
json
=
table
)
print
(
url
+
": "
+
str
(
response
.
status_code
))
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"User_Layer"
,
"name"
:
"
Travel
User_Layer"
,
"properties"
:
[
'UniqueID'
,
'user1I
d
'
,
'user1I
D
'
,
'isDriver'
,
'score1User'
,
'score1Rating'
,
'startedBy1User'
],
"cluster_properties"
:
[
'user1I
d
'
'user1I
D
'
]
},
{
...
...
@@ -104,7 +90,7 @@ def add_layers(use_case:str, table_name: str):
"table"
:
table_name
,
"name"
:
"StartingPoint_Layer"
,
"properties"
:
[
'user1I
d
'
,
'user1I
D
'
,
'UniqueID'
,
'startPlaceLatitude'
,
'startPlaceLongitude'
,
...
...
@@ -120,7 +106,7 @@ def add_layers(use_case:str, table_name: str):
"table"
:
table_name
,
"name"
:
"StartingTime_Layer"
,
"properties"
:
[
'user1I
d
'
,
'user1I
D
'
,
'UniqueID'
,
'startDate'
,
'endDate'
,
...
...
@@ -136,7 +122,7 @@ def add_layers(use_case:str, table_name: str):
"table"
:
table_name
,
"name"
:
"Destination_Layer"
,
"properties"
:
[
'user1I
d
'
,
'user1I
D
'
,
'UniqueID'
,
'endPlace1Latitude'
,
'endPlace1Longitude'
,
...
...
@@ -153,7 +139,7 @@ def add_layers(use_case:str, table_name: str):
"table"
:
table_name
,
"name"
:
"FinishedTime_Layer"
,
"properties"
:
[
'user1I
d
'
,
'user1I
D
'
,
'UniqueID'
,
'startDate'
,
'endDate'
,
...
...
@@ -169,7 +155,7 @@ def add_layers(use_case:str, table_name: str):
"table"
:
table_name
,
"name"
:
"Price_Layer"
,
"properties"
:
[
'user1I
d
'
,
'user1I
D
'
,
'UniqueID'
,
'totalPrice'
,
'kmTraveled'
,
...
...
@@ -191,10 +177,11 @@ def add_layers(use_case:str, table_name: str):
"name"
:
"Status_Layer"
,
"properties"
:
[
'UniqueID'
,
'user1I
d
'
,
'user1I
D
'
,
'status'
,
'score1User'
,
'score1Rating'
'score1Rating'
,
'rentForTime'
],
"cluster_properties"
:
[
'status'
,
...
...
@@ -204,20 +191,7 @@ def add_layers(use_case:str, table_name: str):
}
]
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
for
layer
in
layers
:
url
=
f
"https://articonf1.itec.aau.at:30420/api/layers"
response
=
requests
.
post
(
url
,
verify
=
False
,
proxies
=
{
"http"
:
None
,
"https"
:
None
},
headers
=
{
"Authorization"
:
f
"Bearer {jwt}"
},
json
=
layer
)
print
(
url
+
": "
+
str
(
response
.
status_code
))
postLayersToSwagger
(
use_case
,
layers
)
def
main
(
use_case
:
str
):
print
(
"TRAVEL"
)
...
...
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing/tables/add_user.py
View file @
f6840670
...
...
@@ -15,12 +15,12 @@ def add_table(use_case: str, table_name: str):
"id"
,
# pk
"balance"
,
"payerId"
,
"numberOfTrips"
,
"numberOfTrips
Done
"
,
"sumOfTripsScores"
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueI
d
"
]
=
"id"
columns
[
"UniqueI
D
"
]
=
"id"
table
=
{
"name"
:
table_name
,
...
...
@@ -37,16 +37,16 @@ def add_layers(use_case:str, table_name: str):
"table"
:
table_name
,
"name"
:
"User_layer"
,
"properties"
:
[
"UniqueI
d
"
,
"UniqueI
D
"
,
"balance"
,
"payerId"
,
"numberOfTrips"
,
"numberOfTrips
Done
"
,
"sumOfTripsScores"
],
"cluster_properties"
:
[
"balance"
,
"numberOfTrips"
,
"numberOfTrips
Done
"
,
"sumOfTripsScores"
]
},
...
...
@@ -55,10 +55,10 @@ def add_layers(use_case:str, table_name: str):
"table"
:
table_name
,
"name"
:
"UserBalance_layer"
,
"properties"
:
[
"UniqueI
d
"
,
"UniqueI
D
"
,
"balance"
,
"payerId"
,
"numberOfTrips"
,
"numberOfTrips
Done
"
,
"sumOfTripsScores"
],
...
...
@@ -72,15 +72,15 @@ def add_layers(use_case:str, table_name: str):
"table"
:
table_name
,
"name"
:
"UserVeterancy_layer"
,
"properties"
:
[
"UniqueI
d
"
,
"UniqueI
D
"
,
"balance"
,
"payerId"
,
"numberOfTrips"
,
"numberOfTrips
Done
"
,
"sumOfTripsScores"
],
"cluster_properties"
:
[
"numberOfTrips"
,
"numberOfTrips
Done
"
,
"sumOfTripsScores"
]
}
...
...
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