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
b8ebdf2a
Commit
b8ebdf2a
authored
Apr 13, 2021
by
Lubber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated Upload Script
parent
5d75e389
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
10 deletions
+15
-10
add_vialog_schema_new_enum.py
...add_use_case_scripts/vialog/add_vialog_schema_new_enum.py
+1
-2
add_change.py
...ice/app/_add_use_case_scripts/vialog/tables/add_change.py
+2
-0
add_video.py
...vice/app/_add_use_case_scripts/vialog/tables/add_video.py
+5
-3
pull_video_data.py
src/rest-gateway/app/pull_video_data.py
+7
-5
No files found.
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/vialog/add_vialog_schema_new.py
→
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/vialog/add_vialog_schema_new
_enum
.py
View file @
b8ebdf2a
...
...
@@ -30,12 +30,11 @@ def add_use_case(use_case: str):
print
(
url
+
": "
+
str
(
response
.
content
))
if
__name__
==
"__main__"
:
use_case
=
"vialog-new"
use_case
=
"vialog-new
-enum
"
# disable ssl warnings :)
requests
.
packages
.
urllib3
.
disable_warnings
()
add_use_case
(
use_case
)
add_user
.
main
(
use_case
)
add_video
.
main
(
use_case
)
add_change
.
main
(
use_case
)
\ No newline at end of file
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/vialog/tables/add_change.py
View file @
b8ebdf2a
...
...
@@ -14,6 +14,8 @@ def add_table(use_case: str, table_name: str):
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"videoId+changeId"
columns
[
"changeType"
]
=
"enum(changeType)"
columns
[
"changedValue"
]
=
"enum(changedValue)"
table
=
{
"name"
:
table_name
,
...
...
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/vialog/tables/add_video.py
View file @
b8ebdf2a
...
...
@@ -23,13 +23,15 @@ def add_table(use_case: str, table_name: str):
'communityManagerNotes'
,
'rewards'
,
'video_state'
,
'video_type'
,
'AppicationType'
,
'docType'
'video_type'
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"videoId"
columns
[
"moderatedBy"
]
=
"enum(moderatedBy)"
columns
[
"video_state"
]
=
"enum(video_state)"
columns
[
"video_type"
]
=
"enum(video_type)"
columns
[
"videoResolution"
]
=
"enum(videoResolution)"
table
=
{
"name"
:
table_name
,
...
...
src/rest-gateway/app/pull_video_data.py
View file @
b8ebdf2a
...
...
@@ -8,6 +8,8 @@ videoUrl = "https://dev758755.vialog.app/stat/events?type=video&id="
# token from Rest Gateway to authorize
JWT_TOKEN
=
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InJlZ3VsYXJAaXRlYy5hYXUuYXQiLCJjcmVhdGVkX2F0IjoiMjAyMS0wNC0wNyAxMjo0OTo0MS43MTkzNjQiLCJ2YWxpZF91bnRpbCI6IjIwMjEtMDQtMDggMTI6NDk6NDEuNzE5MzY0In0.FN6qqBQeJSmXtS0-0dBiL-ojz6Ou7E5Tc9macrrhM4A'
useCase
=
"vialog-new-enum"
def
send_transaction_to_rest_gateway
(
transaction
:
dict
):
res
=
requests
.
post
(
url
=
'https://articonf1.itec.aau.at:30401/api/trace'
,
...
...
@@ -36,7 +38,7 @@ for video in videosRequest.json():
print
(
f
"Status: {videoRequest.status_code}"
)
if
videoRequest
.
text
!=
""
and
not
videoRequest
.
text
.
startswith
(
"<!DOCTYPE html>"
):
print
(
f
"
\n\n
{videoUrl}{id}
\n
{videoRequest.text}
"
)
print
(
f
"
\n\n
{videoUrl}{id}"
)
historyList
=
sorted
(
videoRequest
.
json
()[
0
][
"History"
],
key
=
lambda
k
:
k
[
'moderationDate'
],
reverse
=
True
)
historyList
.
append
(
empty
)
...
...
@@ -48,10 +50,10 @@ for video in videosRequest.json():
if
i
==
0
:
lastState
=
eventMap
lastState
[
"App
icationType"
]
=
"vialog-new"
lastState
[
"App
licationType"
]
=
useCase
lastState
[
"docType"
]
=
"video"
print
(
f
"{lastState}
\n\n\n
"
)
send_transaction_to_rest_gateway
(
lastState
)
print
(
lastState
)
if
eventMap
[
"eventName"
]
==
'r1eabcbdc8f5378b2ba71a1b6fe2038b Created'
or
eventMap
[
"eventName"
]
==
'Created'
:
change
=
{
"changeType"
:
"Created"
,
"changedValue"
:
"video_state"
,
"previousValue"
:
""
,
"newValue"
:
"Created"
}
...
...
@@ -79,10 +81,10 @@ for video in videosRequest.json():
change
[
"videoId"
]
=
id
change
[
"changeId"
]
=
i
change
[
"timestamp"
]
=
eventMap
[
"moderationDate"
]
change
[
"ApplicationType"
]
=
"vialog-new"
change
[
"ApplicationType"
]
=
useCase
change
[
"docType"
]
=
"change"
print
(
change
)
#
send_transaction_to_rest_gateway(change)
send_transaction_to_rest_gateway
(
change
)
i
+=
1
elif
videoRequest
.
text
==
""
:
empty
.
add
(
id
)
...
...
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