diff --git a/api/pictorial.py b/api/pictorial.py index 4591516c511da91e70a0609a1a713817bfec20bd..a18b7d04579741a5f0fd9cc52d58b2e6d30b9b31 100644 --- a/api/pictorial.py +++ b/api/pictorial.py @@ -48,7 +48,6 @@ class PictorialUpdateOrCreate(APIView): id = int(request.POST.get('id')) if request.POST.get('id') else None star_ids = json.loads(request.POST.get('star', '[]')) - pictorial_user_ids = json.loads(request.POST.get('pictorial_user_ids', '[]')) collection_tag_ids = json.loads(request.POST.get('collection_tag_ids', '[]')) pictorial_activity_id = request.POST.get('pictorial_activity_id') tab_config = request.POST.get("tab_config", "[]") @@ -59,7 +58,6 @@ class PictorialUpdateOrCreate(APIView): 'celebrity_ids': star_ids, 'is_online': int(request.POST.get('is_online', 1)), 'is_recommend': int(request.POST.get('is_recommend', 0)), - 'pictorial_user_ids': pictorial_user_ids, 'icon': request.POST.get('icon', ''), 'collection_tag_ids': collection_tag_ids, 'is_home_recommend': int(request.POST.get('is_home_recommend', 0)), @@ -199,3 +197,37 @@ class PictorialTopicDel(APIView): return { 'message': 'åˆ é™¤æˆåŠŸ' } + + +class PictorialFollowsDel(APIView): + """åˆ é™¤æ¦œå•ä¸çš„关注者""" + + def post(self, request): + pictorial_id = int(request.POST.get('pictorial_id', 0)) + user_ids = json.loads(request.POST.get('user_ids', '[]')) + user_ids = [int(item) for item in user_ids] + try: + self.rpc['venus/sun/pictorial/follows/del'](pictorial_id=pictorial_id, user_ids=user_ids).unwrap() + except Exception as e: + error_logger.error(u'æ“作失败%s' % (e)) + raise + return { + 'message': 'åˆ é™¤æˆåŠŸ' + } + + +class PictorialFollowsAdd(APIView): + """新增榜å•ä¸çš„关注者""" + + def post(self, request): + pictorial_id = int(request.POST.get('pictorial_id', 0)) + user_ids = json.loads(request.POST.get('user_ids', '[]')) + user_ids = [int(item) for item in user_ids] + try: + self.rpc['venus/sun/pictorial/follows/add'](pictorial_id=pictorial_id, user_ids=user_ids).unwrap() + except Exception as e: + error_logger.error(u'æ“作失败%s' % (e)) + raise + return { + 'message': 'æ·»åŠ æˆåŠŸ' + } diff --git a/api/urls.py b/api/urls.py index 56583192ca601b379093b8ce9bf725936bc1f9f9..0579ee70b23b49e74302064d0c434d3a45ee3b34 100644 --- a/api/urls.py +++ b/api/urls.py @@ -161,6 +161,8 @@ urlpatterns = [ url(r'^pictorial/feed/rank$', PictorialFeedlRank.as_view()), url(r'^pictorial/feed/delete$', PictorialFeedDelete.as_view()), url(r'^pictorial/topic/list$', PictorialTopicList.as_view()), + url(r'^pictorial/follows/del$', PictorialFollowsDel.as_view()), + url(r'^pictorial/follows/add$', PictorialFollowsAdd.as_view()), #è¿è¥ä½ url(r'^topic/home_recommend/list', TopicHomeRecommendList.as_view()), diff --git a/api/user.py b/api/user.py index 2fc2e0def085c567628eef32873d1c929d2d3095..1e7921673877216c4974e20b3f6da6c99140de9a 100644 --- a/api/user.py +++ b/api/user.py @@ -89,6 +89,7 @@ class UserUpdateOrCreate(APIView): 'body_esthetics_tag_ids': body_esthetics_tag_ids, 'expert_tag_ids': expert_tag_ids, 'is_kol': int(request.POST.get('is_kol', 0)), + 'is_edit': int(request.POST.get('is_edit', 0)), } try: