Commit 10cccb42 authored by Davve's avatar Davve

增加列表页面get

parent 142da4a7
......@@ -8,22 +8,21 @@ from utils.base import APIView
class GroupListView(APIView):
def get(self, request):
print('-----------')
# page = request.GET.get('page', 1)
# limit = request.GET.get('limit', 10)
# filter = self.handle_filter(request.GET.get('filter', ""))
# try:
# data = self.rpc['venus/community/group/get'](offset=page, limit=limit, filters=filter).unwrap()
# except Exception as e:
data = {
'total': 200,
'data': [
{'id': 1, 'description': '测试1', 'name': '测试2', "star_name":"鹿晗", "user_nums":23,"topic_num": 12,'push_time': '2018-08-09','create_time':'2019-08-07', 'creator_id':22, 'creator': 'hi', 'is_online':1, 'is_recommend':1},
{'id': 2, 'description': '测试1', 'name': '测试2', "star_name":"鹿晗","user_nums":23,"topic_num": 12,'push_time': '2018-08-09', 'create_time': '2019-08-07',
'creator_id': 22, 'creator_id':22, 'creator': 'hi', 'is_online':1, 'is_recommend':1},
{'id': 3, 'description': '测试1', 'name': '测试2', "star_name":"鹿晗","user_nums":23,"topic_num": 12,'push_time': '2018-08-09', 'create_time': '2019-08-07',
'creator_id': 22, 'creator_id':22, 'creator': 'hi', 'is_online':1, 'is_recommend':1},
]
}
page = request.GET.get('page', 1)
limit = request.GET.get('limit', 10)
filter = self.handle_filter(request.GET.get('filter', ""))
try:
data = self.rpc['venus/community/pick/get'](offset=page, limit=limit, filters=filter).unwrap()
except Exception as e:
# raise e
data = {
'total': 200,
'data': [
{'id': 1, 'description': '测试1', 'name': '测试2', "star_name":"鹿晗", "user_nums":23,"topic_num": 12,'push_time': '2018-08-09','create_time':'2019-08-07', 'creator_id':22, 'creator': 'hi', 'is_online':1, 'is_recommend':1},
{'id': 2, 'description': '测试1', 'name': '测试2', "star_name":"鹿晗","user_nums":23,"topic_num": 12,'push_time': '2018-08-09', 'create_time': '2019-08-07',
'creator_id': 22, 'creator_id':22, 'creator': 'hi', 'is_online':1, 'is_recommend':1},
{'id': 3, 'description': '测试1', 'name': '测试2', "star_name":"鹿晗","user_nums":23,"topic_num": 12,'push_time': '2018-08-09', 'create_time': '2019-08-07',
'creator_id': 22, 'creator_id':22, 'creator': 'hi', 'is_online':1, 'is_recommend':1},
]
}
return data
\ No newline at end of file
......@@ -8,8 +8,14 @@ from utils.base import APIView
class TopicListView(APIView):
def get(self, request):
return {
page = request.GET.get('page', 1)
limit = request.GET.get('limit', 10)
filter = self.handle_filter(request.GET.get('filter', ""))
try:
data = self.rpc['venus/community/pick/get'](offset=page, limit=limit, filters=filter).unwrap()
except Exception as e:
# raise e
data = {
'total': 200,
'data':[
{"id": "1", "content": '内容', 'user_name': 'alex','newly_reply': '最新回复', 'group_name': '小组名', 'update_time': '2019-09-18 23:59:59',
......@@ -22,6 +28,7 @@ class TopicListView(APIView):
'reported_time': '2019-09-18 23:59:59', 'is_online': 1, 'is_reported': 1},
{"id": "5", "content": '内容', 'user_name': 'alex','newly_reply': '最新回复', 'group_name': '小组名', 'update_time': '2019-09-18 23:59:59',
'reported_time': '2019-09-18 23:59:59', 'is_online': 0, 'is_reported': 0},
]
}
]
}
return 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