Commit ee322a13 authored by zhanglu's avatar zhanglu

添加画报id

parent 18126fb0
...@@ -10,6 +10,7 @@ from utils.logger import error_logger ...@@ -10,6 +10,7 @@ from utils.logger import error_logger
class TopicListView(APIView): class TopicListView(APIView):
def get(self, request): def get(self, request):
pictorial_id = request.GET.get('pictorial_id', '')
user_id = request.GET.get('user_id', '') user_id = request.GET.get('user_id', '')
page = int(request.GET.get('page', 1)) page = int(request.GET.get('page', 1))
limit = int(request.GET.get('limit', 10)) limit = int(request.GET.get('limit', 10))
...@@ -17,6 +18,8 @@ class TopicListView(APIView): ...@@ -17,6 +18,8 @@ class TopicListView(APIView):
sorts_by = list(map(lambda i: int(i), request.GET.getlist('sort_params[]', [3]))) sorts_by = list(map(lambda i: int(i), request.GET.getlist('sort_params[]', [3])))
if user_id: if user_id:
filters.update({'user_id': user_id}) filters.update({'user_id': user_id})
if pictorial_id:
filters.update({"pictorial_id": int(pictorial_id)})
res = self.rpc['physical/search/business/topic']( res = self.rpc['physical/search/business/topic'](
offset=(page-1) * limit, offset=(page-1) * limit,
...@@ -46,10 +49,14 @@ class TopicListView(APIView): ...@@ -46,10 +49,14 @@ class TopicListView(APIView):
class TopicImageListView(APIView): class TopicImageListView(APIView):
def get(self, request): def get(self, request):
pictorial_id = request.GET.get('pictorial_id', '')
page = int(request.GET.get('page', 1)) page = int(request.GET.get('page', 1))
limit = int(request.GET.get('limit', 50)) limit = int(request.GET.get('limit', 50))
filters = json.loads(request.GET.get('filter', "{}")) filters = json.loads(request.GET.get('filter', "{}"))
sorts_by = list(map(lambda i: int(i), request.GET.getlist('sort_params[]', [3]))) sorts_by = list(map(lambda i: int(i), request.GET.getlist('sort_params[]', [3])))
filters.update({"has_image": True})
if pictorial_id:
filters.update({"pictorial_id": int(pictorial_id)})
res = self.rpc['physical/search/business/topic']( res = self.rpc['physical/search/business/topic'](
offset=(page-1) * limit, offset=(page-1) * limit,
......
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