1. 去除oss 中ocr 相关部分

2. 修改 配置文件信息
This commit is contained in:
ant 2024-06-03 09:40:52 +08:00
parent f0d00c730f
commit 7ee125c479
1 changed files with 14 additions and 14 deletions

View File

@ -22,8 +22,8 @@ public class FileController {
@Resource @Resource
FileSourceService fileSourceService; FileSourceService fileSourceService;
@Resource // @Resource
OcrService ocrService; // OcrService ocrService;
/** /**
* todo * todo
@ -33,18 +33,18 @@ public class FileController {
public AjaxResult uploadFile(@RequestParam(value = "file") MultipartFile file, public AjaxResult uploadFile(@RequestParam(value = "file") MultipartFile file,
@RequestParam(value = "ocrType", required = false) String ocrType) { @RequestParam(value = "ocrType", required = false) String ocrType) {
FileSourceVo vo = BeanUtil.copyProperties(fileSourceService.addFile(file, "ip"), FileSourceVo.class); FileSourceVo vo = BeanUtil.copyProperties(fileSourceService.addFile(file, "ip"), FileSourceVo.class);
if (StrUtil.isNotEmpty(ocrType)) { // if (StrUtil.isNotEmpty(ocrType)) {
OcrDTO ocr = new OcrDTO(); // OcrDTO ocr = new OcrDTO();
OcrTypeEnum ocrTypeEnum = OcrTypeEnum.findByCode(ocrType); // OcrTypeEnum ocrTypeEnum = OcrTypeEnum.findByCode(ocrType);
if (ocrTypeEnum != OcrTypeEnum.NONE) { // if (ocrTypeEnum != OcrTypeEnum.NONE) {
ocr.setOcrType(ocrTypeEnum); // ocr.setOcrType(ocrTypeEnum);
ocr.setImgPath(vo.getFilePath()); // ocr.setImgPath(vo.getFilePath());
Result<JSONObject> ocrInfo = ocrService.ocr(ocr); //// Result<JSONObject> ocrInfo = ocrService.ocr(ocr);
if (ocrInfo.isSuccess()) { //// if (ocrInfo.isSuccess()) {
vo.setOcr(ocrInfo.getData()); //// vo.setOcr(ocrInfo.getData());
} //// }
} // }
} // }
return AjaxResult.success(vo); return AjaxResult.success(vo);
} }