Commit 732e1d7a authored by 张英杰's avatar 张英杰

修改配置

parent 5bb1c95a
...@@ -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,8 +121,29 @@ class SkinCheckConfig(APIView): ...@@ -107,8 +121,29 @@ 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 = []
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)))
if modify_data:
try: try:
self.rpc['venus/sun/skin_check/config_update_or_create']( self.rpc['venus/sun/skin_check/config_update_or_create'](
modify_data=modify_data modify_data=modify_data
......
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