feat: 操作审计支持按筛选条件导出 CSV

- 后端新增导出端点 GET /apis/audit.guichumo.com/v1alpha1/auditlogs/-/export:
  筛选参数与 query 完全一致(条件构造抽取为 AuditLogFilters 共用),
  按时间升序分批(每批 200)遍历全量、流式输出 UTF-8 BOM CSV(Excel/WPS 直开),
  字段引号转义 + 公式注入防护;列含 describeOperation 移植版中文操作描述(OperationDescription)
- role-template 追加 auditlogs/export(动词仍 get/list,保持只读语义)
- Console 列表页工具栏新增「导出」按钮:按当前筛选条件 fetch → blob → a[download] 下载
- 测试:后端新增导出端点/分批取数/CSV 转义/操作描述用例(71 个全绿),
  前端新增导出链路结构性回归 spec(31 个全绿)+ vue-tsc 通过
- 文档:设计文档 V2 规划项标注已实现,README 补导出说明
This commit is contained in:
2026-11-21 21:28:03 +08:00
parent 3abd79a65f
commit 058596c0ea
13 changed files with 880 additions and 88 deletions
@@ -30,7 +30,7 @@ class AuditQueryEndpointTest {
@BeforeEach
void setUp() {
client = mock(ReactiveExtensionClient.class);
var endpoint = new AuditQueryEndpoint(client);
var endpoint = new AuditQueryEndpoint(client, mock(AuditLogCsvExporter.class));
// 复现生产环境挂载方式(CustomEndpointsBuilder 在 /apis/{groupVersion} 下 nest)
var mounted = org.springframework.web.reactive.function.server.RouterFunctions.nest(
org.springframework.web.reactive.function.server.RequestPredicates.path(