新增调试模式ocr,分段,归档上传事件和处理器

segment2.0
linrf 2 years ago
parent a65a9576a9
commit 108e0882d3

@ -26,11 +26,15 @@ public class FlowEvent extends ApplicationEvent {
public enum FlowTypeEnum implements IIntegerEnum {
//
//正式
START_SEGMENT(1, "开始分段事件"),
START_OCR(2, "开始OCR事件"),
START_UPLOAD(3, "开始上传归档系统事件");
START_UPLOAD(3, "开始上传归档系统事件"),
//调试
START_SEGMENT_TEST(4, "开始分段测试事件"),
START_OCR_TEST(5, "开始OCR测试事件"),
START_UPLOAD_TEST(6, "开始上传归档系统测试事件");
private Integer value;
private String display;

@ -0,0 +1,23 @@
package com.docus.server.service.handler;
import com.docus.log.annotation.TrackRetryListener;
import com.docus.server.api.ocr.OcrApi;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
/**
* OCR
*/
@Component
public class StartOcrTestHandler {
@Resource
private OcrApi ocrApi;
@TrackRetryListener("START_OCR_TEST")
public void startOcr(String patientId) {
System.out.println(patientId);
List<String> text = ocrApi.getText("D:\\docus\\cut\\segmentation\\20230822\\c6b03e5767814895a2c155c32f174051\\麻醉.jpg");
}
}

@ -0,0 +1,16 @@
package com.docus.server.service.handler;
import com.docus.log.annotation.TrackRetryListener;
import org.springframework.stereotype.Component;
/**
*
*/
@Component
public class StartSegmenTesttHandler {
@TrackRetryListener("START_SEGMENT_TEST")
public void startSegment(String patientId) {
System.out.println(patientId);
}
}

@ -0,0 +1,21 @@
package com.docus.server.service.handler;
import com.docus.log.annotation.TrackRetryListener;
import com.docus.server.service.impl.PlatformServiceImpl;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
*
*/
@Component
public class StartUploadTestHandler {
@Resource
private PlatformServiceImpl downloadService;
@TrackRetryListener("START_UPLOAD_TEST")
public void startUpload(String patientId) {
downloadService.uploadPlatform(null, null);
}
}
Loading…
Cancel
Save