mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-10-10 19:37:55 +00:00
refactor: 重构文件导入组件为通用组件 fix: 修复导出文件名统一问题 docs: 更新README添加二次开发教程 style: 统一系统管理页面的日期选择器实现 chore: 更新数据库迁移脚本和初始化数据 perf: 优化前端页面日期范围选择交互 test: 添加演示模块相关测试文件 build: 更新依赖项配置 ci: 调整CI/CD脚本配置
24 lines
705 B
Python
24 lines
705 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
from typing import Optional
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
from app.core.base_schema import BaseSchema
|
|
|
|
|
|
class ExampleCreateSchema(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 ExampleUpdateSchema(ExampleCreateSchema):
|
|
"""更新模型"""
|
|
id: int = Field(..., gt=0, description="示例ID")
|
|
|
|
|
|
class ExampleOutSchema(ExampleCreateSchema, BaseSchema):
|
|
"""响应模型"""
|
|
model_config = ConfigDict(from_attributes=True)
|