Files
37duAutomation/desktop/controlplane/core/schemas.py
T
puddy 1e533dd1b3 refactor: 完成项目目录重构与代码迁移
本次提交完成了整体项目的目录梳理与代码迁移:
1.  将根级controlplane、webhost等目录的代码迁移至desktop/对应子目录,统一桌面端架构
2.  移动并整理了插件目录结构,将插件统一放入根级plugins/
3.  调整了前端项目的路径与配置,统一前后端开发构建流程
4.  清理了废弃的旧版app/目录与冗余的构建中间文件
5.  更新了.gitignore与README.md,适配新的项目结构
2026-09-14 17:46:09 +08:00

100 lines
2.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- 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 = 清除强制更新配置