|
|
@ -306,14 +306,19 @@ public class ChatMessageServiceImpl implements ChatMessageService {
|
|
|
|
List<ChatModelDto> chatModels = new ArrayList<>();
|
|
|
|
List<ChatModelDto> chatModels = new ArrayList<>();
|
|
|
|
ChatModelDto chatModel = null;
|
|
|
|
ChatModelDto chatModel = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//验证获取模型数据 异常问题
|
|
|
|
|
|
|
|
File file = null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
File file = new File(ClassLoader.getSystemResource("Json/ChatModel.json").getPath()); //相对路径获取文件信息
|
|
|
|
file = new File(ClassLoader.getSystemResource("Json/ChatModel.json").getPath()); //相对路径获取文件信息
|
|
|
|
//File file = new File("src/main/resources/Json/ChatModel.json"); //绝对路径获取文件信息
|
|
|
|
//File file = new File("src/main/resources/Json/ChatModel.json"); //绝对路径获取文件信息
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
throw new ServiceException(ErrorCode.OPERATION_ERROR.getCode(), "读取文件" + Arrays.toString(e.getStackTrace()));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
//chatModel = readerMethod(file);
|
|
|
|
//chatModel = readerMethod(file);
|
|
|
|
chatModels = readerMethod(file);
|
|
|
|
chatModels = readerMethod(file);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
throw new ServiceException(ErrorCode.OPERATION_ERROR.getCode(), e.getMessage());
|
|
|
|
throw new ServiceException(ErrorCode.OPERATION_ERROR.getCode(), "读取文件并转换实体类" + Arrays.toString(e.getStackTrace()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//循环查找对应的模型数据
|
|
|
|
//循环查找对应的模型数据
|
|
|
|