feat(broadcast): add multi-role insight contract
This commit is contained in:
+45
-1
@@ -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(
|
||||
|
||||
+4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user