feat(phase4): 全部业务模块迁移到 modules/(结构迁移)
- 21 个模块目录(auth/system/dictionary/configuration/cms/member/region/link/notice/job/log/upload/index) - 每个模块 router.py(合并模块导出多个 router)/schemas.py/service.py/repository.py/models.py - routers/v1.py 与 routers/__init__.py 改为直接引用 modules,前缀与权限串原样保留 - core/middleware.py 懒加载指向 modules.system.menu / modules.log;core/redis_client.py 指向 modules.job.scheduler - apps/views|services|forms 全部改为 re-export 垫片 - 迁移后 grep 守门通过:modules/core 无 apps/extensions 残留引用 - 实测登录、27+ 模块接口、写操作 commit、操作日志落库均正常 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+2
-32
@@ -1,32 +1,2 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
|
||||
|
||||
# 定时任务表单验证
|
||||
class JobForm(BaseModel):
|
||||
id: Optional[int] = Field(None, description="任务ID")
|
||||
job_name: str = Field(..., min_length=1, max_length=255, description="任务名称")
|
||||
job_alias: Optional[str] = Field(None, max_length=255, description="任务别名")
|
||||
job_group: Optional[str] = Field(None, max_length=255, description="任务分组")
|
||||
job_trigger: Optional[str] = Field(None, max_length=255, description="任务触发器")
|
||||
status: int = Field(..., ge=0, le=3, description="任务状态")
|
||||
cron_expression: Optional[str] = Field(None, max_length=255, description="Cron表达式")
|
||||
execute_policy: int = Field(..., ge=1, le=3, description="执行策略")
|
||||
is_sync: int = Field(..., ge=0, le=1, description="是否同步任务")
|
||||
url: Optional[str] = Field(None, max_length=255, description="任务URL")
|
||||
params: Optional[str] = Field(None, max_length=2000, description="任务参数")
|
||||
note: Optional[str] = Field(None, max_length=255, description="任务备注")
|
||||
|
||||
@field_validator('cron_expression')
|
||||
@classmethod
|
||||
def validate_cron(cls, v):
|
||||
if v:
|
||||
v = v.strip()
|
||||
return v
|
||||
|
||||
|
||||
# 任务状态表单
|
||||
class JobStatusForm(BaseModel):
|
||||
id: int = Field(..., gt=0, description="任务ID")
|
||||
status: int = Field(..., ge=0, le=3, description="任务状态")
|
||||
# 兼容垫片:由 modules.job.schemas 迁移
|
||||
from modules.job.schemas import * # noqa: F401,F403
|
||||
|
||||
Reference in New Issue
Block a user