add paginate

This commit is contained in:
2025-03-05 20:50:21 +08:00
parent 75229ae8bf
commit ece9b4059e
3 changed files with 27 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ class UserListSchema(ModelSchema):
def from_orm(cls, obj):
raw_password = obj.raw_password if obj.role == RoleChoices.NORMAL else ""
return cls(
id=obj.id,
username=obj.username,
raw_password=raw_password,
role=obj.role,
@@ -20,6 +21,7 @@ class UserListSchema(ModelSchema):
class Meta:
model = User
fields = [
"id",
"username",
"raw_password",
"role",