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
1
Merge Requests
1
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
alpha
sun
Commits
732e1d7a
Commit
732e1d7a
authored
Aug 08, 2019
by
张英杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改配置
parent
5bb1c95a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
7 deletions
+42
-7
skin_check.py
api/skin_check.py
+42
-7
No files found.
api/skin_check.py
View file @
732e1d7a
...
...
@@ -86,6 +86,20 @@ class SkinCheckConfig(APIView):
"black_head"
:
{},
# 黑头
"dark_circle"
:
{},
# 黑眼圈
"acne"
:
{},
# 痘痘
"type_1"
:
[
SKIN_CHECK_ITEMIZE_TYPE
.
SKIN_COLOR
,
SKIN_CHECK_ITEMIZE_TYPE
.
TEMPERATURE
,
SKIN_CHECK_ITEMIZE_TYPE
.
OIL_LEVEL
,
],
"type_2"
:
[
SKIN_CHECK_ITEMIZE_TYPE
.
SEVERITY
,
SKIN_CHECK_ITEMIZE_TYPE
.
ROUGHNESS
,
],
"type_3"
:
[
SKIN_CHECK_ITEMIZE_TYPE
.
BLACK_HEAD
,
SKIN_CHECK_ITEMIZE_TYPE
.
DARK_CIRCLE
,
SKIN_CHECK_ITEMIZE_TYPE
.
ACNE
,
],
}
try
:
...
...
@@ -107,16 +121,37 @@ class SkinCheckConfig(APIView):
return
data
def
post
(
self
,
request
):
"""
配置 创建/修改
:param request:
:return:
"""
_data
=
json
.
loads
(
request
.
POST
.
get
(
"config_info"
)
or
"[]"
)
# 对变更数据做一层封装
modify_data
=
[]
try
:
self
.
rpc
[
'venus/sun/skin_check/config_update_or_create'
](
modify_data
=
modify_data
)
.
unwrap
()
for
info
in
_data
:
_data
=
{
"skin_check_itemize_type"
:
info
.
get
(
"owner_enum"
,
""
),
"enum_value"
:
info
.
get
(
"enum_value"
,
""
),
"fitting"
:
info
.
get
(
"fitting"
,
""
),
"dread"
:
info
.
get
(
"fitting"
,
""
),
"fitting_suggest"
:
info
.
get
(
"fitting_suggest"
,
""
),
"dread_suggest"
:
info
.
get
(
"dread_suggest"
,
""
)
}
modify_data
.
append
(
_data
)
info_logger
.
info
(
"skin_check config modify data: {}"
.
format
(
json
.
dumps
(
modify_data
)))
except
Exception
as
e
:
error_logger
.
error
(
u'变更测肤配置失败
%
s'
,
e
)
raise
if
modify_data
:
try
:
self
.
rpc
[
'venus/sun/skin_check/config_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