Commit a958fa6f authored by 张英杰's avatar 张英杰

增加接口

parent 85105a0e
......@@ -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
......
......@@ -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 = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment