- P0: 实例访问控制全线接入权限组 (829测试) - P1: permissions字段激活 + 操作级权限检查 (843测试) - 前端: 删除数据权限页面, 权限组合并为唯一入口 - 新增: CodeMirror编辑器 + 查询模板 + 慢查询分析 - 新增: MongoDB管理页面 + Dashboard增强 - 修复: Pydantic V2迁移 + 前端TS错误修复
30 lines
941 B
Python
30 lines
941 B
Python
from datetime import datetime
|
|
from typing import Optional, Dict, Any
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class NotificationChannelCreate(BaseModel):
|
|
name: str = Field(..., min_length=1, max_length=100)
|
|
channel_type: str = Field(..., pattern=r"^(dingtalk|webhook_feishu|email)$")
|
|
config: Dict[str, Any]
|
|
is_enabled: bool = True
|
|
|
|
|
|
class NotificationChannelUpdate(BaseModel):
|
|
name: Optional[str] = Field(default=None, min_length=1, max_length=100)
|
|
channel_type: Optional[str] = Field(default=None, pattern=r"^(dingtalk|webhook_feishu|email)$")
|
|
config: Optional[Dict[str, Any]] = None
|
|
is_enabled: Optional[bool] = None
|
|
|
|
|
|
class NotificationChannelResponse(BaseModel):
|
|
id: int
|
|
name: str
|
|
channel_type: str
|
|
config: Dict[str, Any] # passwords masked in endpoint
|
|
is_enabled: bool
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|