Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
谢林臻
sun
Commits
b1561973
Commit
b1561973
authored
Aug 08, 2019
by
张英杰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/skin_check' into 'test'
sun 测肤变更数据接口 See merge request
alpha/sun!293
parents
89ec5ee2
5bb1c95a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
10 deletions
+30
-10
skin_check.py
api/skin_check.py
+30
-10
No files found.
api/skin_check.py
View file @
b1561973
...
...
@@ -17,7 +17,7 @@ from alpha_types.venus.enum import (
)
from
utils.base
import
APIView
,
get_offset_count
from
utils.logger
import
error_logger
from
utils.logger
import
error_logger
,
info_logger
class
SkinCheckPictorial
(
APIView
):
...
...
@@ -37,16 +37,36 @@ class SkinCheckPictorial(APIView):
return
data
def
post
(
self
,
request
):
"""
榜单信息创建 or 更新
:param request:
:return:
"""
_data
=
json
.
loads
(
request
.
POST
.
get
(
"pictorial_info"
)
or
"[]"
)
# 对变更数据做一层封装
modify_data
=
[]
try
:
self
.
rpc
[
'venus/sun/skin_check/pictorial_update_or_create'
](
modify_data
=
modify_data
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'变更测肤榜单配置失败
%
s'
,
e
)
raise
for
info
in
_data
:
_skin_classify
=
info
.
get
(
"skin_classify"
,
""
)
if
_skin_classify
in
SKIN_ALL_CLASSIFY
:
_data
=
{
"skin_classify"
:
_skin_classify
,
"url"
:
info
.
get
(
"url"
,
""
),
"content"
:
info
.
get
(
"content"
,
""
),
}
modify_data
.
append
(
_data
)
info_logger
.
info
(
"skin_check pictorial modify data: {}"
.
format
(
json
.
dumps
(
modify_data
)))
if
modify_data
:
try
:
self
.
rpc
[
'venus/sun/skin_check/pictorial_update_or_create'
](
modify_data
=
modify_data
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'变更测肤榜单配置失败
%
s'
,
e
)
raise
return
{
"message"
:
u"操作成功"
,
...
...
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