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
c460d9e0
Commit
c460d9e0
authored
Apr 29, 2022
by
Lihinikaduwa D.N.R.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
API - Removed Unwanted Function
parent
065e790b
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
8 additions
and
64 deletions
+8
-64
.idea/inspectionProfiles/Project_Default.xml
.idea/inspectionProfiles/Project_Default.xml
+1
-0
API/__pycache__/app.cpython-39.pyc
API/__pycache__/app.cpython-39.pyc
+0
-0
API/app.py
API/app.py
+1
-19
API/db/__pycache__/dbConnection.cpython-39.pyc
API/db/__pycache__/dbConnection.cpython-39.pyc
+0
-0
API/db/dbConnection.py
API/db/dbConnection.py
+2
-38
API/model/__pycache__/colorModel.cpython-39.pyc
API/model/__pycache__/colorModel.cpython-39.pyc
+0
-0
API/model/__pycache__/readModel.cpython-39.pyc
API/model/__pycache__/readModel.cpython-39.pyc
+0
-0
API/model/readModel.py
API/model/readModel.py
+2
-2
API/model/userModel.py
API/model/userModel.py
+2
-1
frontend/src/screen/client/Client.js
frontend/src/screen/client/Client.js
+0
-4
No files found.
.idea/inspectionProfiles/Project_Default.xml
View file @
c460d9e0
...
...
@@ -6,6 +6,7 @@
<list>
<option
value=
"N802"
/>
<option
value=
"N806"
/>
<option
value=
"N803"
/>
</list>
</option>
</inspection_tool>
...
...
API/__pycache__/app.cpython-39.pyc
View file @
c460d9e0
No preview for this file type
API/app.py
View file @
c460d9e0
# import MySQLdb
from
flask
import
Flask
,
redirect
,
url_for
,
render_template
,
request
,
jsonify
,
make_response
import
random
import
os
<<<<<<<
HEAD
from
API.model.colorModel
import
get_color_activities1
,
get_color_activities2
,
get_color_activity_result
from
API.model.readModel
import
get_reading_activities
,
save_activity_details
from
API.model.userModel
import
getUser
,
saveUserSession
=======
from
API.model.colorModel
import
get_color_activities1
,
get_color_activities2
,
get_color_activity_result
,
storeResult
from
API.model.readModel
import
get_reading_activities
from
API.model.userModel
import
getStudentByName
>>>>>>>
4377
b9c5fafb5c155a043560f662f4da96c37e12
from
API.routers.router
import
funtion_one
# from backend.IT18218640.keyword_spotting_service import Keyword_Spotting_service
...
...
@@ -51,14 +46,11 @@ def getColorActivitiesResult():
@
app
.
route
(
"/predict"
,
methods
=
[
"POST"
])
def
predict
():
<<<<<<<
HEAD
data
=
request
.
get_json
()
print
((
f
"{data}"
))
=======
try
:
data
=
request
.
get_json
()
>>>>>>>
4377
b9c5fafb5c155a043560f662f4da96c37e12
fileitem
=
data
[
'uri'
]
...
...
@@ -131,10 +123,6 @@ def store():
print
(
e
)
return
e
# Read Function Route (IT)
...
...
@@ -197,10 +185,4 @@ def reading():
if
__name__
==
"__main__"
:
<<<<<<<
HEAD
app
.
run
(
host
=
'192.168.1.101'
)
=======
app
.
run
(
host
=
'192.168.8.101'
)
# app.run(host='192.168.8.102')
# app.run(debug=True)
>>>>>>>
4377
b9c5fafb5c155a043560f662f4da96c37e12
app
.
run
(
host
=
'192.168.1.100'
)
API/db/__pycache__/dbConnection.cpython-39.pyc
View file @
c460d9e0
No preview for this file type
API/db/dbConnection.py
View file @
c460d9e0
...
...
@@ -12,7 +12,7 @@ def create_con():
database
=
"helply"
,
host
=
"127.0.0.1"
,
user
=
"root"
,
password
=
"
rp19970520
"
password
=
"
12345678
"
)
return
db
...
...
@@ -24,7 +24,6 @@ def create_con_pandas():
def
get_all_data
(
query
):
db
=
create_con
()
cursor
=
db
.
cursor
()
cursor
.
execute
(
query
)
...
...
@@ -33,26 +32,6 @@ def get_all_data(query):
return
result
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
):
db
=
create_con_pandas
()
...
...
@@ -125,22 +104,6 @@ def insert_data_get_id(sql_query):
return
e
def
insert_data_main_response
(
trip_info_sql
,
trip_df
):
db
=
create_con
()
cursor
=
db
.
cursor
()
try
:
cursor
.
execute
(
trip_info_sql
)
insert_data_pandas_df
(
trip_df
,
'trip'
)
db
.
commit
()
db
.
close
()
return
1
except
Exception
as
e
:
db
.
rollback
()
db
.
close
()
return
e
def
get_data
(
sql_query
):
db
=
create_con
()
cursor
=
db
.
cursor
()
...
...
@@ -174,6 +137,7 @@ def update_data(sql_query):
print
(
e
)
return
e
def
insert
(
sql_query
,
args
):
db
=
create_con
()
cursor
=
db
.
cursor
()
...
...
API/model/__pycache__/colorModel.cpython-39.pyc
View file @
c460d9e0
No preview for this file type
API/model/__pycache__/readModel.cpython-39.pyc
View file @
c460d9e0
No preview for this file type
API/model/readModel.py
View file @
c460d9e0
from
API.db.dbConnection
import
get_
reading
_data
,
insert
from
API.db.dbConnection
import
get_
all
_data
,
insert
from
flask
import
jsonify
...
...
@@ -6,7 +6,7 @@ def get_reading_activities():
data_dic
=
[]
qry
=
'SELECT * FROM reading'
result
=
get_
reading
_data
(
qry
)
result
=
get_
all
_data
(
qry
)
for
row
in
result
:
ob
=
{
...
...
API/model/userModel.py
View file @
c460d9e0
...
...
@@ -3,6 +3,7 @@ from API.db.dbConnection import insert
from
API.util.util
import
getUUID
from
datetime
import
datetime
def
getUser
(
email
,
password
):
qry
=
'SELECT * FROM `user` WHERE email = "{}" AND password = "{}"'
.
format
(
email
,
password
)
...
...
@@ -15,5 +16,5 @@ def saveUserSession(userId):
token
=
getUUID
()
qry
=
'INSERT INTO userSession (id,userId,token,loginTime,status) VALUES (NULL,
%
s,
%
s,
%
s,
%
s)'
args
=
(
userId
,
token
,
loginTime
,
1
)
result
=
insert
(
qry
,
args
)
insert
(
qry
,
args
)
return
token
frontend/src/screen/client/Client.js
View file @
c460d9e0
...
...
@@ -2,10 +2,6 @@ import axios from 'axios';
// export default axios.create({ baseURL: 'http://192.168.8.102:5000/', timeout: 15000, });
export
default
axios
.
create
({
<<<<<<<
HEAD
baseURL
:
'
http://192.168.1.101:5000/
'
,
=======
baseURL
:
'
http://192.168.8.101:5000/
'
,
>>>>>>>
4377
b9c5fafb5c155a043560f662f4da96c37e12
timeout
:
15000
,
});
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