| | |
| | | @Override |
| | | public R<?> getFile(GetFileDto getFileDto) throws IOException, SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException, TesseractException { |
| | | File file = getFileStart(getFileDto.getFilePath(), getFileDto.getFileExtension()); |
| | | if (!file.exists()) { |
| | | if (file != null && !file.exists()) { |
| | | return R.failed("未查询到该路径:" + getFileDto.getFilePath() + "下存在:" + getFileDto.getFileExtension() + "结尾的文件!"); |
| | | } |
| | | switch (getFileDto.getFileExtension()) { |
| | |
| | | return R.ok(TakeWords.getMysqlFile(getFileDto)); |
| | | case ".png": |
| | | return R.ok(TakeWords.readPngFile(file)); |
| | | case ".mqtt": |
| | | return R.ok("mqtt---"); |
| | | default: |
| | | return R.failed("后缀名配置错误!"); |
| | | } |