Commit 5bb1c95a authored by 张英杰's avatar 张英杰

sun 测肤变更数据接口

parent a958fa6f
...@@ -17,7 +17,7 @@ from alpha_types.venus.enum import ( ...@@ -17,7 +17,7 @@ from alpha_types.venus.enum import (
) )
from utils.base import APIView, get_offset_count from utils.base import APIView, get_offset_count
from utils.logger import error_logger from utils.logger import error_logger, info_logger
class SkinCheckPictorial(APIView): class SkinCheckPictorial(APIView):
...@@ -37,8 +37,28 @@ class SkinCheckPictorial(APIView): ...@@ -37,8 +37,28 @@ class SkinCheckPictorial(APIView):
return data return data
def post(self, request): def post(self, request):
"""
榜单信息创建 or 更新
:param request:
:return:
"""
_data = json.loads(request.POST.get("pictorial_info") or "[]")
# 对变更数据做一层封装
modify_data = [] modify_data = []
for info in _data:
_skin_classify = info.get("skin_classify", "")
if _skin_classify in SKIN_ALL_CLASSIFY:
_data = {
"skin_classify": _skin_classify,
"url": info.get("url", ""),
"content": info.get("content", ""),
}
modify_data.append(_data)
info_logger.info("skin_check pictorial modify data: {}".format(json.dumps(modify_data)))
if modify_data:
try: try:
self.rpc['venus/sun/skin_check/pictorial_update_or_create']( self.rpc['venus/sun/skin_check/pictorial_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