|
|
@ -112,6 +112,7 @@ public class ZhipuAnalysisServiceImpl implements ZhipuAnalysisService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getBase64FromUrl(String url) { |
|
|
|
public String getBase64FromUrl(String url) { |
|
|
|
|
|
|
|
log.info("get base64 from url ,url : {}", url); |
|
|
|
String base64 = null; |
|
|
|
String base64 = null; |
|
|
|
try { |
|
|
|
try { |
|
|
|
base64 = FileUtil.getBase64(FileUtil.getUrlByteByRequest(url)); |
|
|
|
base64 = FileUtil.getBase64(FileUtil.getUrlByteByRequest(url)); |
|
|
@ -147,7 +148,8 @@ public class ZhipuAnalysisServiceImpl implements ZhipuAnalysisService { |
|
|
|
Assert.isTrue(CollectionUtil.isNotEmpty(request.getCodeList()) || CollectionUtil.isNotEmpty(request.getCheckTypeSonList()), () -> { |
|
|
|
Assert.isTrue(CollectionUtil.isNotEmpty(request.getCodeList()) || CollectionUtil.isNotEmpty(request.getCheckTypeSonList()), () -> { |
|
|
|
throw ErrorCode.EMPTY_ANALYSIS_TYPE.throwException(); |
|
|
|
throw ErrorCode.EMPTY_ANALYSIS_TYPE.throwException(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
List<ZhipuAnalysisInfoEntity> infoList = infoService.list(Wrappers.<ZhipuAnalysisInfoEntity>lambdaQuery().in(CollectionUtil.isNotEmpty(request.getCodeList()), ZhipuAnalysisInfoEntity::getCode, request.getCodeList()) |
|
|
|
List<ZhipuAnalysisInfoEntity> infoList = infoService.list(Wrappers.<ZhipuAnalysisInfoEntity>lambdaQuery() |
|
|
|
|
|
|
|
.in(CollectionUtil.isNotEmpty(request.getCodeList()), ZhipuAnalysisInfoEntity::getCode, request.getCodeList()) |
|
|
|
.in(CollectionUtil.isNotEmpty(request.getCheckTypeSonList()), ZhipuAnalysisInfoEntity::getCheckTypeSon, request.getCheckTypeSonList())); |
|
|
|
.in(CollectionUtil.isNotEmpty(request.getCheckTypeSonList()), ZhipuAnalysisInfoEntity::getCheckTypeSon, request.getCheckTypeSonList())); |
|
|
|
Assert.isTrue(CollectionUtil.isNotEmpty(infoList), () -> { |
|
|
|
Assert.isTrue(CollectionUtil.isNotEmpty(infoList), () -> { |
|
|
|
throw ErrorCode.UNKNOWN_ANALYSIS_TYPE.throwException(); |
|
|
|
throw ErrorCode.UNKNOWN_ANALYSIS_TYPE.throwException(); |
|
|
@ -211,7 +213,7 @@ public class ZhipuAnalysisServiceImpl implements ZhipuAnalysisService { |
|
|
|
formatBuilder.append("{"); |
|
|
|
formatBuilder.append("{"); |
|
|
|
for (int index = 1; index <= infoList.size(); index++) { |
|
|
|
for (int index = 1; index <= infoList.size(); index++) { |
|
|
|
ZhipuAnalysisInfoEntity infoEntity = infoList.get(index - 1); |
|
|
|
ZhipuAnalysisInfoEntity infoEntity = infoList.get(index - 1); |
|
|
|
stringBuilder.append(StringUtil.format(MULTI_QUESTION_PREFIX, index)); |
|
|
|
stringBuilder.append(StringUtil.format(MULTI_QUESTION_PREFIX, index)).append(infoEntity.getRequestContent()); |
|
|
|
titleBuilder.append(StringUtil.format(MULTI_QUESTION_CONSTRAINS_LIST, infoEntity.getResultKey(), index)); |
|
|
|
titleBuilder.append(StringUtil.format(MULTI_QUESTION_CONSTRAINS_LIST, infoEntity.getResultKey(), index)); |
|
|
|
formatBuilder.append(infoEntity.getRequestOutputFormat()).append(","); |
|
|
|
formatBuilder.append(infoEntity.getRequestOutputFormat()).append(","); |
|
|
|
} |
|
|
|
} |
|
|
|