| 12345678910111213141516171819202122232425262728293031323334353637 | from .user import userfrom .user import user_factoryfrom .user import user_builderfrom .users_collection import users_collectionfrom .app_route import app_routeclass users_app(app_route):    def __init__(self, collection: users_collection) -> None:        self.__collection = collection    def login(        self,         nick: str,        password: str    ) -> dict:        target = self.collection.login(nick, password)        if target is None:            return self._fail("Bad nick or password.")        return self._success(apikey = target.apikey)    def get(self, apikey: str) -> dict:        target = self.collection.get(apikey)        if target is None:            return self._fail("User with that ApiKey not exists.")        return self._success(            apikey = target.apikey,            nick = target.nick        )    @property    def collection(self) -> users_collection:        return self.__collection
 |