fix(aihr): keep demo question verification read-only
This commit is contained in:
+5
-1
@@ -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();
|
||||
|
||||
+7
@@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +171,8 @@ for (const item of questions) {
|
||||
const response = await request('POST', '/api/knowledge/search', {
|
||||
queryText: item.question,
|
||||
category: 'sop',
|
||||
position: '生活顾问'
|
||||
position: '生活顾问',
|
||||
source: 'verify_demo_questions'
|
||||
}, token);
|
||||
const data = response.data?.data || {};
|
||||
const docs = data.docs || [];
|
||||
|
||||
Reference in New Issue
Block a user