2019-11-11 08:56:08 +00:00
|
|
|
from starlette.requests import Request
|
|
|
|
from starlette.responses import *
|
2019-11-28 01:30:40 +00:00
|
|
|
from royalnet.constellation import *
|
2019-11-11 08:56:08 +00:00
|
|
|
from royalnet.utils import *
|
2019-11-28 01:30:40 +00:00
|
|
|
from royalnet.backpack.tables import *
|
2020-02-09 18:12:34 +00:00
|
|
|
from royalnet.constellation.api import *
|
2019-11-11 08:56:08 +00:00
|
|
|
|
|
|
|
|
2020-02-09 18:12:34 +00:00
|
|
|
class ApiUserListStar(ApiStar):
|
|
|
|
path = "/api/user/list/v1"
|
2019-11-11 08:56:08 +00:00
|
|
|
|
2020-02-09 18:12:34 +00: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]
|