fix(aihr): keep demo question verification read-only

This commit is contained in:
2026-07-09 13:08:54 +08:00
parent b2ba54b2b3
commit 0bff6bbfa6
3 changed files with 14 additions and 2 deletions
@@ -1788,7 +1788,7 @@ public class AihrSopSeedService {
}
private SearchResponse withReviewId(SearchResponse response, String source) {
Long reviewId = createSopReview(response, source);
Long reviewId = skipSopReview(source) ? null : createSopReview(response, source);
return new SearchResponse(
response.queryText(),
response.category(),
@@ -1804,6 +1804,10 @@ public class AihrSopSeedService {
);
}
static boolean skipSopReview(String source) {
return "verify_demo_questions".equals(source);
}
private Long createSopReview(SearchResponse response, String source) {
try {
ensureSopReviewTable();
@@ -26,4 +26,11 @@ public class AihrSopSeedServiceTest {
assertTrue(response.reference().contains("1 份文档 / 1 个片段"));
assertTrue(response.cautions().contains("未生成结构化概要,已返回命中原文片段。"));
}
@Test
@Tag("dev")
public void verifyDemoQuestionsSourceSkipsSopReviewSample() {
assertTrue(AihrSopSeedService.skipSopReview("verify_demo_questions"));
assertFalse(AihrSopSeedService.skipSopReview("knowledge_search"));
}
}