2019-11-11 09:56:08 +01:00
|
|
|
from starlette.requests import Request
|
|
|
|
from starlette.responses import *
|
2019-11-28 02:30:40 +01:00
|
|
|
from royalnet.constellation import *
|
2019-11-11 09:56:08 +01:00
|
|
|
from royalnet.utils import *
|
2019-11-28 02:30:40 +01:00
|
|
|
from royalnet.backpack.tables import *
|
2020-02-09 19:12:34 +01:00
|
|
|
from royalnet.constellation.api import *
|
2019-11-11 09:56:08 +01:00
|
|
|
|
|
|
|
|
2020-02-09 19:12:34 +01:00
|
|
|
class ApiUserListStar(ApiStar):
|
|
|
|
path = "/api/user/list/v1"
|
2019-11-11 09:56:08 +01:00
|
|
|
|
2020-02-09 19:12:34 +01:00
|
|
|
async def api(self, data: ApiData) -> dict:
|
|
|
|
users: typing.List[User] = await asyncify(data.session.query(self.alchemy.get(User)).all)
|
|
|
|
return [user.json() for user in users]
|