refactor: 清理SQL审计全栈死代码 (删除孤立组件+handler+model+路由+mock+API定义, 共-1278行)
SQL审计菜单此前已从侧边栏移除,但死代码残留(违反step5清理清单): - 删除 frontend/components/audit/SQLAuditManager.tsx (629行, 无任何外部引用) - 删除 backend/handlers/sql_audit.go (435行) + backend/models/sql_audit.go (64行) - 移除 routes.go 中13条SQL审计路由 (API不再暴露, 返回404) - 移除 database.go AutoMigrate 中2个SQL审计表 - 移除 api.ts sqlAuditApi 对象 (37行) - 移除 mocks SQL审计mock数据 (90行) + barrel引用
This commit is contained in:
1 parent
a6e8b5ab4f
commit
a26f186e9b
8 files changed
+1
-1278
No files matched your search
@@ -527,43 +527,6 @@ export const auditApi = {
|
||||
},
|
||||
};
|
||||
|
||||
// ==================== SQL 审计 API ====================
|
||||
export const sqlAuditApi = {
|
||||
getRecords: async (params?: Record<string, string>) => {
|
||||
return http.get<ListResponse>('/sql-audit/records', params);
|
||||
},
|
||||
getRules: async () => {
|
||||
return http.get<ListResponse>('/sql-audit/rules');
|
||||
},
|
||||
analyzeSQL: async (data: { sql: string; database_name?: string; application?: string }) => {
|
||||
return http.post('/sql-audit/analyze', data);
|
||||
},
|
||||
approve: async (id: string | number) => {
|
||||
return http.post(`/sql-audit/records/${id}/approve`);
|
||||
},
|
||||
reject: async (id: string | number) => {
|
||||
return http.post(`/sql-audit/records/${id}/reject`);
|
||||
},
|
||||
execute: async (id: string | number) => {
|
||||
return http.post(`/sql-audit/records/${id}/execute`);
|
||||
},
|
||||
deleteRecord: async (id: string | number) => {
|
||||
return http.delete(`/sql-audit/records/${id}`);
|
||||
},
|
||||
createRule: async (data: any) => {
|
||||
return http.post('/sql-audit/rules', data);
|
||||
},
|
||||
updateRule: async (id: string | number, data: any) => {
|
||||
return http.put(`/sql-audit/rules/${id}`, data);
|
||||
},
|
||||
deleteRule: async (id: string | number) => {
|
||||
return http.delete(`/sql-audit/rules/${id}`);
|
||||
},
|
||||
toggleRule: async (ruleId: string | number) => {
|
||||
return http.post(`/sql-audit/rules/${ruleId}/toggle`);
|
||||
},
|
||||
};
|
||||
|
||||
// ==================== Ansible 自动化 API ====================
|
||||
export const ansibleApi = {
|
||||
// Playbook 管理
|
||||
|
||||
Reference in new issue
Block a user