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
5e1f3e7a
Commit
5e1f3e7a
authored
Jul 20, 2021
by
wanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix(): 手表后端接口
parent
da0ac451
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
66 additions
and
34 deletions
+66
-34
tools/build_out/application/signal_manager.py
tools/build_out/application/signal_manager.py
+2
-1
tools/build_out/controllers/__init__.py
tools/build_out/controllers/__init__.py
+2
-1
tools/build_out/controllers/api.py
tools/build_out/controllers/api.py
+15
-2
tools/build_out/models/app.py
tools/build_out/models/app.py
+18
-11
tools/build_out/result.json
tools/build_out/result.json
+1
-1
tools/build_out/views/app.py
tools/build_out/views/app.py
+1
-1
tools/build_out/views/openapi.py
tools/build_out/views/openapi.py
+22
-12
tools/frontend/src/views/Application/Form.vue
tools/frontend/src/views/Application/Form.vue
+4
-4
tools/frontend/src/views/Application/Index.vue
tools/frontend/src/views/Application/Index.vue
+1
-1
No files found.
tools/build_out/application/signal_manager.py
View file @
5e1f3e7a
'''
'''
Author: your name
Author: your name
Date: 2021-06-30 18:03:41
Date: 2021-06-30 18:03:41
LastEditTime: 2021-07-20 1
0:23:06
LastEditTime: 2021-07-20 1
7:12:57
LastEditors: Please set LastEditors
LastEditors: Please set LastEditors
Description: In User Settings Edit
Description: In User Settings Edit
FilePath:
\
evm-store
\t
ools
\b
uild_out
\a
pplication
\
signal_manager.py
FilePath:
\
evm-store
\t
ools
\b
uild_out
\a
pplication
\
signal_manager.py
...
@@ -72,6 +72,7 @@ class SignalManager(object):
...
@@ -72,6 +72,7 @@ class SignalManager(object):
actionGetAppList
=
PySignal
()
actionGetAppList
=
PySignal
()
actionGetEpk
=
PySignal
()
actionGetEpk
=
PySignal
()
actionApplicationBuild
=
PySignal
()
actionApplicationBuild
=
PySignal
()
actionCheckVersion
=
PySignal
()
def
__init__
(
self
):
def
__init__
(
self
):
super
()
.
__init__
()
super
()
.
__init__
()
...
...
tools/build_out/controllers/__init__.py
View file @
5e1f3e7a
'''
'''
Author: your name
Author: your name
Date: 2021-06-30 17:43:46
Date: 2021-06-30 17:43:46
LastEditTime: 2021-07-20 1
0:23:19
LastEditTime: 2021-07-20 1
7:13:15
LastEditors: Please set LastEditors
LastEditors: Please set LastEditors
Description: In User Settings Edit
Description: In User Settings Edit
FilePath:
\
evm-store
\t
ools
\b
uild_out
\
controllers
\
__init__.py
FilePath:
\
evm-store
\t
ools
\b
uild_out
\
controllers
\
__init__.py
...
@@ -86,3 +86,4 @@ def initConnect():
...
@@ -86,3 +86,4 @@ def initConnect():
signalManager
.
actionGetAppList
.
connect
(
appReview
.
getAppList
)
signalManager
.
actionGetAppList
.
connect
(
appReview
.
getAppList
)
signalManager
.
actionGetApplication
.
connect
(
appReview
.
getApp
)
signalManager
.
actionGetApplication
.
connect
(
appReview
.
getApp
)
signalManager
.
actionGetEpk
.
connect
(
appReview
.
getDownloadFile
)
signalManager
.
actionGetEpk
.
connect
(
appReview
.
getDownloadFile
)
signalManager
.
actionCheckVersion
.
connect
(
appReview
.
checkAppVersion
)
tools/build_out/controllers/api.py
View file @
5e1f3e7a
'''
'''
Author: your name
Author: your name
Date: 2021-07-12 11:14:48
Date: 2021-07-12 11:14:48
LastEditTime: 2021-07-20 1
1:56:53
LastEditTime: 2021-07-20 1
7:11:57
LastEditors: Please set LastEditors
LastEditors: Please set LastEditors
Description: In User Settings Edit
Description: In User Settings Edit
FilePath:
\
evm-store
\t
ools
\b
uild_out
\
controllers
\a
ppi.py
FilePath:
\
evm-store
\t
ools
\b
uild_out
\
controllers
\a
ppi.py
...
@@ -164,13 +164,26 @@ class AppReview(object):
...
@@ -164,13 +164,26 @@ class AppReview(object):
return
True
,
ResponseCode
.
HTTP_SUCCESS
return
True
,
ResponseCode
.
HTTP_SUCCESS
def
getApp
(
self
,
params
,
jwt
=
{}):
def
getApp
(
self
,
params
,
jwt
=
{}):
logger
.
info
(
166177188
)
app
=
AppModel
.
query
.
filter
(
AppModel
.
uuid
==
params
.
get
(
"uuid"
),
AppModel
.
is_delete
==
False
)
.
one_or_none
()
app
=
AppModel
.
query
.
filter
(
AppModel
.
uuid
==
params
.
get
(
"uuid"
),
AppModel
.
is_delete
==
False
)
.
one_or_none
()
if
not
app
:
if
not
app
:
return
None
,
ResponseCode
.
APPLICATION_NOT_EXISTS
return
None
,
ResponseCode
.
APPLICATION_NOT_EXISTS
return
app
,
ResponseCode
.
HTTP_SUCCESS
return
app
,
ResponseCode
.
HTTP_SUCCESS
def
checkAppVersion
(
self
,
params
,
jwt
=
{}):
app
=
AppModel
.
query
.
filter
(
AppModel
.
uuid
==
params
.
get
(
"uuid"
),
AppModel
.
is_delete
==
False
)
.
one_or_none
()
if
not
app
:
return
None
,
ResponseCode
.
APPLICATION_NOT_EXISTS
pack
=
PackageModel
.
query
.
filter
(
PackageModel
.
app
==
app
.
id
,
PackageModel
.
is_delete
==
False
)
.
order_by
(
PackageModel
.
create_at
.
desc
())
.
one_or_none
()
if
not
pack
:
return
None
,
ResponseCode
.
HTTP_NOT_FOUND
if
pack
!=
params
.
get
(
"app_version"
):
return
True
,
ResponseCode
.
HTTP_SUCCESS
else
:
return
False
,
ResponseCode
.
HTTP_SUCCESS
def
getLauncher
(
self
,
params
,
jwt
=
{}):
def
getLauncher
(
self
,
params
,
jwt
=
{}):
device
=
DeviceModel
.
query
.
filter
(
DeviceModel
.
imei
==
params
.
get
(
"imei"
),
DeviceModel
.
is_delete
==
False
)
.
one_or_none
()
device
=
DeviceModel
.
query
.
filter
(
DeviceModel
.
imei
==
params
.
get
(
"imei"
),
DeviceModel
.
is_delete
==
False
)
.
one_or_none
()
if
not
device
:
if
not
device
:
...
...
tools/build_out/models/app.py
View file @
5e1f3e7a
...
@@ -61,6 +61,7 @@ class AppModel(PrimaryModel):
...
@@ -61,6 +61,7 @@ class AppModel(PrimaryModel):
'app_arch'
:
self
.
app_arch
,
'app_arch'
:
self
.
app_arch
,
'meta_data'
:
self
.
meta_data
,
'meta_data'
:
self
.
meta_data
,
'app_review'
:
self
.
app_review
,
'app_review'
:
self
.
app_review
,
'remarks'
:
self
.
remarks
,
"create_by"
:
self
.
create_by
,
"create_by"
:
self
.
create_by
,
"update_by"
:
self
.
update_by
,
"update_by"
:
self
.
update_by
,
"create_at"
:
self
.
create_at
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
if
self
.
create_at
else
None
,
"create_at"
:
self
.
create_at
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
if
self
.
create_at
else
None
,
...
@@ -105,7 +106,6 @@ class GetListAppSchema(ma.SQLAlchemySchema):
...
@@ -105,7 +106,6 @@ class GetListAppSchema(ma.SQLAlchemySchema):
unknown
=
EXCLUDE
# 未知字段默认排除
unknown
=
EXCLUDE
# 未知字段默认排除
model
=
AppModel
model
=
AppModel
id
=
fields
.
Integer
(
required
=
False
,
nullable
=
True
)
uuid
=
fields
.
String
(
required
=
False
,
nullable
=
True
)
uuid
=
fields
.
String
(
required
=
False
,
nullable
=
True
)
page
=
fields
.
Integer
(
required
=
False
,
default
=
1
,
nullable
=
True
)
page
=
fields
.
Integer
(
required
=
False
,
default
=
1
,
nullable
=
True
)
pageSize
=
fields
.
Integer
(
required
=
False
,
default
=
15
,
nullable
=
True
)
pageSize
=
fields
.
Integer
(
required
=
False
,
default
=
15
,
nullable
=
True
)
...
@@ -135,16 +135,23 @@ class GetAppSchema(ma.SQLAlchemySchema):
...
@@ -135,16 +135,23 @@ class GetAppSchema(ma.SQLAlchemySchema):
unknown
=
EXCLUDE
# 未知字段默认排除
unknown
=
EXCLUDE
# 未知字段默认排除
model
=
AppModel
model
=
AppModel
app_name
=
ma
.
auto_field
()
id
=
fields
.
Integer
(
required
=
False
,
nullable
=
True
)
app_icon
=
ma
.
auto_field
()
uuid
=
fields
.
String
(
required
=
False
,
nullable
=
True
)
app_version
=
ma
.
auto_field
()
app_name
=
fields
.
String
(
required
=
False
,
nullable
=
True
)
category
=
ma
.
auto_field
()
app_icon
=
fields
.
String
(
required
=
False
,
nullable
=
True
)
launcher
=
ma
.
auto_field
()
app_version
=
fields
.
String
(
required
=
False
,
nullable
=
True
)
app_arch
=
ma
.
auto_field
()
algorithm
=
fields
.
String
(
required
=
False
,
nullable
=
True
)
download_url
=
ma
.
auto_field
()
category
=
fields
.
String
(
required
=
False
,
nullable
=
True
)
app_file_size
=
ma
.
auto_field
()
launcher
=
fields
.
String
(
required
=
False
,
nullable
=
True
)
app_screen_size
=
ma
.
auto_field
()
app_arch
=
fields
.
String
(
required
=
False
,
nullable
=
True
)
remarks
=
ma
.
auto_field
()
meta_data
=
fields
.
String
(
required
=
False
,
nullable
=
True
)
download_url
=
fields
.
String
(
required
=
False
,
nullable
=
True
)
app_file_size
=
fields
.
Integer
(
required
=
False
,
nullable
=
True
)
app_screen_size
=
fields
.
String
(
required
=
False
,
nullable
=
True
)
app_review
=
fields
.
Integer
(
required
=
False
,
nullable
=
True
)
create_at
=
fields
.
DateTime
(
required
=
False
,
nullable
=
True
)
update_at
=
fields
.
DateTime
(
required
=
False
,
nullable
=
True
)
remarks
=
fields
.
String
(
required
=
False
)
getAppSchema
=
GetAppSchema
()
getAppSchema
=
GetAppSchema
()
...
...
tools/build_out/result.json
View file @
5e1f3e7a
{
"directories"
:
[{
"basename"
:
"
\u
76f8
\u
518c-1.0.0-2-20210720111035"
,
"dirname"
:
"."
,
"path"
:
"
\u
76f8
\u
518c-1.0.0-2-20210720111035"
,
"timestamp"
:
1626750635
,
"type"
:
"dir"
}],
"files"
:
[]}
{
"directories"
:
[{
"basename"
:
"src"
,
"dirname"
:
"EVUE
\u
8ba1
\u
7b97
\u
5668-1.0.1-2-20210720181325"
,
"path"
:
"EVUE
\u
8ba1
\u
7b97
\u
5668-1.0.1-2-20210720181325/src"
,
"timestamp"
:
1626776005
,
"type"
:
"dir"
}],
"files"
:
[{
"basename"
:
"evm-store.png"
,
"dirname"
:
"EVUE
\u
8ba1
\u
7b97
\u
5668-1.0.1-2-20210720181325"
,
"extension"
:
"png"
,
"filename"
:
"evm-store"
,
"path"
:
"EVUE
\u
8ba1
\u
7b97
\u
5668-1.0.1-2-20210720181325/evm-store.png"
,
"size"
:
17742
,
"timestamp"
:
1626776005
,
"type"
:
"file"
},
{
"basename"
:
"EVUE
\u
8ba1
\u
7b97
\u
5668.epk"
,
"dirname"
:
"EVUE
\u
8ba1
\u
7b97
\u
5668-1.0.1-2-20210720181325"
,
"extension"
:
"epk"
,
"filename"
:
"EVUE
\u
8ba1
\u
7b97
\u
5668"
,
"path"
:
"EVUE
\u
8ba1
\u
7b97
\u
5668-1.0.1-2-20210720181325/EVUE
\u
8ba1
\u
7b97
\u
5668.epk"
,
"size"
:
3326
,
"timestamp"
:
1626776005
,
"type"
:
"file"
}]}
\ No newline at end of file
\ No newline at end of file
tools/build_out/views/app.py
View file @
5e1f3e7a
...
@@ -61,7 +61,7 @@ class AppResourceList(Resource):
...
@@ -61,7 +61,7 @@ class AppResourceList(Resource):
@
jwt_required
(
locations
=
[
"headers"
])
@
jwt_required
(
locations
=
[
"headers"
])
def
post
(
self
):
def
post
(
self
):
self
.
parser
.
add_argument
(
'User-Agent'
,
location
=
'headers'
)
self
.
parser
.
add_argument
(
'User-Agent'
,
location
=
'headers'
)
self
.
parser
.
add_argument
(
"meta_data"
,
type
=
str
,
location
=
"form"
,
required
=
Tru
e
)
self
.
parser
.
add_argument
(
"meta_data"
,
type
=
str
,
location
=
"form"
,
default
=
"{}"
,
required
=
Fals
e
)
self
.
parser
.
add_argument
(
"app_name"
,
type
=
str
,
location
=
"form"
,
required
=
True
)
self
.
parser
.
add_argument
(
"app_name"
,
type
=
str
,
location
=
"form"
,
required
=
True
)
self
.
parser
.
add_argument
(
"app_version"
,
type
=
str
,
location
=
"form"
,
required
=
True
)
self
.
parser
.
add_argument
(
"app_version"
,
type
=
str
,
location
=
"form"
,
required
=
True
)
self
.
parser
.
add_argument
(
"category"
,
type
=
str
,
location
=
"form"
,
required
=
True
)
self
.
parser
.
add_argument
(
"category"
,
type
=
str
,
location
=
"form"
,
required
=
True
)
...
...
tools/build_out/views/openapi.py
View file @
5e1f3e7a
'''
'''
Author: your name
Author: your name
Date: 2021-07-19 14:29:33
Date: 2021-07-19 14:29:33
LastEditTime: 2021-07-20 1
3:37:21
LastEditTime: 2021-07-20 1
7:32:55
LastEditors: Please set LastEditors
LastEditors: Please set LastEditors
Description: In User Settings Edit
Description: In User Settings Edit
FilePath:
\
evm-store
\t
ools
\b
uild_out
\v
iews
\a
pi.py
FilePath:
\
evm-store
\t
ools
\b
uild_out
\v
iews
\a
pi.py
...
@@ -10,6 +10,8 @@ FilePath: \evm-store\tools\build_out\views\api.py
...
@@ -10,6 +10,8 @@ FilePath: \evm-store\tools\build_out\views\api.py
# -*- coding: utf_8 -*-
# -*- coding: utf_8 -*-
import
os
import
os
import
time
import
json
import
random
import
random
import
traceback
import
traceback
from
pathlib
import
Path
from
pathlib
import
Path
...
@@ -284,7 +286,8 @@ class AppListResource(Resource):
...
@@ -284,7 +286,8 @@ class AppListResource(Resource):
for
item
in
result
:
for
item
in
result
:
t
=
item
.
to_dict
()
t
=
item
.
to_dict
()
t
.
update
({
'download'
:
random
.
randint
(
1
,
1000
),
t
.
update
({
'download'
:
random
.
randint
(
1
,
1000
),
'like'
:
random
.
randint
(
0
,
100
)})
'like'
:
random
.
randint
(
0
,
100
),
'meta_data'
:
json
.
loads
(
item
.
meta_data
)})
dataList
.
append
(
t
)
dataList
.
append
(
t
)
# result = getListAppsSchema.dumps(result)
# result = getListAppsSchema.dumps(result)
...
@@ -349,7 +352,11 @@ class App(Resource):
...
@@ -349,7 +352,11 @@ class App(Resource):
result
,
message
=
signalManager
.
actionGetApplication
.
emit
(
data
)
result
,
message
=
signalManager
.
actionGetApplication
.
emit
(
data
)
if
result
:
if
result
:
result
=
getAppSchema
.
dump
(
result
)
result
=
result
.
to_dict
()
result
.
update
({
'download'
:
random
.
randint
(
1
,
1000
),
'like'
:
random
.
randint
(
0
,
100
),
'timestamp'
:
int
(
time
.
time
()),
'meta_data'
:
json
.
loads
(
result
[
"meta_data"
])})
return
response_result
(
message
,
data
=
result
)
return
response_result
(
message
,
data
=
result
)
except
ValidationError
as
e
:
except
ValidationError
as
e
:
return
response_result
(
ResponseCode
.
HTTP_INVAILD_REQUEST
,
data
=
e
.
messages
)
return
response_result
(
ResponseCode
.
HTTP_INVAILD_REQUEST
,
data
=
e
.
messages
)
...
@@ -362,22 +369,28 @@ class App(Resource):
...
@@ -362,22 +369,28 @@ class App(Resource):
return
response_result
(
ResponseCode
.
HTTP_SERVER_ERROR
,
data
=
data
)
return
response_result
(
ResponseCode
.
HTTP_SERVER_ERROR
,
data
=
data
)
# 获取应用信息接口
# 获取应用信息接口
class
AppInfo
(
Resource
):
class
AppInfo
(
Resource
):
def
__init__
(
self
)
->
None
:
def
__init__
(
self
)
->
None
:
super
()
.
__init__
()
super
()
.
__init__
()
self
.
parser
=
RequestParser
()
self
.
parser
=
RequestParser
()
# 检查app是否为最新版本
def
get
(
self
):
def
get
(
self
):
# self.parser.add_argument("page", type=int, location="args", default=1)
self
.
parser
.
add_argument
(
"uuid"
,
type
=
str
,
location
=
"args"
,
required
=
True
)
self
.
parser
.
add_argument
(
self
.
parser
.
add_argument
(
"imei"
,
type
=
str
,
location
=
"args"
,
required
=
True
)
"imei"
,
type
=
str
,
location
=
"args"
,
required
=
True
)
args
=
self
.
parser
.
parse_args
()
args
=
self
.
parser
.
parse_args
()
try
:
try
:
logger
.
info
(
args
)
logger
.
info
(
args
)
return
response_result
(
ResponseCode
.
HTTP_SUCCESS
)
data
=
dict
()
for
key
,
value
in
args
.
items
():
if
value
!=
None
:
data
[
key
]
=
value
result
,
message
=
signalManager
.
actionCheckVersion
.
emit
(
data
)
if
result
:
return
{
'data'
:
{
'status'
:
1
,
'time'
:
int
(
time
.
time
())
},
'version'
:
None
,
'downloadUrl'
:
None
}
return
{
'data'
:
{
'status'
:
0
,
'time'
:
int
(
time
.
time
())
}
}
except
ValidationError
as
e
:
except
ValidationError
as
e
:
return
response_result
(
ResponseCode
.
HTTP_INVAILD_REQUEST
,
data
=
e
.
messages
)
return
response_result
(
ResponseCode
.
HTTP_INVAILD_REQUEST
,
data
=
e
.
messages
)
except
Exception
as
e
:
except
Exception
as
e
:
...
@@ -388,8 +401,6 @@ class AppInfo(Resource):
...
@@ -388,8 +401,6 @@ class AppInfo(Resource):
return
response_result
(
ResponseCode
.
HTTP_SERVER_ERROR
,
data
=
data
)
return
response_result
(
ResponseCode
.
HTTP_SERVER_ERROR
,
data
=
data
)
# 下载EPK文件接口
# 下载EPK文件接口
class
DownloadEpk
(
Resource
):
class
DownloadEpk
(
Resource
):
def
__init__
(
self
)
->
None
:
def
__init__
(
self
)
->
None
:
super
()
.
__init__
()
super
()
.
__init__
()
...
@@ -446,7 +457,6 @@ class DownloadApp(Resource):
...
@@ -446,7 +457,6 @@ class DownloadApp(Resource):
try
:
try
:
print
(
args
)
print
(
args
)
return
response_result
(
ResponseCode
.
HTTP_SUCCESS
)
return
response_result
(
ResponseCode
.
HTTP_SUCCESS
)
except
ValidationError
as
e
:
except
ValidationError
as
e
:
return
response_result
(
ResponseCode
.
HTTP_INVAILD_REQUEST
,
data
=
e
.
messages
)
return
response_result
(
ResponseCode
.
HTTP_INVAILD_REQUEST
,
data
=
e
.
messages
)
...
...
tools/frontend/src/views/Application/Form.vue
View file @
5e1f3e7a
...
@@ -291,10 +291,10 @@ export default {
...
@@ -291,10 +291,10 @@ export default {
},
},
postApplication
(
formData
)
{
postApplication
(
formData
)
{
postApplication
(
formData
).
then
(
res
=>
{
postApplication
(
formData
).
then
(
res
=>
{
//
this.fileList = [];
this
.
fileList
=
[];
//
this.logo = null;
this
.
logo
=
null
;
//
this.post.fileList = [];
this
.
post
.
fileList
=
[];
//
this.post.logo = null;
this
.
post
.
logo
=
null
;
this
.
uploading
=
false
;
this
.
uploading
=
false
;
message
.
success
(
res
.
msg
);
message
.
success
(
res
.
msg
);
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
...
...
tools/frontend/src/views/Application/Index.vue
View file @
5e1f3e7a
...
@@ -216,7 +216,7 @@
...
@@ -216,7 +216,7 @@
style=
"margin: 0"
style=
"margin: 0"
>
>
<p
:style=
"[sya, syb]"
>
<p
:style=
"[sya, syb]"
>
<a-avatar
:src=
"record.
picture
"
shape=
"square"
:size=
"128"
/>
<a-avatar
:src=
"record.
app_icon
"
shape=
"square"
:size=
"128"
/>
</p>
</p>
<p
:style=
"[sya]"
>
Personal
</p>
<p
:style=
"[sya]"
>
Personal
</p>
<a-row>
<a-row>
...
...
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