Commit 9b34b377 authored by zhanglu's avatar zhanglu

Merge branch 'feature/op_topic' into 'test'

添加画报id

See merge request alpha/sun!122
parents 629e8d26 ee322a13
......@@ -10,6 +10,7 @@ from utils.logger import error_logger
class TopicListView(APIView):
def get(self, request):
pictorial_id = request.GET.get('pictorial_id', '')
user_id = request.GET.get('user_id', '')
page = int(request.GET.get('page', 1))
limit = int(request.GET.get('limit', 10))
......@@ -17,6 +18,8 @@ class TopicListView(APIView):
sorts_by = list(map(lambda i: int(i), request.GET.getlist('sort_params[]', [3])))
if 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'](
offset=(page-1) * limit,
......@@ -46,10 +49,14 @@ class TopicListView(APIView):
class TopicImageListView(APIView):
def get(self, request):
pictorial_id = request.GET.get('pictorial_id', '')
page = int(request.GET.get('page', 1))
limit = int(request.GET.get('limit', 50))
filters = json.loads(request.GET.get('filter', "{}"))
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'](
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