from typing import Optional
from pydantic import BaseModel, Field, ConfigDict
from module_admin.annotation.pydantic_annotation import as_query
from pydantic.alias_generators import to_camel



class TestUserName(BaseModel):
    model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
    
    user_name: Optional[str] = Field(default=None, description='用户名')
    
    
class TestPostForm(BaseModel):
    user_name: Optional[str] = None 
    password: Optional[str] = None 
    
@as_query
class TestUserNamePage(TestUserName):
    page_num: int = Field(default=1, description='当前页码')
    page_size: int = Field(default=10, description='每页记录数')