Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
evm-store
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanli
evm-store
Commits
f53f9e57
Commit
f53f9e57
authored
Jun 22, 2021
by
wanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
110522f3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
11 deletions
+63
-11
.gitignore
.gitignore
+6
-0
backend/app/signal_manager.py
backend/app/signal_manager.py
+9
-0
backend/controller/api_manager.py
backend/controller/api_manager.py
+35
-1
backend/view/api.py
backend/view/api.py
+13
-10
No files found.
.gitignore
View file @
f53f9e57
...
@@ -27,6 +27,9 @@ deploy/
...
@@ -27,6 +27,9 @@ deploy/
build/
build/
venv/
venv/
node_modules
frontend_backup
logs/*.log
logs/*.log
logs/*.log.*
logs/*.log.*
*.db
*.db
...
@@ -49,6 +52,9 @@ backend/backupData.json
...
@@ -49,6 +52,9 @@ backend/backupData.json
config.ini
config.ini
*.epk
*.epk
tools/build_out/logs
tools/build_out/logs/*
release/
release/
release.*
release.*
...
...
backend/app/signal_manager.py
View file @
f53f9e57
'''
Author: your name
Date: 2021-04-14 14:12:18
LastEditTime: 2021-06-22 12:40:53
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath:
\
evm-store
\b
ackend
\a
pp
\
signal_manager.py
'''
#!/usr/bin/env python
#!/usr/bin/env python
# -*- coding: utf_8 -*-
# -*- coding: utf_8 -*-
...
@@ -9,6 +17,7 @@ class SignalManager(object):
...
@@ -9,6 +17,7 @@ class SignalManager(object):
actionBackupDatabase
=
PySignal
()
actionBackupDatabase
=
PySignal
()
actionApplicationBuild
=
PySignal
()
actionApplicationBuild
=
PySignal
()
actionGetConvertString
=
PySignal
()
actionGetConvertString
=
PySignal
()
actionOpqcp
=
PySignal
()
# 登录模块
# 登录模块
actionLogin
=
PySignal
()
actionLogin
=
PySignal
()
...
...
backend/controller/api_manager.py
View file @
f53f9e57
'''
Author: your name
Date: 2021-04-14 14:12:18
LastEditTime: 2021-06-22 13:38:34
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath:
\
evm-store
\b
ackend
\
controller
\a
pi_manager.py
'''
#!/usr/bin/env python
#!/usr/bin/env python
# -*- coding: utf_8 -*-
# -*- coding: utf_8 -*-
import
os
import
time
import
time
import
json
import
json
import
logging
import
logging
import
traceback
import
traceback
import
subprocess
import
uuid
import
uuid
from
datetime
import
datetime
from
datetime
import
datetime
from
pony.orm
import
*
from
pony.orm
import
*
from
model
import
fullStackDB
from
app.setting
import
config
from
model.user
import
User
from
model.user
import
User
from
utils
import
md5_salt
from
utils
import
md5_salt
from
utils.ccode
import
convert_string
from
utils.ccode
import
convert_string
...
@@ -49,4 +59,28 @@ class ApiManager(object):
...
@@ -49,4 +59,28 @@ class ApiManager(object):
def
get_escape_text
(
self
,
data
):
def
get_escape_text
(
self
,
data
):
return
convert_string
(
data
[
'string'
])
return
convert_string
(
data
[
'string'
])
def
opqcp
(
self
,
params
):
target_file
=
os
.
path
.
normpath
(
os
.
sep
.
join
([
config
.
get
(
"UPLOAD_PATH"
),
params
.
get
(
"filename"
)]))
print
(
"--------->"
,
params
,
target_file
)
print
(
os
.
stat
(
target_file
))
# dtNowString = datetime.now().strftime("%Y%m%d%H%M%S%f")
# fn, ex = os.path.splitext(params.get("filename"))
output_path
=
os
.
path
.
dirname
(
target_file
)
print
(
"#######"
,
output_path
)
# command = ["./opqcp", target_file, output_path]
# ret = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="utf-8", timeout=5)
# if ret.returncode == 0:
# print("success:", ret)
# else:
# print("error:", ret)
ret
=
target_file
return
True
,
ret
apiManager
=
ApiManager
()
apiManager
=
ApiManager
()
backend/view/api.py
View file @
f53f9e57
...
@@ -29,11 +29,15 @@ def stopApp():
...
@@ -29,11 +29,15 @@ def stopApp():
f
.
write
(
json
.
dumps
(
ret
,
indent
=
4
))
f
.
write
(
json
.
dumps
(
ret
,
indent
=
4
))
return
ret
return
ret
def
actionShowReport
():
@
api
.
route
(
"/opqcp"
,
methods
=
[
'POST'
])
fpath
=
os
.
sep
.
join
([
os
.
getcwd
(),
"results"
,
"TPC-E_dm.pdf"
])
def
action_opqcp
():
with
open
(
fpath
,
"rb"
)
as
f
:
params
=
request
.
json
ret
=
f
.
read
()
return
ret
print
(
params
)
signalManager
.
actionOpqcp
.
emit
(
params
)
return
response_result
(
ResponseCode
.
OK
)
@
api
.
route
(
"/updatePassword"
,
methods
=
[
'POST'
])
@
api
.
route
(
"/updatePassword"
,
methods
=
[
'POST'
])
@
validate_schema
(
UpdatePasswordSchema
)
@
validate_schema
(
UpdatePasswordSchema
)
...
@@ -49,11 +53,10 @@ def update_password():
...
@@ -49,11 +53,10 @@ def update_password():
def
upload_file
():
def
upload_file
():
try
:
try
:
result
=
None
result
=
None
message
=
None
binfile
=
request
.
files
.
get
(
"binfile"
)
binfile
=
request
.
files
.
get
(
"binfile"
)
if
not
binfile
:
if
not
binfile
:
return
response_result
(
ResponseCode
.
REQUEST_ERROR
,
msg
=
message
)
return
response_result
(
ResponseCode
.
REQUEST_ERROR
,
msg
=
"upload field name error"
)
obj
=
dict
()
obj
=
dict
()
obj
[
'filename'
]
=
binfile
.
filename
obj
[
'filename'
]
=
binfile
.
filename
...
@@ -83,10 +86,10 @@ def upload_file():
...
@@ -83,10 +86,10 @@ def upload_file():
"uuid"
:
str
(
uuid
.
uuid4
()),
# 附件唯一编号
"uuid"
:
str
(
uuid
.
uuid4
()),
# 附件唯一编号
"filename"
:
obj
[
'filename'
],
# 附件名称
"filename"
:
obj
[
'filename'
],
# 附件名称
"filesize"
:
os
.
path
.
getsize
(
saveFile
),
# 附件大小
"filesize"
:
os
.
path
.
getsize
(
saveFile
),
# 附件大小
"filepath"
:
os
.
sep
.
join
([
config
.
get
(
"UPLOAD_DIR"
),
relative_path
,
filename
])
.
replace
(
"
\\
"
,
"/"
),
# 附件存储路径
"filepath"
:
os
.
sep
.
join
([
relative_path
,
filename
])
.
replace
(
"
\\
"
,
"/"
),
# 附件存储路径
}
,
"upload file [
%
s] successfully!"
%
obj
[
'filename'
]
}
return
response_result
(
ResponseCode
.
OK
,
data
=
result
)
return
response_result
(
ResponseCode
.
OK
,
data
=
result
,
msg
=
"upload file [
%
s] successfully!"
%
obj
[
'filename'
]
)
except
Exception
as
e
:
except
Exception
as
e
:
traceback
.
print_exc
()
traceback
.
print_exc
()
logger
.
error
(
str
(
e
))
logger
.
error
(
str
(
e
))
...
...
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