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
35c6ad51
Commit
35c6ad51
authored
Jul 20, 2021
by
wanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat(手表后端接口): 按照需求返回相应参数
parent
b8e0d843
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
112 additions
and
33 deletions
+112
-33
tools/build_out/controllers/api.py
tools/build_out/controllers/api.py
+2
-2
tools/build_out/models/app.py
tools/build_out/models/app.py
+2
-0
tools/build_out/views/openapi.py
tools/build_out/views/openapi.py
+108
-31
No files found.
tools/build_out/controllers/api.py
View file @
35c6ad51
'''
'''
Author: your name
Author: your name
Date: 2021-07-12 11:14:48
Date: 2021-07-12 11:14:48
LastEditTime: 2021-07-20 11:
15:28
LastEditTime: 2021-07-20 11:
56:53
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
...
@@ -172,7 +172,7 @@ class AppReview(object):
...
@@ -172,7 +172,7 @@ class AppReview(object):
return
app
,
ResponseCode
.
HTTP_SUCCESS
return
app
,
ResponseCode
.
HTTP_SUCCESS
def
getLauncher
(
self
,
params
,
jwt
=
{}):
def
getLauncher
(
self
,
params
,
jwt
=
{}):
device
=
DeviceModel
.
query
.
filter
(
DeviceModel
.
imei
==
params
.
get
(
"imei"
),
App
Model
.
is_delete
==
False
)
.
one_or_none
()
device
=
DeviceModel
.
query
.
filter
(
DeviceModel
.
imei
==
params
.
get
(
"imei"
),
Device
Model
.
is_delete
==
False
)
.
one_or_none
()
if
not
device
:
if
not
device
:
return
None
,
ResponseCode
.
DEVICE_NOT_EXISTS
return
None
,
ResponseCode
.
DEVICE_NOT_EXISTS
...
...
tools/build_out/models/app.py
View file @
35c6ad51
...
@@ -48,6 +48,7 @@ class AppModel(PrimaryModel):
...
@@ -48,6 +48,7 @@ class AppModel(PrimaryModel):
def
to_dict
(
self
):
def
to_dict
(
self
):
return
{
return
{
'uuid'
:
self
.
uuid
,
'app_name'
:
self
.
app_name
,
'app_name'
:
self
.
app_name
,
'app_icon'
:
self
.
app_icon
,
'app_icon'
:
self
.
app_icon
,
'app_version'
:
self
.
app_version
,
'app_version'
:
self
.
app_version
,
...
@@ -83,6 +84,7 @@ class PostAppSchema(ma.SQLAlchemySchema):
...
@@ -83,6 +84,7 @@ class PostAppSchema(ma.SQLAlchemySchema):
app_screen_size
=
ma
.
auto_field
()
app_screen_size
=
ma
.
auto_field
()
app_arch
=
ma
.
auto_field
()
app_arch
=
ma
.
auto_field
()
app_review
=
ma
.
auto_field
(
required
=
False
)
app_review
=
ma
.
auto_field
(
required
=
False
)
remarks
=
fields
.
String
(
required
=
False
)
logo
=
fields
.
Raw
(
required
=
False
)
logo
=
fields
.
Raw
(
required
=
False
)
fileList
=
fields
.
Raw
(
required
=
False
)
fileList
=
fields
.
Raw
(
required
=
False
)
...
...
tools/build_out/views/openapi.py
View file @
35c6ad51
'''
'''
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
1:35:45
LastEditTime: 2021-07-20 1
3:37:21
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
...
@@ -17,17 +17,18 @@ from datetime import datetime
...
@@ -17,17 +17,18 @@ from datetime import datetime
from
flask
import
current_app
,
jsonify
,
request
,
Response
from
flask
import
current_app
,
jsonify
,
request
,
Response
from
flask_restful
import
Resource
from
flask_restful
import
Resource
from
flask_restful.reqparse
import
RequestParser
from
flask_restful.reqparse
import
RequestParser
from
flask_jwt_extended
import
(
jwt_required
,
get_jwt_identity
)
from
flask_jwt_extended
import
(
jwt_required
,
get_jwt_identity
)
from
werkzeug.utils
import
secure_filename
from
werkzeug.utils
import
secure_filename
from
werkzeug.datastructures
import
FileStorage
from
werkzeug.datastructures
import
FileStorage
from
marshmallow.exceptions
import
ValidationError
from
marshmallow.exceptions
import
ValidationError
from
application.config
import
config
from
application.config
import
config
from
application.signal_manager
import
signalManager
from
application.signal_manager
import
signalManager
from
models.app
import
postAppSchema
,
deleteAppSchema
,
getListAppSchema
,
getListAppsSchema
,
getAppSchema
from
models.app
import
postAppSchema
,
deleteAppSchema
,
getListAppSchema
,
getListAppsSchema
,
getAppSchema
from
webcreator.log
import
logger
from
webcreator.log
import
logger
from
webcreator.utils.ccode
import
convert_string
from
webcreator.utils.ccode
import
convert_string
from
webcreator.response
import
ResponseCode
,
response_result
from
webcreator.response
import
ResponseCode
,
response_result
class
AppReviewResource
(
Resource
):
class
AppReviewResource
(
Resource
):
def
__init__
(
self
):
def
__init__
(
self
):
self
.
parser
=
RequestParser
()
self
.
parser
=
RequestParser
()
...
@@ -35,7 +36,8 @@ class AppReviewResource(Resource):
...
@@ -35,7 +36,8 @@ class AppReviewResource(Resource):
# 设置启动器接口
# 设置启动器接口
@
jwt_required
(
locations
=
[
"headers"
])
@
jwt_required
(
locations
=
[
"headers"
])
def
get
(
self
):
def
get
(
self
):
self
.
parser
.
add_argument
(
"app"
,
type
=
str
,
location
=
"args"
,
required
=
False
)
self
.
parser
.
add_argument
(
"app"
,
type
=
str
,
location
=
"args"
,
required
=
False
)
args
=
self
.
parser
.
parse_args
()
args
=
self
.
parser
.
parse_args
()
try
:
try
:
...
@@ -61,13 +63,16 @@ class AppReviewResource(Resource):
...
@@ -61,13 +63,16 @@ class AppReviewResource(Resource):
@
jwt_required
(
locations
=
[
"headers"
])
@
jwt_required
(
locations
=
[
"headers"
])
def
post
(
self
):
def
post
(
self
):
self
.
parser
.
add_argument
(
"review"
,
type
=
int
,
location
=
"json"
,
default
=
0
,
required
=
True
)
self
.
parser
.
add_argument
(
self
.
parser
.
add_argument
(
"app"
,
type
=
str
,
location
=
"json"
,
required
=
False
)
"review"
,
type
=
int
,
location
=
"json"
,
default
=
0
,
required
=
True
)
self
.
parser
.
add_argument
(
"app"
,
type
=
str
,
location
=
"json"
,
required
=
False
)
args
=
self
.
parser
.
parse_args
()
args
=
self
.
parser
.
parse_args
()
try
:
try
:
jwt
=
get_jwt_identity
()
jwt
=
get_jwt_identity
()
result
,
message
=
signalManager
.
actionPostAppReview
.
emit
(
args
.
app
,
args
.
review
,
jwt
)
result
,
message
=
signalManager
.
actionPostAppReview
.
emit
(
args
.
app
,
args
.
review
,
jwt
)
if
result
:
if
result
:
return
response_result
(
message
,
data
=
result
)
return
response_result
(
message
,
data
=
result
)
return
response_result
(
message
)
return
response_result
(
message
)
...
@@ -87,12 +92,18 @@ class BuildAppResource(Resource):
...
@@ -87,12 +92,18 @@ class BuildAppResource(Resource):
self
.
parser
=
RequestParser
()
self
.
parser
=
RequestParser
()
def
post
(
self
):
def
post
(
self
):
self
.
parser
.
add_argument
(
"access_key"
,
type
=
str
,
location
=
"form"
,
required
=
True
)
self
.
parser
.
add_argument
(
self
.
parser
.
add_argument
(
"app_name"
,
type
=
str
,
location
=
"form"
,
required
=
True
)
"access_key"
,
type
=
str
,
location
=
"form"
,
required
=
True
)
self
.
parser
.
add_argument
(
"app_version"
,
type
=
str
,
location
=
"form"
,
required
=
True
)
self
.
parser
.
add_argument
(
"app_name"
,
type
=
str
,
self
.
parser
.
add_argument
(
"category"
,
type
=
str
,
location
=
"form"
,
required
=
True
)
location
=
"form"
,
required
=
True
)
self
.
parser
.
add_argument
(
"app_desc"
,
type
=
str
,
location
=
"form"
,
required
=
False
)
self
.
parser
.
add_argument
(
self
.
parser
.
add_argument
(
"binfiles"
,
type
=
FileStorage
,
location
=
"files"
,
required
=
True
)
"app_version"
,
type
=
str
,
location
=
"form"
,
required
=
True
)
self
.
parser
.
add_argument
(
"category"
,
type
=
str
,
location
=
"form"
,
required
=
True
)
self
.
parser
.
add_argument
(
"app_desc"
,
type
=
str
,
location
=
"form"
,
required
=
False
)
self
.
parser
.
add_argument
(
"binfiles"
,
type
=
FileStorage
,
location
=
"files"
,
required
=
True
)
args
=
self
.
parser
.
parse_args
()
args
=
self
.
parser
.
parse_args
()
try
:
try
:
...
@@ -104,16 +115,19 @@ class BuildAppResource(Resource):
...
@@ -104,16 +115,19 @@ class BuildAppResource(Resource):
if
'binfiles'
in
request
.
files
:
if
'binfiles'
in
request
.
files
:
files
=
[]
files
=
[]
dt
=
datetime
.
now
()
.
strftime
(
"
%
Y
%
m
%
d
%
H
%
M
%
S"
)
dt
=
datetime
.
now
()
.
strftime
(
"
%
Y
%
m
%
d
%
H
%
M
%
S"
)
upload_path
=
Path
(
config
.
EPK_DIR
)
.
joinpath
(
args
.
access_key
)
.
joinpath
(
dt
)
upload_path
=
Path
(
config
.
EPK_DIR
)
.
joinpath
(
args
.
access_key
)
.
joinpath
(
dt
)
if
not
upload_path
.
exists
():
if
not
upload_path
.
exists
():
os
.
makedirs
(
upload_path
.
resolve
()
.
as_posix
())
os
.
makedirs
(
upload_path
.
resolve
()
.
as_posix
())
for
f
in
request
.
files
.
getlist
(
'binfiles'
):
for
f
in
request
.
files
.
getlist
(
'binfiles'
):
file_path
=
upload_path
.
joinpath
(
secure_filename
(
f
.
filename
))
file_path
=
upload_path
.
joinpath
(
secure_filename
(
f
.
filename
))
f
.
save
(
file_path
.
resolve
()
.
as_posix
())
f
.
save
(
file_path
.
resolve
()
.
as_posix
())
files
.
append
(
file_path
.
resolve
()
.
as_posix
())
files
.
append
(
file_path
.
resolve
()
.
as_posix
())
result
,
message
=
signalManager
.
actionApplicationBuild
.
emit
(
data
,
files
)
result
,
message
=
signalManager
.
actionApplicationBuild
.
emit
(
data
,
files
)
if
result
:
if
result
:
return
response_result
(
ResponseCode
.
HTTP_SUCCESS
,
data
=
result
)
return
response_result
(
ResponseCode
.
HTTP_SUCCESS
,
data
=
result
)
else
:
else
:
...
@@ -125,6 +139,7 @@ class BuildAppResource(Resource):
...
@@ -125,6 +139,7 @@ class BuildAppResource(Resource):
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
return
response_result
(
ResponseCode
.
HTTP_SERVER_ERROR
)
return
response_result
(
ResponseCode
.
HTTP_SERVER_ERROR
)
class
CStringToolResource
(
Resource
):
class
CStringToolResource
(
Resource
):
def
__init__
(
self
):
def
__init__
(
self
):
# 特殊参数,即不是从json获取参数的接口,可以将这个注释打开
# 特殊参数,即不是从json获取参数的接口,可以将这个注释打开
...
@@ -132,7 +147,8 @@ class CStringToolResource(Resource):
...
@@ -132,7 +147,8 @@ class CStringToolResource(Resource):
@
jwt_required
(
locations
=
[
"headers"
])
@
jwt_required
(
locations
=
[
"headers"
])
def
post
(
self
):
def
post
(
self
):
self
.
parser
.
add_argument
(
"string"
,
type
=
str
,
location
=
"json"
,
required
=
True
)
self
.
parser
.
add_argument
(
"string"
,
type
=
str
,
location
=
"json"
,
required
=
True
)
args
=
self
.
parser
.
parse_args
()
args
=
self
.
parser
.
parse_args
()
try
:
try
:
...
@@ -148,6 +164,7 @@ class CStringToolResource(Resource):
...
@@ -148,6 +164,7 @@ class CStringToolResource(Resource):
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
return
response_result
(
ResponseCode
.
HTTP_SERVER_ERROR
,
data
=
data
)
return
response_result
(
ResponseCode
.
HTTP_SERVER_ERROR
,
data
=
data
)
class
ObfuscatedCode
(
Resource
):
class
ObfuscatedCode
(
Resource
):
def
__init__
(
self
)
->
None
:
def
__init__
(
self
)
->
None
:
super
()
.
__init__
()
super
()
.
__init__
()
...
@@ -156,7 +173,8 @@ class ObfuscatedCode(Resource):
...
@@ -156,7 +173,8 @@ class ObfuscatedCode(Resource):
def
post
(
self
):
def
post
(
self
):
# 特殊参数,即不是从json获取参数的接口,可以将这个注释打开
# 特殊参数,即不是从json获取参数的接口,可以将这个注释打开
# self.parser.add_argument("page", type=int, location="args", default=1)
# self.parser.add_argument("page", type=int, location="args", default=1)
self
.
parser
.
add_argument
(
"string"
,
type
=
str
,
location
=
"json"
,
required
=
True
)
self
.
parser
.
add_argument
(
"string"
,
type
=
str
,
location
=
"json"
,
required
=
True
)
args
=
self
.
parser
.
parse_args
()
args
=
self
.
parser
.
parse_args
()
try
:
try
:
...
@@ -193,6 +211,8 @@ class ObfuscatedCode(Resource):
...
@@ -193,6 +211,8 @@ class ObfuscatedCode(Resource):
return
response_result
(
ResponseCode
.
HTTP_SERVER_ERROR
,
data
=
data
)
return
response_result
(
ResponseCode
.
HTTP_SERVER_ERROR
,
data
=
data
)
# 获取启动器接口
# 获取启动器接口
class
LauncherResource
(
Resource
):
class
LauncherResource
(
Resource
):
def
__init__
(
self
)
->
None
:
def
__init__
(
self
)
->
None
:
super
()
.
__init__
()
super
()
.
__init__
()
...
@@ -200,7 +220,8 @@ class LauncherResource(Resource):
...
@@ -200,7 +220,8 @@ class LauncherResource(Resource):
def
post
(
self
):
def
post
(
self
):
# self.parser.add_argument("page", type=int, location="args", default=1)
# self.parser.add_argument("page", type=int, location="args", default=1)
self
.
parser
.
add_argument
(
"imei"
,
type
=
str
,
location
=
"json"
,
required
=
True
)
self
.
parser
.
add_argument
(
"imei"
,
type
=
str
,
location
=
"json"
,
required
=
True
)
args
=
self
.
parser
.
parse_args
()
args
=
self
.
parser
.
parse_args
()
try
:
try
:
...
@@ -226,15 +247,27 @@ class LauncherResource(Resource):
...
@@ -226,15 +247,27 @@ class LauncherResource(Resource):
return
response_result
(
ResponseCode
.
HTTP_SERVER_ERROR
,
data
=
data
)
return
response_result
(
ResponseCode
.
HTTP_SERVER_ERROR
,
data
=
data
)
# 获取App列表接口
# 获取App列表接口
class
AppListResource
(
Resource
):
class
AppListResource
(
Resource
):
def
__init__
(
self
)
->
None
:
def
__init__
(
self
)
->
None
:
super
()
.
__init__
()
super
()
.
__init__
()
self
.
parser
=
RequestParser
()
self
.
parser
=
RequestParser
()
def
get
(
self
):
try
:
return
response_result
(
ResponseCode
.
HTTP_SUCCESS
)
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
return
response_result
(
ResponseCode
.
HTTP_SERVER_ERROR
)
def
post
(
self
):
def
post
(
self
):
self
.
parser
.
add_argument
(
"imei"
,
type
=
str
,
location
=
"json"
,
required
=
False
)
self
.
parser
.
add_argument
(
self
.
parser
.
add_argument
(
"review"
,
type
=
int
,
location
=
"json"
,
required
=
False
)
"imei"
,
type
=
str
,
location
=
"json"
,
required
=
False
)
self
.
parser
.
add_argument
(
"category"
,
type
=
str
,
location
=
"json"
,
required
=
False
)
self
.
parser
.
add_argument
(
"review"
,
type
=
int
,
location
=
"json"
,
required
=
False
)
self
.
parser
.
add_argument
(
"category"
,
type
=
str
,
location
=
"json"
,
required
=
False
)
args
=
self
.
parser
.
parse_args
()
args
=
self
.
parser
.
parse_args
()
try
:
try
:
...
@@ -250,10 +283,40 @@ class AppListResource(Resource):
...
@@ -250,10 +283,40 @@ 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
),
'like'
:
random
.
randint
(
0
,
100
)
})
t
.
update
({
'download'
:
random
.
randint
(
1
,
1000
),
'like'
:
random
.
randint
(
0
,
100
)})
dataList
.
append
(
t
)
dataList
.
append
(
t
)
# result = getListAppsSchema.dumps(result)
# result = getListAppsSchema.dumps(result)
return
response_result
(
message
,
data
=
dataList
)
category
=
[
{
"uuid"
:
1
,
"img"
:
"music.png"
,
"title"
:
"音乐"
},
{
"uuid"
:
2
,
"img"
:
"movie.png"
,
"title"
:
"视频"
},
{
"uuid"
:
3
,
"img"
:
"camera.png"
,
"title"
:
"相机"
},
{
"uuid"
:
4
,
"img"
:
"voice.png"
,
"title"
:
"语音"
},
{
"uuid"
:
5
,
"img"
:
"tool.png"
,
"title"
:
"工具"
}
]
return
response_result
(
message
,
data
=
dataList
,
category
=
category
)
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
:
...
@@ -265,6 +328,8 @@ class AppListResource(Resource):
...
@@ -265,6 +328,8 @@ class AppListResource(Resource):
return
response_result
(
ResponseCode
.
HTTP_SERVER_ERROR
,
data
=
data
)
return
response_result
(
ResponseCode
.
HTTP_SERVER_ERROR
,
data
=
data
)
# 获取应用接口
# 获取应用接口
class
App
(
Resource
):
class
App
(
Resource
):
def
__init__
(
self
)
->
None
:
def
__init__
(
self
)
->
None
:
super
()
.
__init__
()
super
()
.
__init__
()
...
@@ -272,7 +337,8 @@ class App(Resource):
...
@@ -272,7 +337,8 @@ class App(Resource):
def
get
(
self
):
def
get
(
self
):
# self.parser.add_argument("page", type=int, location="args", default=1)
# 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
(
"uuid"
,
type
=
str
,
location
=
"args"
,
required
=
True
)
args
=
self
.
parser
.
parse_args
()
args
=
self
.
parser
.
parse_args
()
try
:
try
:
...
@@ -296,6 +362,8 @@ class App(Resource):
...
@@ -296,6 +362,8 @@ 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__
()
...
@@ -303,7 +371,8 @@ class AppInfo(Resource):
...
@@ -303,7 +371,8 @@ class AppInfo(Resource):
def
get
(
self
):
def
get
(
self
):
# self.parser.add_argument("page", type=int, location="args", default=1)
# self.parser.add_argument("page", type=int, location="args", default=1)
self
.
parser
.
add_argument
(
"imei"
,
type
=
str
,
location
=
"args"
,
required
=
True
)
self
.
parser
.
add_argument
(
"imei"
,
type
=
str
,
location
=
"args"
,
required
=
True
)
args
=
self
.
parser
.
parse_args
()
args
=
self
.
parser
.
parse_args
()
try
:
try
:
...
@@ -319,15 +388,20 @@ class AppInfo(Resource):
...
@@ -319,15 +388,20 @@ 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__
()
self
.
parser
=
RequestParser
()
self
.
parser
=
RequestParser
()
def
post
(
self
):
def
post
(
self
):
self
.
parser
.
add_argument
(
"byId"
,
type
=
str
,
location
=
"json"
,
required
=
True
)
self
.
parser
.
add_argument
(
self
.
parser
.
add_argument
(
"uuid"
,
type
=
str
,
location
=
"json"
,
required
=
True
)
"byId"
,
type
=
str
,
location
=
"json"
,
required
=
True
)
self
.
parser
.
add_argument
(
"imei"
,
type
=
str
,
location
=
"json"
,
required
=
True
)
self
.
parser
.
add_argument
(
"uuid"
,
type
=
str
,
location
=
"json"
,
required
=
True
)
self
.
parser
.
add_argument
(
"imei"
,
type
=
str
,
location
=
"json"
,
required
=
True
)
args
=
self
.
parser
.
parse_args
()
args
=
self
.
parser
.
parse_args
()
try
:
try
:
...
@@ -337,7 +411,8 @@ class DownloadEpk(Resource):
...
@@ -337,7 +411,8 @@ class DownloadEpk(Resource):
if
value
!=
None
:
if
value
!=
None
:
data
[
key
]
=
value
data
[
key
]
=
value
data
.
update
({
'real_ip'
:
request
.
headers
.
get
(
'X-Forwarded-For'
,
'127.0.0.1'
)
})
data
.
update
({
'real_ip'
:
request
.
headers
.
get
(
'X-Forwarded-For'
,
'127.0.0.1'
)})
result
,
message
=
signalManager
.
actionGetEpk
.
emit
(
data
)
result
,
message
=
signalManager
.
actionGetEpk
.
emit
(
data
)
# 读取epk文件,按照格式返回相应结构体数据
# 读取epk文件,按照格式返回相应结构体数据
logger
.
info
(
data
)
logger
.
info
(
data
)
...
@@ -357,6 +432,7 @@ class DownloadEpk(Resource):
...
@@ -357,6 +432,7 @@ class DownloadEpk(Resource):
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
return
response_result
(
ResponseCode
.
HTTP_SERVER_ERROR
,
data
=
data
)
return
response_result
(
ResponseCode
.
HTTP_SERVER_ERROR
,
data
=
data
)
class
DownloadApp
(
Resource
):
class
DownloadApp
(
Resource
):
def
__init__
(
self
)
->
None
:
def
__init__
(
self
)
->
None
:
super
()
.
__init__
()
super
()
.
__init__
()
...
@@ -364,7 +440,8 @@ class DownloadApp(Resource):
...
@@ -364,7 +440,8 @@ class DownloadApp(Resource):
def
get
(
self
):
def
get
(
self
):
# self.parser.add_argument("page", type=int, location="args", default=1)
# self.parser.add_argument("page", type=int, location="args", default=1)
self
.
parser
.
add_argument
(
"imei"
,
type
=
str
,
location
=
"json"
,
required
=
True
)
self
.
parser
.
add_argument
(
"imei"
,
type
=
str
,
location
=
"json"
,
required
=
True
)
args
=
self
.
parser
.
parse_args
()
args
=
self
.
parser
.
parse_args
()
try
:
try
:
...
...
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