1. 科目管理:代码长度放宽至50(含数据库升级v4.2)、编辑可清空代码、重命名查重、新增 ↑↓ 快捷排序(批量重排接口)、空代码不再显示占位 2. 修复单人加减分提交空名单:showSinglePointsModal 三处重复定义收口到 points-mgmt 并共享选中状态 3. SMTP:SMTP_FROM 默认取 SMTP_USER、SMTP_ENABLED 兼容 1/yes/on、启动日志打印邮件状态、新增邮件测试接口与按钮(返回真实 SMTP 错误) 4. 密码:加密改为 bcrypt 库直连(修复 passlib 兼容问题)、重置密码不再依赖影响行数、前端统一展示422校验错误 5. 冗余清理:删除未用导入/Schema/函数、死文件 admin.js 与 sanitize.py、重复 escapeHtml、重复CSS、重复脚本加载 6. 修复11个文件被写入的 UTF-8 BOM 7. 文档与版本同步至4.2
48 lines
1.6 KiB
Python
48 lines
1.6 KiB
Python
# ===========================================
|
|
# 班级操行分管理系统 - 后端服务
|
|
#
|
|
# 开发者: Canglan
|
|
# 联系方式: admin@sea-studio.top
|
|
# 版权归属: Sea Network Technology Studio
|
|
# 许可证: MIT License
|
|
#
|
|
# 版权所有 © Sea Network Technology Studio
|
|
# ===========================================
|
|
|
|
from pydantic import BaseModel, Field
|
|
from typing import Optional, List
|
|
|
|
|
|
class SubjectInfo(BaseModel):
|
|
"""科目信息"""
|
|
subject_id: int
|
|
subject_name: str
|
|
subject_code: Optional[str] = None
|
|
is_active: bool
|
|
sort_order: int
|
|
|
|
|
|
class CreateSubjectRequest(BaseModel):
|
|
"""创建科目请求"""
|
|
subject_name: str = Field(..., min_length=1, max_length=50, description="科目名称")
|
|
subject_code: Optional[str] = Field(None, max_length=50, description="科目代码")
|
|
sort_order: int = Field(0, description="排序序号")
|
|
|
|
|
|
class UpdateSubjectRequest(BaseModel):
|
|
"""更新科目请求"""
|
|
subject_name: Optional[str] = Field(None, min_length=1, max_length=50, description="科目名称")
|
|
subject_code: Optional[str] = Field(None, max_length=50, description="科目代码(传空字符串表示清空)")
|
|
is_active: Optional[bool] = Field(None, description="是否启用")
|
|
sort_order: Optional[int] = Field(None, description="排序序号")
|
|
|
|
|
|
class SubjectListResponse(BaseModel):
|
|
"""科目列表响应"""
|
|
subjects: List[SubjectInfo]
|
|
total: int
|
|
|
|
|
|
class ReorderSubjectsRequest(BaseModel):
|
|
"""科目排序请求"""
|
|
subject_ids: List[int] = Field(..., min_length=1, max_length=100, description="按新顺序排列的科目ID列表") |