feat(cli): 添加命令行敏感操作门禁和数据库管理功能
- 添加 migrate、seed、reset-all 命令行子命令 - 实现管理员密码门禁机制保护敏感操作 - 添加数据库表结构迁移和种子数据初始化功能 - 实现清空并重建全部表的 reset-all 功能 - 重构种子数据只包含系统必需基础数据,移除演示数据 - 添加 RBAC 权限角色初始化的命令行支持 - 配置命令行密码验证和操作日志记录功能
This commit is contained in:
@@ -36,12 +36,12 @@ type MesConfig struct {
|
||||
// AgvConfig 海康 AGV(RCS-2000) 调度系统对接
|
||||
// 未配置 appKey/appSecret/RCS 地址 或 EnableMock=true 时,使用 mock 客户端(模拟下发成功/到位),便于离线联调。
|
||||
type AgvConfig struct {
|
||||
EnableMock bool `json:",default=true"` // 是否模拟(未接真实 RCS 前保持 true)
|
||||
EnableMock bool `json:",default=true"` // 是否模拟(未接真实 RCS 前保持 true)
|
||||
BaseURL string `json:",default=http://127.0.0.1:1010/rcs/rtas"` // RCS 服务前缀,如 http://10.10.10.10:1010/rcs/rtas
|
||||
AppKey string `json:",default=unset"` // RCS 颁发给业务系统的应用标识
|
||||
AppSecret string `json:",default=unset"` // RCS 应用私钥
|
||||
CarrierCode string `json:",default=DEFAULT"` // 默认载具/托盘编号(选填)
|
||||
PollInterval int `json:",default=10"` // 任务状态轮询间隔(秒)
|
||||
AppKey string `json:",default=unset"` // RCS 颁发给业务系统的应用标识
|
||||
AppSecret string `json:",default=unset"` // RCS 应用私钥
|
||||
CarrierCode string `json:",default=DEFAULT"` // 默认载具/托盘编号(选填)
|
||||
PollInterval int `json:",default=10"` // 任务状态轮询间隔(秒)
|
||||
}
|
||||
|
||||
// WebConfig 前端静态资源托管配置(原库房客户端 8891 已合并进主服务)
|
||||
@@ -49,6 +49,12 @@ type WebConfig struct {
|
||||
OpenBrowser bool `json:",default=true"` // 本机开发时启动后自动打开浏览器;服务器部署设为 false
|
||||
}
|
||||
|
||||
// CliConfig 命令行敏感操作门禁密码(migrate/reset-all/seed 需输入,独立于后台登录账号密码)。
|
||||
// 与 MES 对齐:DDL/删库等高危操作一律显式触发 + 密码校验,绝不随服务启动自动执行。
|
||||
type CliConfig struct {
|
||||
AdminPassword string `json:",default=Hardman_2026"`
|
||||
}
|
||||
|
||||
// AttachmentConfig 附件存储 / 归档 / 磁盘监控配置(etc/*.yaml 的 Attachment 段)。
|
||||
// 落盘约定:<RootDir>/年/月/日/<文件类型大写>/<uuid>.<ext>,库内只存相对路径。
|
||||
type AttachmentConfig struct {
|
||||
@@ -73,6 +79,7 @@ type Config struct {
|
||||
Agv AgvConfig
|
||||
Web WebConfig
|
||||
Attachment AttachmentConfig
|
||||
Cli CliConfig
|
||||
}
|
||||
|
||||
// RedisConf Redis 连接配置
|
||||
|
||||
Reference in New Issue
Block a user