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
72acbb89
Commit
72acbb89
authored
Aug 08, 2019
by
张英杰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/skin_check' into 'test'
修改配置 See merge request
alpha/sun!295
parents
b9618efd
732e1d7a
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 @
72acbb89
...
@@ -86,6 +86,20 @@ class SkinCheckConfig(APIView):
...
@@ -86,6 +86,20 @@ class SkinCheckConfig(APIView):
"black_head"
:
{},
# 黑头
"black_head"
:
{},
# 黑头
"dark_circle"
:
{},
# 黑眼圈
"dark_circle"
:
{},
# 黑眼圈
"acne"
:
{},
# 痘痘
"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
:
try
:
...
@@ -107,16 +121,37 @@ class SkinCheckConfig(APIView):
...
@@ -107,16 +121,37 @@ class SkinCheckConfig(APIView):
return
data
return
data
def
post
(
self
,
request
):
def
post
(
self
,
request
):
"""
配置 创建/修改
:param request:
:return:
"""
_data
=
json
.
loads
(
request
.
POST
.
get
(
"config_info"
)
or
"[]"
)
# 对变更数据做一层封装
modify_data
=
[]
modify_data
=
[]
try
:
for
info
in
_data
:
self
.
rpc
[
'venus/sun/skin_check/config_update_or_create'
](
_data
=
{
modify_data
=
modify_data
"skin_check_itemize_type"
:
info
.
get
(
"owner_enum"
,
""
),
)
.
unwrap
()
"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
:
if
modify_data
:
error_logger
.
error
(
u'变更测肤配置失败
%
s'
,
e
)
try
:
raise
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
{
return
{
"message"
:
u"操作成功"
,
"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