This commit is contained in:
DingZQ
2025-03-28 20:16:23 +08:00
parent eb267803fe
commit dee3c9c6f8

View File

@@ -15,12 +15,12 @@ class User(object):
return { 'type': self.type, 'id': self.id }
def get_user_schema(name: str) -> dict[str, dict[str, Any]]:
def get_user_schema(name: str) -> dict[str, dict[Any, Any]]:
return { 'id' : {'type': 'str' , 'optional': False , 'readonly': True },
'name' : {'type': 'str' , 'optional': False , 'readonly': False},
'password' : {'type': 'str' , 'optional': False , 'readonly': False} }
def get_user(name: str, user_name: str) -> dict[str, Any]:
def get_user(name: str, user_name: str) -> dict[Any, Any]:
t = try_read(name, f"select * from users where username = '{user_name}'")
if t == None:
return {}
@@ -32,6 +32,6 @@ def get_user(name: str, user_name: str) -> dict[str, Any]:
return d
def get_all_users(name: str) -> list[dict[str, Any]]:
def get_all_users(name: str) -> list[dict[Any, Any]]:
return read_all(name, "select * from users")