Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
21_22-J 38
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
21_22-J 38
21_22-J 38
Commits
67976c4c
Commit
67976c4c
authored
Jan 08, 2022
by
Lihinikaduwa D.N.R.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create getReadActivity
parent
db58b364
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
102 additions
and
14 deletions
+102
-14
.idea/21_22j-38.iml
.idea/21_22j-38.iml
+1
-1
.idea/inspectionProfiles/Project_Default.xml
.idea/inspectionProfiles/Project_Default.xml
+13
-0
API/.idea/.gitignore
API/.idea/.gitignore
+8
-0
API/.idea/inspectionProfiles/Project_Default.xml
API/.idea/inspectionProfiles/Project_Default.xml
+13
-0
API/.idea/vcs.xml
API/.idea/vcs.xml
+6
-0
API/app.py
API/app.py
+14
-4
API/db/__pycache__/dbConnection.cpython-38.pyc
API/db/__pycache__/dbConnection.cpython-38.pyc
+0
-0
API/db/dbConnection.py
API/db/dbConnection.py
+26
-4
API/model/__pycache__/colorModel.cpython-38.pyc
API/model/__pycache__/colorModel.cpython-38.pyc
+0
-0
API/model/__pycache__/readModel.cpython-38.pyc
API/model/__pycache__/readModel.cpython-38.pyc
+0
-0
API/model/readModel.py
API/model/readModel.py
+15
-5
API/routers/__pycache__/dic_config.cpython-38.pyc
API/routers/__pycache__/dic_config.cpython-38.pyc
+0
-0
API/routers/__pycache__/router.cpython-38.pyc
API/routers/__pycache__/router.cpython-38.pyc
+0
-0
frontend/src/router/router.js
frontend/src/router/router.js
+6
-0
No files found.
.idea/21_22j-38.iml
View file @
67976c4c
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<excludeFolder
url=
"file://$MODULE_DIR$/venv"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/venv"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/API/venv"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/API/venv"
/>
</content>
</content>
<orderEntry
type=
"jdk"
jdkName=
"Python 3.
9
"
jdkType=
"Python SDK"
/>
<orderEntry
type=
"jdk"
jdkName=
"Python 3.
8
"
jdkType=
"Python SDK"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
</component>
</module>
</module>
\ No newline at end of file
.idea/inspectionProfiles/Project_Default.xml
0 → 100644
View file @
67976c4c
<component
name=
"InspectionProjectProfileManager"
>
<profile
version=
"1.0"
>
<option
name=
"myName"
value=
"Project Default"
/>
<inspection_tool
class=
"PyPep8NamingInspection"
enabled=
"true"
level=
"WEAK WARNING"
enabled_by_default=
"true"
>
<option
name=
"ignoredErrors"
>
<list>
<option
value=
"N802"
/>
<option
value=
"N806"
/>
</list>
</option>
</inspection_tool>
</profile>
</component>
\ No newline at end of file
API/.idea/.gitignore
0 → 100644
View file @
67976c4c
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
API/.idea/inspectionProfiles/Project_Default.xml
0 → 100644
View file @
67976c4c
<component
name=
"InspectionProjectProfileManager"
>
<profile
version=
"1.0"
>
<option
name=
"myName"
value=
"Project Default"
/>
<inspection_tool
class=
"PyPep8NamingInspection"
enabled=
"true"
level=
"WEAK WARNING"
enabled_by_default=
"true"
>
<option
name=
"ignoredErrors"
>
<list>
<option
value=
"N802"
/>
<option
value=
"N806"
/>
</list>
</option>
</inspection_tool>
</profile>
</component>
\ No newline at end of file
API/.idea/vcs.xml
0 → 100644
View file @
67976c4c
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"VcsDirectoryMappings"
>
<mapping
directory=
"$PROJECT_DIR$/.."
vcs=
"Git"
/>
</component>
</project>
\ No newline at end of file
API/app.py
View file @
67976c4c
from
flask
import
Flask
,
redirect
,
url_for
,
render_template
,
request
,
jsonify
,
make_response
from
flask
import
Flask
,
redirect
,
url_for
,
render_template
,
request
,
jsonify
,
make_response
from
API.model.colorModel
import
get_color_activities
from
API.model.colorModel
import
get_color_activities
from
API.model.readModel
import
get_reading_activities
from
API.routers.router
import
funtion_one
from
API.routers.router
import
funtion_one
app
=
Flask
(
__name__
)
app
=
Flask
(
__name__
)
# Initial Route
# Initial Route
@
app
.
route
(
"/"
)
@
app
.
route
(
"/"
)
def
home
():
def
home
():
return
render_template
(
'home.html'
)
return
render_template
(
'home.html'
)
# Color Function Route (IT18218640)
# Color Function Route (IT18218640)
@
app
.
route
(
"/getColorActivities"
)
@
app
.
route
(
"/getColorActivities"
)
def
getColorActivities
():
def
getColorActivities
():
...
@@ -19,11 +22,17 @@ def getColorActivities():
...
@@ -19,11 +22,17 @@ def getColorActivities():
# Read Function Route (IT)
# Read Function Route (IT)
@
app
.
route
(
"/testings"
)
@
app
.
route
(
"/testings"
)
def
checkothers
():
def
checkothers
():
return
"testing funtions"
return
"testing funtions"
# Color Function Route (IT18218640)
@
app
.
route
(
"/reading"
)
def
getReadActivities
():
return
get_reading_activities
()
@
app
.
route
(
"/ru"
)
@
app
.
route
(
"/ru"
)
def
abc
():
def
abc
():
response_val
=
funtion_one
()
response_val
=
funtion_one
()
...
@@ -34,7 +43,8 @@ def abc():
...
@@ -34,7 +43,8 @@ def abc():
# return make_response(d, 200)
# return make_response(d, 200)
return
response_val
return
response_val
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
app
.
run
(
host
=
'192.168.8.101'
)
# app.run(host='192.168.8.101')
#app.run(host='192.168.8.100,port='5000', debug=True)
# app.run(host='192.168.8.100,port='5000', debug=True)
# app.run(debug=True)
app
.
run
(
debug
=
True
)
\ No newline at end of file
API/db/__pycache__/dbConnection.cpython-38.pyc
0 → 100644
View file @
67976c4c
File added
API/db/dbConnection.py
View file @
67976c4c
...
@@ -12,16 +12,17 @@ def create_con():
...
@@ -12,16 +12,17 @@ def create_con():
database
=
"helply"
,
database
=
"helply"
,
host
=
"127.0.0.1"
,
host
=
"127.0.0.1"
,
user
=
"root"
,
user
=
"root"
,
password
=
"
rp19970520
"
password
=
"
12345678
"
)
)
return
db
return
db
def
create_con_pandas
():
def
create_con_pandas
():
db_connection_str
=
'mysql+mysqlconnector://root:
rp19970520
@127.0.0.1/helply'
db_connection_str
=
'mysql+mysqlconnector://root:
12345678
@127.0.0.1/helply'
db
=
create_engine
(
db_connection_str
)
db
=
create_engine
(
db_connection_str
)
return
db
return
db
def
get_all_data
(
query
):
def
get_all_data
(
query
):
data_dic
=
[]
data_dic
=
[]
db
=
create_con
()
db
=
create_con
()
...
@@ -30,7 +31,7 @@ def get_all_data(query):
...
@@ -30,7 +31,7 @@ def get_all_data(query):
result
=
cursor
.
fetchall
()
result
=
cursor
.
fetchall
()
for
row
in
result
:
for
row
in
result
:
ob
=
{
ob
=
{
"idcolorActivities"
:
row
[
0
],
"idcolorActivities"
:
row
[
0
],
"name"
:
row
[
1
],
"name"
:
row
[
1
],
"file"
:
row
[
2
],
"file"
:
row
[
2
],
...
@@ -43,6 +44,27 @@ def get_all_data(query):
...
@@ -43,6 +44,27 @@ def get_all_data(query):
return
jsonify
(
data_dic
)
return
jsonify
(
data_dic
)
def
get_reading_data
(
query
):
db
=
create_con
()
cursor
=
db
.
cursor
()
cursor
.
execute
(
query
)
result
=
cursor
.
fetchall
()
#
# for row in result:
# ob = {
# "idcolorActivities": row[0],
# "name": row[1],
# "file": row[2],
# "des": row[3],
# "color": row[4],
# }
#
# data_dic.append(ob)
return
result
def
insert_data_pandas_df
(
pd_df
,
table_name
):
def
insert_data_pandas_df
(
pd_df
,
table_name
):
db
=
create_con_pandas
()
db
=
create_con_pandas
()
pd_df
.
to_sql
(
name
=
table_name
,
con
=
db
,
if_exists
=
'append'
,
index
=
False
)
pd_df
.
to_sql
(
name
=
table_name
,
con
=
db
,
if_exists
=
'append'
,
index
=
False
)
...
@@ -69,7 +91,7 @@ def getDatas(query):
...
@@ -69,7 +91,7 @@ def getDatas(query):
cursor
.
execute
(
query
)
cursor
.
execute
(
query
)
result
=
cursor
.
fetchall
()
result
=
cursor
.
fetchall
()
#idcolorActivities, name, image
#
idcolorActivities, name, image
for
row
in
result
:
for
row
in
result
:
data_dic
.
add
(
row
[
0
],
({
"idcolorActivities"
:
row
[
0
],
"name"
:
row
[
1
],
"image"
:
row
[
2
]}))
data_dic
.
add
(
row
[
0
],
({
"idcolorActivities"
:
row
[
0
],
"name"
:
row
[
1
],
"image"
:
row
[
2
]}))
...
...
API/model/__pycache__/colorModel.cpython-38.pyc
0 → 100644
View file @
67976c4c
File added
API/model/__pycache__/readModel.cpython-38.pyc
0 → 100644
View file @
67976c4c
File added
API/model/readModel.py
View file @
67976c4c
from
API.db.dbConnection
import
get_data
from
API.db.dbConnection
import
get_reading_data
from
flask
import
jsonify
def
get_color_activities
():
qry
=
'SELECT * FROM readactivities'
def
get_reading_activities
():
data_dic
=
[]
qry
=
'SELECT * FROM reading'
res
ponse
=
get
_data
(
qry
)
res
ult
=
get_reading
_data
(
qry
)
return
response
for
row
in
result
:
\ No newline at end of file
ob
=
{
"id"
:
row
[
0
],
"round"
:
row
[
1
],
}
data_dic
.
append
(
ob
)
return
jsonify
(
data_dic
)
API/routers/__pycache__/dic_config.cpython-38.pyc
0 → 100644
View file @
67976c4c
File added
API/routers/__pycache__/router.cpython-38.pyc
0 → 100644
View file @
67976c4c
File added
frontend/src/router/router.js
View file @
67976c4c
...
@@ -10,6 +10,7 @@ import Splash from '../screen/splash/Splash';
...
@@ -10,6 +10,7 @@ import Splash from '../screen/splash/Splash';
import
Color
from
'
../screen/Color
'
;
import
Color
from
'
../screen/Color
'
;
import
Blue
from
'
../screen/Blue
'
;
import
Blue
from
'
../screen/Blue
'
;
import
Read
from
'
../screen/Read
'
;
import
Read
from
'
../screen/Read
'
;
import
ReadActivity
from
'
../screen/activity/readActivity
'
;
const
Stack
=
createNativeStackNavigator
();
const
Stack
=
createNativeStackNavigator
();
const
AppRouter
=
()
=>
{
const
AppRouter
=
()
=>
{
...
@@ -56,6 +57,11 @@ const AppRouter = () => {
...
@@ -56,6 +57,11 @@ const AppRouter = () => {
name
=
"
Read
"
name
=
"
Read
"
component
=
{
Read
}
component
=
{
Read
}
/
>
/
>
<
Stack
.
Screen
options
=
{{
headerShown
:
false
}}
name
=
"
ReadActivity
"
component
=
{
ReadActivity
}
/
>
<
/Stack.Navigator
>
<
/Stack.Navigator
>
<
/NavigationContainer
>
<
/NavigationContainer
>
);
);
...
...
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