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