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
4451a647
Commit
4451a647
authored
Mar 16, 2021
by
wanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
7ac76301
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
65 additions
and
81 deletions
+65
-81
backend/controller/apps_manager.py
backend/controller/apps_manager.py
+24
-19
backend/controller/build_logs_manager.py
backend/controller/build_logs_manager.py
+6
-7
backend/controller/download_manager.py
backend/controller/download_manager.py
+17
-38
backend/view/annex.py
backend/view/annex.py
+0
-1
backend/view/api.py
backend/view/api.py
+1
-1
backend/view/apps.py
backend/view/apps.py
+16
-8
backend/view/download.py
backend/view/download.py
+0
-5
backend/view/login.py
backend/view/login.py
+1
-2
No files found.
backend/controller/apps_manager.py
View file @
4451a647
...
@@ -9,7 +9,6 @@ import logging
...
@@ -9,7 +9,6 @@ import logging
import
traceback
import
traceback
from
datetime
import
datetime
from
datetime
import
datetime
from
pony.orm
import
*
from
pony.orm
import
*
from
flask
import
request
from
app
import
signalManager
from
app
import
signalManager
from
model
import
fullStackDB
from
model
import
fullStackDB
from
model.annex
import
Annex
from
model.annex
import
Annex
...
@@ -20,20 +19,20 @@ from utils import sql_filter, ThreadMaker
...
@@ -20,20 +19,20 @@ from utils import sql_filter, ThreadMaker
logger
=
logging
.
getLogger
(
"AppsManager"
)
logger
=
logging
.
getLogger
(
"AppsManager"
)
@
ThreadMaker
@
ThreadMaker
def
build_application
(
uuid
):
def
build_application
(
u
ser
,
u
uid
):
signalManager
.
actionAddBuildLog
.
emit
(
uuid
)
signalManager
.
actionAddBuildLog
.
emit
(
u
ser
,
u
uid
)
class
AppsManager
(
object
):
class
AppsManager
(
object
):
def
__init__
(
self
):
def
__init__
(
self
):
super
(
AppsManager
,
self
)
.
__init__
()
super
(
AppsManager
,
self
)
.
__init__
()
def
add
(
self
,
data
):
def
add
(
self
,
user
,
data
):
with
db_session
:
with
db_session
:
result
=
Apps
.
get
(
app_name
=
data
.
get
(
"app_name"
),
is_delete
=
False
)
result
=
Apps
.
get
(
app_name
=
data
.
get
(
"app_name"
),
is_delete
=
False
)
if
result
:
if
result
:
return
False
,
"app_name has been exists."
return
False
,
"app_name has been exists."
editor
=
User
.
get
(
id
=
request
.
current_user
.
get
(
"id"
)
)
editor
=
User
.
get
(
id
=
user
)
if
not
editor
:
if
not
editor
:
return
False
,
"current user is not exists"
return
False
,
"current user is not exists"
...
@@ -56,31 +55,38 @@ class AppsManager(object):
...
@@ -56,31 +55,38 @@ class AppsManager(object):
result
=
Apps
(
**
data
)
result
=
Apps
(
**
data
)
commit
()
commit
()
icon
.
app
=
result
commit
()
if
result
:
if
result
:
for
a
in
app_files
:
for
a
in
app_files
:
Annex
(
app
=
result
,
title
=
a
.
get
(
"filename"
),
path
=
a
.
get
(
"filepath"
),
size
=
a
.
get
(
"filesize"
),
create_by
=
editor
,
create_at
=
datetime
.
now
(),
update_by
=
editor
,
update_at
=
datetime
.
now
())
Annex
(
app
=
result
,
title
=
a
.
get
(
"filename"
),
path
=
a
.
get
(
"filepath"
),
size
=
a
.
get
(
"filesize"
),
create_by
=
editor
,
create_at
=
datetime
.
now
(),
update_by
=
editor
,
update_at
=
datetime
.
now
())
flush
()
flush
()
commit
()
commit
()
build_application
(
str
(
result
.
uuid
))
build_application
(
user
,
str
(
result
.
uuid
))
return
result
,
"add app {}."
.
format
(
"success"
if
result
else
"fail"
)
return
result
,
"add app {}."
.
format
(
"success"
if
result
else
"fail"
)
def
delete
(
self
,
uuid
):
def
delete
(
self
,
user
,
uuid
):
editor
=
User
.
get
(
id
=
request
.
current_user
.
get
(
"id"
))
with
db_session
:
if
not
editor
:
editor
=
User
.
get
(
id
=
user
)
return
False
,
"current user is not exists"
if
not
editor
:
return
False
,
"current user is not exists"
result
=
Apps
.
get
(
uuid
=
uuid
)
if
result
:
result
.
delete
()
result
=
fullStackDB
.
update
(
Apps
,
{
'uuid'
:
uuid
},
is_delete
=
True
,
delete_at
=
datetime
.
now
(),
delete_by
=
editor
)
return
result
,
"delete app {}."
.
format
(
"success"
if
result
else
"fail"
)
return
result
,
"delete app {}."
.
format
(
"success"
if
result
else
"fail"
)
def
get
(
self
,
data
):
def
get
(
self
,
user
,
data
):
result
=
Apps
.
get
(
**
data
)
result
=
Apps
.
get
(
**
data
)
if
result
:
if
result
:
result
=
result
.
to_dict
(
only
=
[
"uuid"
,
"name"
,
"create_at"
,
"update_at"
])
result
=
result
.
to_dict
(
only
=
[
"uuid"
,
"name"
,
"create_at"
,
"update_at"
])
return
result
,
"get app {}."
.
format
(
"success"
if
result
else
"no data"
)
return
result
,
"get app {}."
.
format
(
"success"
if
result
else
"no data"
)
def
getList
(
self
,
data
):
def
getList
(
self
,
user
,
data
):
if
not
data
or
len
(
data
)
<=
0
:
if
not
data
or
len
(
data
)
<=
0
:
return
False
,
0
,
"parameters can not be null."
return
False
,
0
,
"parameters can not be null."
...
@@ -107,10 +113,9 @@ class AppsManager(object):
...
@@ -107,10 +113,9 @@ class AppsManager(object):
if
result
and
len
(
result
):
if
result
and
len
(
result
):
temp
=
[]
temp
=
[]
for
item
in
result
:
for
item
in
result
:
t
=
item
.
to_dict
(
with_collections
=
True
,
related_objects
=
True
,
exclude
=
[
"app_annex"
,
"app_download"
,
"is_delete"
,
"delete_by"
,
"delete_at"
])
t
=
item
.
to_dict
(
with_collections
=
True
,
related_objects
=
True
,
exclude
=
[
"app_annex"
,
"app_download"
,
"
app_build_log"
,
"
is_delete"
,
"delete_by"
,
"delete_at"
])
t
.
update
({
t
.
update
({
"app_icon"
:
item
.
app_icon
.
to_dict
(
only
=
[
"path"
]),
"app_icon"
:
item
.
app_icon
.
to_dict
(
only
=
[
"path"
]),
# "app_build_log": item.app_build_log.to_dict(only=["app_path"]),
"create_by"
:
item
.
create_by
.
to_dict
(
only
=
[
"uuid"
,
"username"
]),
"create_by"
:
item
.
create_by
.
to_dict
(
only
=
[
"uuid"
,
"username"
]),
"update_by"
:
item
.
update_by
.
to_dict
(
only
=
[
"uuid"
,
"username"
]),
"update_by"
:
item
.
update_by
.
to_dict
(
only
=
[
"uuid"
,
"username"
]),
"create_at"
:
item
.
create_at
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
if
item
.
create_at
else
None
,
"create_at"
:
item
.
create_at
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
if
item
.
create_at
else
None
,
...
@@ -121,13 +126,13 @@ class AppsManager(object):
...
@@ -121,13 +126,13 @@ class AppsManager(object):
return
result
,
count
,
"get app {}."
.
format
(
"success"
if
result
else
"no data"
)
return
result
,
count
,
"get app {}."
.
format
(
"success"
if
result
else
"no data"
)
def
update
(
self
,
uuid
,
data
):
def
update
(
self
,
u
ser
,
u
uid
,
data
):
# 当参数为空时,直接返回错误
# 当参数为空时,直接返回错误
if
len
(
data
)
<=
0
or
(
len
(
data
.
keys
())
==
1
and
"id"
in
data
):
if
len
(
data
)
<=
0
or
(
len
(
data
.
keys
())
==
1
and
"id"
in
data
):
return
False
,
"app can not be null."
return
False
,
"app can not be null."
with
db_session
:
with
db_session
:
editor
=
User
.
get
(
id
=
request
.
current_user
.
get
(
"id"
)
)
editor
=
User
.
get
(
id
=
user
)
if
not
editor
:
if
not
editor
:
return
False
,
"current user is not exists"
return
False
,
"current user is not exists"
...
@@ -162,7 +167,7 @@ class AppsManager(object):
...
@@ -162,7 +167,7 @@ class AppsManager(object):
result
.
set
(
update_at
=
datetime
.
now
(),
update_by
=
editor
,
**
data
)
result
.
set
(
update_at
=
datetime
.
now
(),
update_by
=
editor
,
**
data
)
commit
()
commit
()
build_application
(
str
(
result
.
uuid
))
build_application
(
user
,
str
(
result
.
uuid
))
return
result
,
"update app {}."
.
format
(
"success"
if
result
else
"fail"
)
return
result
,
"update app {}."
.
format
(
"success"
if
result
else
"fail"
)
...
...
backend/controller/build_logs_manager.py
View file @
4451a647
...
@@ -13,7 +13,6 @@ import traceback
...
@@ -13,7 +13,6 @@ import traceback
from
urllib.parse
import
urlparse
,
urljoin
from
urllib.parse
import
urlparse
,
urljoin
from
datetime
import
datetime
from
datetime
import
datetime
from
pony.orm
import
*
from
pony.orm
import
*
from
flask
import
request
from
app.setting
import
config
from
app.setting
import
config
from
model
import
fullStackDB
from
model
import
fullStackDB
from
model.apps
import
Apps
from
model.apps
import
Apps
...
@@ -29,9 +28,9 @@ class BuildLogsManager(object):
...
@@ -29,9 +28,9 @@ class BuildLogsManager(object):
def
__init__
(
self
):
def
__init__
(
self
):
super
(
BuildLogsManager
,
self
)
.
__init__
()
super
(
BuildLogsManager
,
self
)
.
__init__
()
def
add
(
self
,
app
):
def
add
(
self
,
user
,
app
):
with
db_session
:
with
db_session
:
editor
=
User
.
get
(
id
=
request
.
current_user
.
get
(
"id"
)
)
editor
=
User
.
get
(
id
=
user
)
if
not
editor
:
if
not
editor
:
return
False
,
"current user is not exists"
return
False
,
"current user is not exists"
...
@@ -93,8 +92,8 @@ class BuildLogsManager(object):
...
@@ -93,8 +92,8 @@ class BuildLogsManager(object):
return
epk_path
,
"add build_logs {}."
.
format
(
"success"
if
result
else
"fail"
)
return
epk_path
,
"add build_logs {}."
.
format
(
"success"
if
result
else
"fail"
)
def
delete
(
self
,
uuid
):
def
delete
(
self
,
u
ser
,
u
uid
):
editor
=
User
.
get
(
id
=
request
.
current_user
.
get
(
"id"
)
)
editor
=
User
.
get
(
id
=
user
)
if
not
editor
:
if
not
editor
:
return
False
,
"current user is not exists"
return
False
,
"current user is not exists"
...
@@ -152,13 +151,13 @@ class BuildLogsManager(object):
...
@@ -152,13 +151,13 @@ class BuildLogsManager(object):
return
result
,
count
,
"get build_logs {}."
.
format
(
"success"
if
result
else
"no data"
)
return
result
,
count
,
"get build_logs {}."
.
format
(
"success"
if
result
else
"no data"
)
def
update
(
self
,
uuid
,
data
):
def
update
(
self
,
u
ser
,
u
uid
,
data
):
# 当参数为空时,直接返回错误
# 当参数为空时,直接返回错误
if
len
(
data
)
<=
0
or
(
len
(
data
.
keys
())
==
1
and
"id"
in
data
):
if
len
(
data
)
<=
0
or
(
len
(
data
.
keys
())
==
1
and
"id"
in
data
):
return
False
,
"parameters can not be null."
return
False
,
"parameters can not be null."
# 查询请求者是否存在
# 查询请求者是否存在
editor
=
User
.
get
(
id
=
request
.
current_user
.
get
(
"id"
)
)
editor
=
User
.
get
(
id
=
user
)
if
not
editor
:
if
not
editor
:
return
False
,
"current user is not exists"
return
False
,
"current user is not exists"
...
...
backend/controller/download_manager.py
View file @
4451a647
...
@@ -94,20 +94,7 @@ class DownloadManager(object):
...
@@ -94,20 +94,7 @@ class DownloadManager(object):
epk_path
=
None
epk_path
=
None
with
db_session
:
with
db_session
:
# 判断应用UUID是否等于evue_launcher
# 判断应用UUID是否等于evue_launcher
if
data
.
get
(
"id"
)
==
"evue_launcher"
:
if
data
.
get
(
"id"
)
==
"evue_launcher123"
:
# 读取evue_launcher.evue和evue_dock.evue以及相关资源文件
# launcher_file = Apps.get(name="evue_launcher")
# if not launcher_file:
# launcher_file = Framework.get(name="evue_launcher")
# if not launcher_file:
# return False, "evue_launcher not found"
# else:
# launcher_file = launcher_file.annex
# dock_file = Framework.get(name="evue_dock")
# if not dock_file:
# return False, "evue_launcher not found"
# 按照格式创建文件夹
# 按照格式创建文件夹
dir_format
=
datetime
.
now
()
.
strftime
(
"
%
Y
%
m
%
d
%
H
%
M
%
S"
)
dir_format
=
datetime
.
now
()
.
strftime
(
"
%
Y
%
m
%
d
%
H
%
M
%
S"
)
build_path
=
os
.
sep
.
join
([
os
.
getcwd
(),
config
.
get
(
"UPLOAD_DIR"
),
conf
.
get
(
'application'
,
'launcher_dir'
),
data
.
get
(
"imei"
),
dir_format
])
build_path
=
os
.
sep
.
join
([
os
.
getcwd
(),
config
.
get
(
"UPLOAD_DIR"
),
conf
.
get
(
'application'
,
'launcher_dir'
),
data
.
get
(
"imei"
),
dir_format
])
...
@@ -118,17 +105,20 @@ class DownloadManager(object):
...
@@ -118,17 +105,20 @@ class DownloadManager(object):
if
not
os
.
path
.
exists
(
build_source_path
):
if
not
os
.
path
.
exists
(
build_source_path
):
os
.
mkdir
(
build_source_path
)
os
.
mkdir
(
build_source_path
)
# target_path = launcher_file.assets.get("files", []) + dock_file.assets.get("files", [])
# 判断下name为evue_launcher的文件是否存在
# # 将取evue_launcher.evue和evue_dock.evue以及相关资源文件复制到这个目录下
# 存在则移动到目标文件夹中
# for f in target_path:
launcher
=
Apps
.
get
(
app_name
=
"evue_launcher"
)
# tf = convert_url_to_local_path(f)
if
launcher
:
# if not os.path.exists(tf):
# 查找所有关联文件,复制到目标文件夹中
# return False, "{} not found".format(tf)
for
f
in
launcher
.
app_annex
:
tf
=
convert_url_to_local_path
(
f
.
path
)
# filename = os.path.basename(tf)
if
not
os
.
path
.
exists
(
tf
):
# name, suffix = os.path.splitext(filename)
continue
# name = re.sub(r"_\d{14}$", "", name)
# shutil.copy(tf, os.sep.join([build_source_path, name + suffix]))
filename
=
os
.
path
.
basename
(
tf
)
name
,
suffix
=
os
.
path
.
splitext
(
filename
)
name
=
re
.
sub
(
r"_\d{14}$"
,
""
,
name
)
shutil
.
copy
(
tf
,
os
.
sep
.
join
([
build_source_path
,
name
+
suffix
]))
temp
=
[]
temp
=
[]
# 读取当前系统所有应用及其资源文件
# 读取当前系统所有应用及其资源文件
...
@@ -147,18 +137,6 @@ class DownloadManager(object):
...
@@ -147,18 +137,6 @@ class DownloadManager(object):
'id'
:
str
(
val
.
uuid
),
'id'
:
str
(
val
.
uuid
),
})
})
if
val
.
app_annex
:
# 需要将每个应用的文件拷贝到目标文件夹中
for
f
in
val
.
app_annex
:
tf
=
convert_url_to_local_path
(
f
.
path
)
if
not
os
.
path
.
exists
(
tf
):
return
False
,
"{} not found"
.
format
(
tf
)
filename
=
os
.
path
.
basename
(
tf
)
name
,
suffix
=
os
.
path
.
splitext
(
filename
)
name
=
re
.
sub
(
r"_\d{14}$"
,
""
,
name
)
shutil
.
copy
(
tf
,
os
.
sep
.
join
([
build_source_path
,
name
+
suffix
]))
if
len
(
temp
)
%
4
==
0
and
temp
:
if
len
(
temp
)
%
4
==
0
and
temp
:
result_json
.
append
(
copy
.
deepcopy
(
temp
))
result_json
.
append
(
copy
.
deepcopy
(
temp
))
temp
=
[]
temp
=
[]
...
@@ -166,6 +144,7 @@ class DownloadManager(object):
...
@@ -166,6 +144,7 @@ class DownloadManager(object):
if
temp
:
if
temp
:
result_json
.
append
(
copy
.
deepcopy
(
temp
))
result_json
.
append
(
copy
.
deepcopy
(
temp
))
json_str
=
json
.
dumps
(
result_json
,
sort_keys
=
False
,
ensure_ascii
=
False
)
json_str
=
json
.
dumps
(
result_json
,
sort_keys
=
False
,
ensure_ascii
=
False
)
with
open
(
os
.
sep
.
join
([
build_source_path
,
'evue_dock_apps.json'
]),
'w'
)
as
json_file
:
with
open
(
os
.
sep
.
join
([
build_source_path
,
'evue_dock_apps.json'
]),
'w'
)
as
json_file
:
json_file
.
write
(
json_str
)
json_file
.
write
(
json_str
)
...
@@ -175,7 +154,7 @@ class DownloadManager(object):
...
@@ -175,7 +154,7 @@ class DownloadManager(object):
epk_path
=
os
.
sep
.
join
([
build_path
,
'evue_launcher.epk'
])
epk_path
=
os
.
sep
.
join
([
build_path
,
'evue_launcher.epk'
])
else
:
else
:
# 根据应用UUID查找相关应用
# 根据应用UUID查找相关应用
app
=
Apps
.
get
(
uuid
=
data
.
get
(
"id"
),
is_delete
=
False
)
app
=
Apps
.
get
(
app_name
=
data
.
get
(
"id"
),
is_delete
=
False
)
if
not
app
:
if
not
app
:
return
False
,
"app not found"
return
False
,
"app not found"
...
...
backend/view/annex.py
View file @
4451a647
...
@@ -16,7 +16,6 @@ logger = logging.getLogger("annexApi")
...
@@ -16,7 +16,6 @@ logger = logging.getLogger("annexApi")
annex_api
=
Blueprint
(
"annex_api"
,
__name__
,
url_prefix
=
"/api/v1/
%
s/annex"
%
config
[
'NAME'
])
annex_api
=
Blueprint
(
"annex_api"
,
__name__
,
url_prefix
=
"/api/v1/
%
s/annex"
%
config
[
'NAME'
])
@
annex_api
.
route
(
"/add"
,
methods
=
[
'POST'
])
@
annex_api
.
route
(
"/add"
,
methods
=
[
'POST'
])
@
validate_schema
(
AddSchema
)
@
validate_schema
(
AddSchema
)
@
Auth
.
auth_required
@
Auth
.
auth_required
...
...
backend/view/api.py
View file @
4451a647
...
@@ -20,7 +20,7 @@ api = Blueprint("api", __name__, url_prefix="/api/v1/%s" % config['NAME'])
...
@@ -20,7 +20,7 @@ api = Blueprint("api", __name__, url_prefix="/api/v1/%s" % config['NAME'])
def
stopApp
():
def
stopApp
():
fpath
=
os
.
sep
.
join
([
os
.
getcwd
(),
"restart.json"
])
fpath
=
os
.
sep
.
join
([
os
.
getcwd
(),
"restart.json"
])
with
open
(
fpath
,
"
r
w+"
)
as
f
:
with
open
(
fpath
,
"w+"
)
as
f
:
ret
=
json
.
loads
(
f
.
read
())
ret
=
json
.
loads
(
f
.
read
())
ret
[
"count"
]
=
ret
[
"count"
]
+
1
ret
[
"count"
]
=
ret
[
"count"
]
+
1
f
.
write
(
json
.
dumps
(
ret
,
indent
=
4
))
f
.
write
(
json
.
dumps
(
ret
,
indent
=
4
))
...
...
backend/view/apps.py
View file @
4451a647
...
@@ -22,7 +22,8 @@ apps_api = Blueprint("apps_api", __name__, url_prefix="/api/v1/%s/apps" % config
...
@@ -22,7 +22,8 @@ apps_api = Blueprint("apps_api", __name__, url_prefix="/api/v1/%s/apps" % config
@
Auth
.
auth_required
@
Auth
.
auth_required
def
add
():
def
add
():
try
:
try
:
isSuccess
,
message
=
signalManager
.
actionAddApp
.
emit
(
request
.
schema_data
)
user
=
request
.
current_user
.
get
(
"id"
)
isSuccess
,
message
=
signalManager
.
actionAddApp
.
emit
(
user
,
request
.
schema_data
)
if
isSuccess
:
if
isSuccess
:
return
response_result
(
ResponseCode
.
OK
,
msg
=
message
)
return
response_result
(
ResponseCode
.
OK
,
msg
=
message
)
else
:
else
:
...
@@ -38,7 +39,8 @@ def add():
...
@@ -38,7 +39,8 @@ def add():
@
Auth
.
auth_required
@
Auth
.
auth_required
def
delete
(
id
):
def
delete
(
id
):
try
:
try
:
isSuccess
,
message
=
signalManager
.
actionDeleteApp
.
emit
(
id
)
user
=
request
.
current_user
.
get
(
"id"
)
isSuccess
,
message
=
signalManager
.
actionDeleteApp
.
emit
(
user
,
id
)
if
isSuccess
:
if
isSuccess
:
return
response_result
(
ResponseCode
.
OK
,
msg
=
message
)
return
response_result
(
ResponseCode
.
OK
,
msg
=
message
)
else
:
else
:
...
@@ -54,7 +56,8 @@ def delete(id):
...
@@ -54,7 +56,8 @@ def delete(id):
@
Auth
.
auth_required
@
Auth
.
auth_required
def
get
():
def
get
():
try
:
try
:
result
,
message
=
signalManager
.
actionGetApp
.
emit
(
request
.
schema_data
)
user
=
request
.
current_user
.
get
(
"id"
)
result
,
message
=
signalManager
.
actionGetApp
.
emit
(
user
,
request
.
schema_data
)
if
result
:
if
result
:
return
response_result
(
ResponseCode
.
OK
,
data
=
result
,
msg
=
message
)
return
response_result
(
ResponseCode
.
OK
,
data
=
result
,
msg
=
message
)
else
:
else
:
...
@@ -69,7 +72,8 @@ def get():
...
@@ -69,7 +72,8 @@ def get():
@
Auth
.
auth_required
@
Auth
.
auth_required
def
get_list
():
def
get_list
():
try
:
try
:
result
,
count
,
message
=
signalManager
.
actionGetAppList
.
emit
(
request
.
schema_data
)
user
=
request
.
current_user
.
get
(
"id"
)
result
,
count
,
message
=
signalManager
.
actionGetAppList
.
emit
(
user
,
request
.
schema_data
)
if
result
:
if
result
:
return
response_result
(
ResponseCode
.
OK
,
data
=
result
,
msg
=
message
,
count
=
count
)
return
response_result
(
ResponseCode
.
OK
,
data
=
result
,
msg
=
message
,
count
=
count
)
else
:
else
:
...
@@ -85,7 +89,8 @@ def get_list():
...
@@ -85,7 +89,8 @@ def get_list():
@
Auth
.
auth_required
@
Auth
.
auth_required
def
update
(
id
):
def
update
(
id
):
try
:
try
:
isSuccess
,
message
=
signalManager
.
actionUpdateApp
.
emit
(
id
,
request
.
schema_data
)
user
=
request
.
current_user
.
get
(
"id"
)
isSuccess
,
message
=
signalManager
.
actionUpdateApp
.
emit
(
user
,
id
,
request
.
schema_data
)
if
isSuccess
:
if
isSuccess
:
return
response_result
(
ResponseCode
.
OK
,
msg
=
message
)
return
response_result
(
ResponseCode
.
OK
,
msg
=
message
)
else
:
else
:
...
@@ -99,7 +104,8 @@ def update(id):
...
@@ -99,7 +104,8 @@ def update(id):
@
validate_schema
(
LogAddScheme
)
@
validate_schema
(
LogAddScheme
)
@
Auth
.
auth_required
@
Auth
.
auth_required
def
build_app
(
id
):
def
build_app
(
id
):
result
,
message
=
signalManager
.
actionAddBuildLog
.
emit
(
id
)
user
=
request
.
current_user
.
get
(
"id"
)
result
,
message
=
signalManager
.
actionAddBuildLog
.
emit
(
user
,
id
)
if
result
:
if
result
:
return
response_result
(
ResponseCode
.
OK
,
data
=
result
,
msg
=
message
)
return
response_result
(
ResponseCode
.
OK
,
data
=
result
,
msg
=
message
)
else
:
else
:
...
@@ -109,7 +115,8 @@ def build_app(id):
...
@@ -109,7 +115,8 @@ def build_app(id):
@
validate_schema
(
LogAddScheme
)
@
validate_schema
(
LogAddScheme
)
@
Auth
.
auth_required
@
Auth
.
auth_required
def
get_build_app
(
id
):
def
get_build_app
(
id
):
result
,
message
=
signalManager
.
actionGetBuildLog
.
emit
(
id
)
user
=
request
.
current_user
.
get
(
"id"
)
result
,
message
=
signalManager
.
actionGetBuildLog
.
emit
(
user
,
id
)
if
result
:
if
result
:
return
response_result
(
ResponseCode
.
OK
,
data
=
result
,
msg
=
message
)
return
response_result
(
ResponseCode
.
OK
,
data
=
result
,
msg
=
message
)
else
:
else
:
...
@@ -119,7 +126,8 @@ def get_build_app(id):
...
@@ -119,7 +126,8 @@ def get_build_app(id):
@
validate_schema
(
LogQuerySchema
)
@
validate_schema
(
LogQuerySchema
)
@
Auth
.
auth_required
@
Auth
.
auth_required
def
get_build_logs
():
def
get_build_logs
():
result
,
count
,
message
=
signalManager
.
actionGetBuildLogList
.
emit
(
request
.
schema_data
)
user
=
request
.
current_user
.
get
(
"id"
)
result
,
count
,
message
=
signalManager
.
actionGetBuildLogList
.
emit
(
user
,
request
.
schema_data
)
if
result
:
if
result
:
return
response_result
(
ResponseCode
.
OK
,
data
=
result
,
msg
=
message
,
count
=
count
)
return
response_result
(
ResponseCode
.
OK
,
data
=
result
,
msg
=
message
,
count
=
count
)
else
:
else
:
...
...
backend/view/download.py
View file @
4451a647
...
@@ -54,11 +54,6 @@ def get():
...
@@ -54,11 +54,6 @@ def get():
try
:
try
:
result
,
message
=
signalManager
.
actionGetDownload
.
emit
(
request
.
schema_data
)
result
,
message
=
signalManager
.
actionGetDownload
.
emit
(
request
.
schema_data
)
print
(
message
)
print
(
message
)
# if result:
# return response_result(ResponseCode.OK, data=result, msg=message)
# else:
# return response_result(ResponseCode.REQUEST_ERROR, msg=message)
# 读取epk文件,按照格式返回相应结构体数据
# 读取epk文件,按照格式返回相应结构体数据
ret
=
""
ret
=
""
if
os
.
path
.
exists
(
result
):
if
os
.
path
.
exists
(
result
):
...
...
backend/view/login.py
View file @
4451a647
...
@@ -66,8 +66,7 @@ def register():
...
@@ -66,8 +66,7 @@ def register():
'''
'''
try
:
try
:
isSuccess
,
message
=
signalManager
.
actionRegister
.
emit
(
isSuccess
,
message
=
signalManager
.
actionRegister
.
emit
(
request
.
schema_data
)
request
.
schema_data
)
if
isSuccess
:
if
isSuccess
:
return
response_result
(
ResponseCode
.
OK
,
msg
=
message
)
return
response_result
(
ResponseCode
.
OK
,
msg
=
message
)
else
:
else
:
...
...
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