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
a958fa6f
Commit
a958fa6f
authored
Aug 07, 2019
by
张英杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加接口
parent
85105a0e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
skin_check.py
api/skin_check.py
+22
-1
urls.py
api/urls.py
+1
-1
No files found.
api/skin_check.py
View file @
a958fa6f
...
...
@@ -57,8 +57,29 @@ class SkinCheckConfig(APIView):
def
get
(
self
,
request
):
data
=
{
"skin_color"
:
{},
# 肤色
"temperature"
:
{},
# 色温
"oil_level"
:
{},
# 干油性
"severity"
:
{},
# 毛孔
"roughness"
:
{},
# 粗糙度
"black_head"
:
{},
# 黑头
"dark_circle"
:
{},
# 黑眼圈
"acne"
:
{},
# 痘痘
}
try
:
data
=
self
.
rpc
[
'venus/sun/skin_check/all_config'
]()
.
unwrap
()
venus_data
=
self
.
rpc
[
'venus/sun/skin_check/all_config'
]()
.
unwrap
()
data
.
update
({
"skin_color"
:
venus_data
.
get
(
SKIN_CHECK_ITEMIZE_TYPE
.
SKIN_COLOR
,
{}),
# 肤色
"temperature"
:
venus_data
.
get
(
SKIN_CHECK_ITEMIZE_TYPE
.
TEMPERATURE
,
{}),
# 色温
"oil_level"
:
venus_data
.
get
(
SKIN_CHECK_ITEMIZE_TYPE
.
OIL_LEVEL
,
{}),
# 干油性
"severity"
:
venus_data
.
get
(
SKIN_CHECK_ITEMIZE_TYPE
.
SEVERITY
,
{}),
# 毛孔
"roughness"
:
venus_data
.
get
(
SKIN_CHECK_ITEMIZE_TYPE
.
ROUGHNESS
,
{}),
# 粗糙度
"black_head"
:
venus_data
.
get
(
SKIN_CHECK_ITEMIZE_TYPE
.
BLACK_HEAD
,
{}),
# 黑头
"dark_circle"
:
venus_data
.
get
(
SKIN_CHECK_ITEMIZE_TYPE
.
DARK_CIRCLE
,
{}),
# 黑眼圈
"acne"
:
venus_data
.
get
(
SKIN_CHECK_ITEMIZE_TYPE
.
ACNE
,
{}),
# 痘痘
})
except
Exception
as
e
:
error_logger
.
error
(
u'获取测肤配置失败
%
s'
,
e
)
raise
...
...
api/urls.py
View file @
a958fa6f
...
...
@@ -228,7 +228,7 @@ urlpatterns = [
# 测肤
url
(
r'^skin_check/pictorial$'
,
SkinCheckPictorial
.
as_view
()),
url
(
r'^skin_check/config'
,
SkinCheckConfig
.
as_view
()),
url
(
r'^skin_check/config
$
'
,
SkinCheckConfig
.
as_view
()),
]
search_urlpatterns
=
[
...
...
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