mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-26 14:23:48 +00:00
- 删除原有的示例模块(module_example)和AI模块(module_ai) - 在应用模块(module_application)下新增AI子模块和示例子模块 - 更新相关路由配置,移除不再使用的模块路由 - 调整定时任务模块从监控模块迁移至应用模块 - 更新前端API路径和组件文件结构 - 修正数据库表名前缀,统一使用'app_'作为应用模块表前缀
24 lines
651 B
Python
24 lines
651 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(default=None, max_length=255, description="描述")
|
|
|
|
|
|
class DemoUpdateSchema(DemoCreateSchema):
|
|
"""更新模型"""
|
|
...
|
|
|
|
|
|
class DemoOutSchema(DemoCreateSchema, BaseSchema):
|
|
"""响应模型"""
|
|
model_config = ConfigDict(from_attributes=True)
|