refactor: 全局代码模块化重构 — 所有文件<700行
后端 handler 拆分: - automation.go(1067→4文件), server.go(1011→5文件), ldap.go(815→3文件), user.go(704→2文件) 前端组件拆分: - SystemManager(1782→569), AlertManager(1133→220), K8sClusters(1062→4文件) - Dashboard(941→4文件), ServerManager(905→640), ApprovalFlow(830→548) - AlertCenter(775→693), AIPredictiveAnalytics(760→670) - CloudBilling(728→663), GrafanaDashboard(717→643), sidebar(726→689) Mock 数据模块化: - mocks/data.ts(2552行→barrel+11个domain模块) 新增 CLAUDE.md 项目全局开发规范 修复: AlertCenter/LogManager ListResponse.data→.list 类型不匹配 验证: go build ✅ + tsc --noEmit ✅ + npm run build ✅
This commit is contained in:
1 parent
e8dbe65955
commit
73b5a48df9
37 files changed
+5148
-5237
No files matched your search
@@ -335,7 +335,17 @@ func (h *UserHandler) BatchImportUsers(c *gin.Context) {
|
||||
})
|
||||
}
|
||||
|
||||
// ImportTemplate 下载用户导入模板
|
||||
// ImportTemplate 下载导入模板
|
||||
// (已有实现,在文件末尾追加 ListRoles)
|
||||
|
||||
// ListRoles 获取角色列表(供前端下拉选择) // Logan.Li
|
||||
func (h *UserHandler) ListRoles(c *gin.Context) {
|
||||
var roles []models.Role
|
||||
h.db.Where("status = ?", 1).Order("id ASC").Find(&roles)
|
||||
c.JSON(http.StatusOK, models.Response{
|
||||
Code: 200, Data: models.ListResponse{List: roles, Total: int64(len(roles))},
|
||||
})
|
||||
}
|
||||
// GET /api/v1/admin/users/import-template
|
||||
func (h *UserHandler) ImportTemplate(c *gin.Context) {
|
||||
// UTF-8 BOM for Excel compatibility
|
||||
|
||||
Reference in new issue
Block a user