refactor: 重构项目目录结构与代码组织

1.  重构controlplane与webhost后端的包结构,按领域拆分模块到core/apis子包
2.  移动并整理工具脚本到tools子目录,统一管理运维脚本
3.  重构插件运行时、调度、作业管理等核心模块到core子包
4.  更新AGENTS.md文档,明确各代码形态的组织规范
5.  清理重复的旧文件与冗余代码
This commit is contained in:
2026-09-14 12:34:54 +08:00
parent baf8a260ff
commit cb04790d28
46 changed files with 3107 additions and 2647 deletions
+100
View File
@@ -0,0 +1,100 @@
# -*- coding: utf-8 -*-
"""中心机请求体模型(Pydantic),路由层统一复用。"""
from __future__ import annotations
from pydantic import BaseModel
class PluginOut(BaseModel):
id: str
name: str
version: str
class RuntimeReportIn(BaseModel):
account: str = ""
device_id: str = ""
plugin_id: str = ""
version: str = ""
status: str = ""
msg: str = ""
duration_sec: int = 0
class AuthIn(BaseModel):
account: str
password: str
class DingTalkIn(BaseModel):
account: str # 工号(作为统一账号)
nickname: str = ""
dingtalk_uid: str = ""
password: str = "" # 可选:覆盖默认初始密码(一般留空走 DINGTALK_DEFAULT_PASSWORD)
class SnsIn(BaseModel):
code: str # 内嵌二维码扫码后前端拿到的 loginTmpCode
class AuthExchangeIn(BaseModel):
code: str
class PwdIn(BaseModel):
account: str
old_password: str
new_password: str
class AccountCreateIn(BaseModel):
account: str
password: str
dept: str = ""
nickname: str = ""
is_admin: bool = False
class AccountUpdateIn(BaseModel):
account: str
dept: str | None = None
nickname: str | None = None
is_admin: bool | None = None
class AccountResetIn(BaseModel):
account: str
new_password: str
class AccountDelIn(BaseModel):
account: str
class GrantIn(BaseModel):
account: str
plugin_id: str
granted: bool
can_download: bool = True # 可选:插件级下载授权(默认授予)
can_run: bool = True # 可选:插件级运行授权(默认授予)
class PlatformGrantIn(BaseModel):
account: str
platform_id: str
granted: bool
class PluginDelIn(BaseModel):
plugin_id: str
class PluginPatchIn(BaseModel):
name: str = ""
description: str = ""
category: str = ""
icon: str = ""
status: str = "" # 空=不改;published / disabled / revoked
force_min_version: str = "" # 与 deadline 成对生效;二者齐全=开启,否则看 clear_force
force_deadline: str = "" # ISO 时间串
clear_force: bool = False # True = 清除强制更新配置