feat(broadcast): add multi-role insight contract

This commit is contained in:
2026-07-25 14:19:03 +08:00
parent 7c9b837dd3
commit c35fd0741b
5 changed files with 114 additions and 1 deletions
@@ -61,8 +61,52 @@ public final class AihrBroadcastDto {
String status,
String summary,
String errorMessage,
String downloadUrl
String downloadUrl,
String insightStatus,
String defaultPerspectiveCode,
List<String> perspectiveLabels,
List<BroadcastPerspective> perspectives
) {
public BroadcastAttachmentResponse {
perspectiveLabels = perspectiveLabels == null ? List.of() : List.copyOf(perspectiveLabels);
perspectives = perspectives == null ? List.of() : List.copyOf(perspectives);
}
public BroadcastAttachmentResponse(
Long id,
String fileName,
long fileSize,
String contentType,
String status,
String summary,
String errorMessage,
String downloadUrl
) {
this(id, fileName, fileSize, contentType, status, summary, errorMessage, downloadUrl,
"NOT_PROCESSED", null, List.of(), List.of());
}
}
public record BroadcastEvidence(int paragraphIndex, String quote) {
}
public record BroadcastPerspective(
String code,
String label,
String summary,
List<String> concerns,
List<String> impacts,
List<String> actions,
List<String> risks,
List<BroadcastEvidence> evidence
) {
public BroadcastPerspective {
concerns = concerns == null ? List.of() : List.copyOf(concerns);
impacts = impacts == null ? List.of() : List.copyOf(impacts);
actions = actions == null ? List.of() : List.copyOf(actions);
risks = risks == null ? List.of() : List.copyOf(risks);
evidence = evidence == null ? List.of() : List.copyOf(evidence);
}
}
public record AdminBroadcastListResponse(
@@ -29,6 +29,10 @@ class AihrBroadcastAttachmentContractTest {
assertTrue(context.contains("消息正文"));
assertTrue(context.contains("原文件提取内容"));
assertFalse(responseFields.contains("extractedText"));
assertFalse(responseFields.contains("insightsJson"));
assertTrue(responseFields.contains("insightStatus"));
assertTrue(responseFields.contains("defaultPerspectiveCode"));
assertTrue(responseFields.contains("perspectives"));
}
@Test