from typing import Optional

from pydantic import BaseModel


class UserCreate(BaseModel):
    username: str
    password: str
    email: Optional[str] = ""


# 定义请求体模型
class LoginData(BaseModel):
    username: str
    password: str


class User(BaseModel):
    username: str


class Token(BaseModel):
    access_token: str
    token_type: str
    bisheng_token: str
    ragflow_token: str

class PageParameter(BaseModel):
    page_index: int
    page_size: int
    keyword: Optional[str] = ""

class UserStatus(BaseModel):
    userId: int
    status: Optional[str] = ""
    pwd: Optional[str] = ""

class UserInfo(BaseModel):
    userId: Optional[int] = 0
    userName: Optional[str] = ""
    loginName: Optional[str] = ""
    phone: Optional[str] = ""
    pwd: Optional[str] = ""
    email: str
    roles: list
    groups: Optional[list] = []



class UserPassword(BaseModel):
    # userId: int
    newPassword: str
    oldPassword: str


class UserDept(BaseModel):
    userId: int
    depts: list


