|
|
|
@ -38,7 +38,7 @@ public class CheckMilvusDomainServiceImpl implements CheckMilvusDomainService { |
|
|
|
throw new MissingParameterException("请求参数缺失或格式错误"); |
|
|
|
} |
|
|
|
|
|
|
|
List<Long> pointIdsList = title.getPointIdsList(); |
|
|
|
List<Long> pointIdsList = title.getAtomIdsList(); |
|
|
|
List<Float> titleVectorList = title.getTitleVectorList(); |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(pointIdsList) || CollectionUtil.isEmpty(titleVectorList)) { |
|
|
|
@ -49,6 +49,11 @@ public class CheckMilvusDomainServiceImpl implements CheckMilvusDomainService { |
|
|
|
throw new MissingParameterException("所属知识点簇ID不能为空"); |
|
|
|
} |
|
|
|
|
|
|
|
if (title.getTaskId() == null){ |
|
|
|
throw new MissingParameterException("考试任务ID不能为空"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(titleVectorList.size() != 1024){ |
|
|
|
throw new MissingParameterException("向量格式错误"); |
|
|
|
} |
|
|
|
@ -107,7 +112,7 @@ public class CheckMilvusDomainServiceImpl implements CheckMilvusDomainService { |
|
|
|
} |
|
|
|
public String buildQuestionHash(QuestionDTO.QuestionDetailDTO detailDTO, TitleVector title){ |
|
|
|
//查询知识点并提取非空的 parseName
|
|
|
|
List<KnowledgePointEntity> knowledgePointEntities = knowledgePointBaseService.listByIds(title.getPointIdsList()); |
|
|
|
List<KnowledgePointEntity> knowledgePointEntities = knowledgePointBaseService.listByIds(title.getAtomIdsList()); |
|
|
|
if (CollectionUtils.isEmpty(knowledgePointEntities)) { |
|
|
|
throw new IllegalArgumentException("知识点不存在"); // 空值防护
|
|
|
|
} |
|
|
|
@ -129,7 +134,7 @@ public class CheckMilvusDomainServiceImpl implements CheckMilvusDomainService { |
|
|
|
//生成最终哈希(拆分拼接逻辑,提升可读性;增加分隔符避免字符串拼接歧义)
|
|
|
|
String rawContent = String.format("%s|%s|%s", |
|
|
|
StringUtils.isNotBlank(detailDTO.getQuestionContent()) ? detailDTO.getQuestionContent() : "", |
|
|
|
StringUtils.isNotBlank(title.getPointIdsHash()) ? title.getPointIdsHash() : "", |
|
|
|
StringUtils.isNotBlank(title.getAtomIdsHash()) ? title.getAtomIdsHash() : "", |
|
|
|
DigestUtils.md5Hex(canonicalKnowledgePoints) |
|
|
|
); |
|
|
|
return DigestUtils.md5Hex(rawContent); |
|
|
|
|