fix(OCR识别): 请求方式修改

This commit is contained in:
yjz
2024-06-05 11:54:13 +08:00
parent e6b92b2499
commit 75e7b5a7a9
@@ -41,7 +41,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("/laws/ocr/OCRRestful")
@Api(description = "|OCR识别 |")
@Api(tags = "OCR识别")
public class OCRRestfulController extends BaseController<OcrRecordEO> {
private static final Logger logger = LoggerFactory.getLogger(OCRRestfulController.class);
@@ -59,7 +59,7 @@ public class OCRRestfulController extends BaseController<OcrRecordEO> {
@Value("${file.path}")
private String filePath;//文件存储路径
@ApiOperation(value = "请求ocr")
@ApiOperation(value = "请求ocr-请求ocr", notes = "请求ocr-请求ocr")
@PostMapping(value="/upload",consumes="multipart/*",headers="content-type=multipart/form-data" )
public ResponseMessage<String> handleFile(@RequestParam("file") MultipartFile file) throws Exception {
SimpleDateFormat sdf=new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
@@ -67,7 +67,7 @@ public class OCRRestfulController extends BaseController<OcrRecordEO> {
return ocrRestfulService.handleFile(file,file.getOriginalFilename(),null,"add");
}
@ApiOperation(value = "ocr回调")
@ApiOperation(value = "OCR识别-ocr回调", notes = "OCR识别-ocr回调")
@PostMapping("/OcrHandleResult")
public String OcrHandleResult(@RequestParam("wordFile") MultipartFile wordFile,@RequestParam("jsonFile") MultipartFile jsonFile, OcrCallBackResultEo ocrCallBackResultEo) {
try{
@@ -97,7 +97,7 @@ public class OCRRestfulController extends BaseController<OcrRecordEO> {
}
}
@ApiOperation(value = "获取所有ocr结果")
@ApiOperation(value = "OCR识别-获取所有ocr结果", notes = "OCR识别-获取所有ocr结果")
@PostMapping("/getAllOcrResult")
public ResponseMessage<PageInfo<OcrRecordEO>> page(OcrRecordEOPage page) throws Exception {
if(org.apache.commons.lang3.StringUtils.isNotBlank(page.getPaixu()) && org.apache.commons.lang3.StringUtils.isNotBlank(page.getShunxu())){
@@ -118,7 +118,7 @@ public class OCRRestfulController extends BaseController<OcrRecordEO> {
return Result.success(getPageInfo(page.getPager(), rows));
}
@ApiOperation(value = "新增ocr内容")
@ApiOperation(value = "OCR识别-新增ocr内容", notes = "OCR识别-新增ocr内容")
@PostMapping("/addOcrRecord")
public ResponseMessage<OcrRecordEO> addOcrRecord(OcrRecordEO ocrRecordEO) throws Exception {
SimpleDateFormat sdf=new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
@@ -139,8 +139,8 @@ public class OCRRestfulController extends BaseController<OcrRecordEO> {
}
}
@ApiOperation(value = "修改ocr内容")
@PutMapping("/updateOcrRecord")
@ApiOperation(value = "OCR识别-修改ocr内容", notes = "OCR识别-修改ocr内容")
@PostMapping("/updateOcrRecord")
public ResponseMessage<OcrRecordEO> updateOcrRecord(@RequestBody OcrRecordEO ocrRecordEO) throws Exception {
if (StringUtils.isEmpty(ocrRecordEO.getAttId())) {
ocrRecordEOService.updateByPrimaryKeySelective(ocrRecordEO);
@@ -165,8 +165,8 @@ public class OCRRestfulController extends BaseController<OcrRecordEO> {
}
}
@ApiOperation(value = "删除ocr内容")
@DeleteMapping("/deleteOcrRecord")
@ApiOperation(value = "OCR识别-删除ocr内容", notes = "OCR识别-删除ocr内容")
@GetMapping("/deleteOcrRecord")
public ResponseMessage deleteOcrRecord(String ids) throws Exception {
if (StringUtils.isNotEmpty(ids)) {
String[] idArr = ids.split(",");