mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-22 05:02:57 +00:00
refactor(backend): 重构CRUD基类查询方法去除重复结果 feat(application): 新增应用系统模块基础结构 fix(backend): 修复多处日志记录ID变量名错误 style(backend): 清理无用代码和注释 fix(frontend): 修复用户导入功能参数错误 docs(backend): 更新环境配置示例注释 perf(backend): 优化导出功能数据处理逻辑 test(frontend): 添加任务日志功能开发中提示 chore: 更新角色菜单权限数据
24 lines
643 B
Python
24 lines
643 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
from typing import Optional
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
from app.core.base_schema import BaseSchema
|
|
|
|
|
|
class DemoCreateSchema(BaseModel):
|
|
"""新增模型"""
|
|
name: str = Field(..., max_length=50, description='名称')
|
|
status: bool = Field(True, description="是否启用(True:启用 False:禁用)")
|
|
description: Optional[str] = Field(None, max_length=255, description="描述")
|
|
|
|
|
|
class DemoUpdateSchema(DemoCreateSchema):
|
|
"""更新模型"""
|
|
...
|
|
|
|
|
|
class DemoOutSchema(DemoCreateSchema, BaseSchema):
|
|
"""响应模型"""
|
|
model_config = ConfigDict(from_attributes=True)
|