Files
37duAutomation/desktop/controlplane/core/schemas.py
T
puddy 813bee743b feat: 新增账号状态管理、头像功能与报表工具,完善账号系统
新增账号状态字段与停用校验,支持账号头像上传管理,新增物料收发汇总表合并工具,优化银行卡检查脚本,新增ERP登录复用模块,重构账号数据库迁移与管理接口
2026-09-16 00:25:13 +08:00

101 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
status: bool | None = None # 是否启用(True=启用,False=停用)
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 = 清除强制更新配置