33 lines
1.7 KiB
Go
33 lines
1.7 KiB
Go
// Package system contains the built-in system module contribution to the
|
|
// application catalog.
|
|
package system
|
|
|
|
import (
|
|
datasystem "kra/internal/data/repository"
|
|
"kra/pkg/module"
|
|
)
|
|
|
|
// Definition describes the built-in system contribution to the application
|
|
// catalog. Other business modules can expose the same shape independently.
|
|
func Definition() module.Definition {
|
|
communication := module.Surface{
|
|
Menus: []module.Menu{{Name: "integrationConfig", Path: "integrationConfig", ParentName: "extensions", Component: "view/systemTools/integration/config.vue", Title: "通信集成", Icon: "connection", Sort: 8}},
|
|
APIs: []module.API{
|
|
{Path: "/integration/configs/:kind", Method: "GET", Group: "集成配置", Description: "按类型获取集成配置"},
|
|
{Path: "/integration/configs/:kind/:provider", Method: "GET", Group: "集成配置", Description: "获取指定集成配置"},
|
|
{Path: "/integration/configs/:kind/:provider", Method: "PUT", Group: "集成配置", Description: "保存集成配置"},
|
|
{Path: "/integration/configs/:kind/:provider/test", Method: "POST", Group: "集成配置", Description: "测试通信集成连接"},
|
|
{Path: "/integration/configs/:kind/:provider", Method: "DELETE", Group: "集成配置", Description: "删除集成配置"},
|
|
},
|
|
}
|
|
return module.Definition{
|
|
Name: "system",
|
|
Migrations: datasystem.Migrations(),
|
|
Surface: communication,
|
|
TimedTasks: []module.TimedTask{
|
|
{Name: "ClearDB", Description: "定时清理数据库过期日志(操作记录/JWT黑名单/定时任务执行日志)", Spec: "@daily", MethodName: "ClearDB", Enabled: true},
|
|
{Name: "CleanStaleUploads", Description: "定时清理过期大文件上传会话", Spec: "@hourly", MethodName: "CleanStaleUploads", Enabled: true},
|
|
},
|
|
}
|
|
}
|