feat(m10): add audit retention policy configuration

This commit is contained in:
2026-05-25 15:05:54 +08:00
parent 250c5cbfeb
commit 147142f44f
4 changed files with 70 additions and 0 deletions
@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.nio.charset.StandardCharsets;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/api/v1/audit-events")
@@ -77,6 +78,14 @@ public class AuditController {
.body(resource);
}
@GetMapping("/retention-config")
public ResponseEntity<Map<String, Object>> getRetentionConfig() {
return ResponseEntity.ok(Map.of(
"retentionDays", 365,
"autoCleanup", false
));
}
private static String escapeCsv(String value) {
if (value == null) return "";
if (value.contains(",") || value.contains("\"") || value.contains("\n")) {