search.py 750 Bytes
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# __author__ = "chenwei"
# Date: 2018/11/17

from utils.base import APIView


class GroupSearchView(APIView):
    def get(self, request):
        name = request.GET.get('name')
        try:
            data = self.rpc['venus/community/group/search'](name=name).unwrap()
        except Exception as e:
            raise e

        return {'data': data}


class RegionSearchView(APIView):
    def get(self, request):
        name = request.GET.get('name')
        try:
            data = self.rpc['venus/community/country/search'](name=name).unwrap()
        except Exception as e:
            raise e
        return {'data': data}


class UserSearchView(APIView):
    def get(self, request):
        pass