Commit ba4c850f authored by Davve's avatar Davve

完成远程搜索功能

parent 51e1a750
......@@ -9,43 +9,22 @@ from utils.base import APIView
class GroupSearchView(APIView):
def get(self, request):
name = request.GET.get('name')
print(name, '0------')
try:
pass
data = self.rpc['venus/community/group/search'](name=name).unwrap()
except Exception as e:
raise e
return {
'total': 100,
'data': [
{'name': '小组1', 'id': 1},
{'name': '小组2', 'id': 2},
{'name': '小组3', 'id': 3},
{'name': '小组4', 'id': 4},
{'name': '小组5', 'id': 5},
{'name': '小组6', 'id': 6},
]
}
return {'data': data}
class RegionSearchView(APIView):
def get(self, request):
name = request.GET.get('name')
print(request.GET)
try:
pass
data = self.rpc['venus/community/country/search'](name=name).unwrap()
except Exception as e:
raise e
return {
'total': 100,
'data': [
{'name': '北京', 'id': 1},
{'name': '上海', 'id': 2},
{'name': '深圳', 'id': 3},
{'name': '武汉', 'id': 4},
{'name': '成都', 'id': 5},
{'name': '宁波', 'id': 6},
]
}
return {'data': data}
class UserSearchView(APIView):
......
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