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
85105a0e
Commit
85105a0e
authored
Aug 07, 2019
by
张英杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sun增加测肤
parent
6277338f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
0 deletions
+87
-0
skin_check.py
api/skin_check.py
+82
-0
urls.py
api/urls.py
+5
-0
No files found.
api/skin_check.py
0 → 100644
View file @
85105a0e
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import
json
from
alpha_types.venus.enum
import
(
SKIN_ALL_CLASSIFY
,
SKIN_CHECK_ITEMIZE_TYPE
,
SKIN_QUALITY_COLOR_DESC
,
SKIN_QUALITY_TEMPERATURE
,
SKIN_QUALITY_OIL_LEVEL
,
SKIN_PORE_SEVERITY
,
SKIN_ROUGHNESS_TYPE
,
SKIN_ACNE_TYPE
,
SKIN_BLACK_HEADS_TYPE
,
SKIN_DARK_CIRCLE_TYPE
,
)
from
utils.base
import
APIView
,
get_offset_count
from
utils.logger
import
error_logger
class
SkinCheckPictorial
(
APIView
):
def
get
(
self
,
request
):
try
:
data
=
self
.
rpc
[
'venus/sun/skin_check/get_pictorial_info'
]()
.
unwrap
()
for
item
in
data
:
if
item
.
get
(
"skin_classify"
)
==
SKIN_ALL_CLASSIFY
.
SKIN_QUALITY
:
item
[
"skin_classifiy_desc"
]
=
u"肤色"
except
Exception
as
e
:
error_logger
.
error
(
u'获取测肤榜单配置失败
%
s'
,
e
)
raise
return
data
def
post
(
self
,
request
):
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"操作成功"
,
}
class
SkinCheckConfig
(
APIView
):
def
get
(
self
,
request
):
try
:
data
=
self
.
rpc
[
'venus/sun/skin_check/all_config'
]()
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'获取测肤配置失败
%
s'
,
e
)
raise
return
data
def
post
(
self
,
request
):
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"操作成功"
,
}
api/urls.py
View file @
85105a0e
...
...
@@ -31,6 +31,7 @@ from .product import *
from
.category
import
*
from
.classify
import
*
from
.effect
import
*
from
.skin_check
import
*
from
.reply
import
*
...
...
@@ -224,6 +225,10 @@ urlpatterns = [
url
(
r'^reply/manage/list$'
,
ReplyManageListView
.
as_view
()),
url
(
r'^reply/manage/create$'
,
ReplyManageCreateView
.
as_view
()),
url
(
r'^reply/manage/batch/update$'
,
ReplyManageBatchUpdate
.
as_view
()),
# 测肤
url
(
r'^skin_check/pictorial$'
,
SkinCheckPictorial
.
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