diff --git a/cmvr-iot-admin/src/main/java/com/cmvr/web/controller/test/TeFlowController.java b/cmvr-iot-admin/src/main/java/com/cmvr/web/controller/test/TeFlowController.java index f90e64e..16af03a 100644 --- a/cmvr-iot-admin/src/main/java/com/cmvr/web/controller/test/TeFlowController.java +++ b/cmvr-iot-admin/src/main/java/com/cmvr/web/controller/test/TeFlowController.java @@ -5,6 +5,7 @@ import com.cmvr.common.core.domain.AjaxResult; import com.cmvr.test.flow.context.TaskContextManager; import com.cmvr.test.flow.control.FlowControlService; import com.cmvr.test.flow.runtime.engine.FlowTaskRuntimeService; +import com.cmvr.test.flow.runtime.operator.edge.ti.TiTouchOperateService; import com.cmvr.test.model.domain.TeDetectionItem; import com.cmvr.test.model.vo.FlowActionRequestVO; import com.cmvr.test.model.vo.TeFlowViewVO; @@ -21,6 +22,7 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.validation.Valid; @@ -37,6 +39,7 @@ public class TeFlowController extends BaseController { private final TaskContextManager taskContextManager; private final FlowControlService flowControlService; private final FlowActionExecutorService flowActionExecutorService; + private final TiTouchOperateService tiTouchOperateService; @ApiOperation("流程发布") @PostMapping("/publish") @@ -95,4 +98,11 @@ public class TeFlowController extends BaseController { public AjaxResult actionExecute(@RequestBody FlowActionRequestVO flowActionRequestVO) { return AjaxResult.ok(flowActionExecutorService.actionExecute(flowActionRequestVO)); } + + @GetMapping("/testrun") + @ApiOperation("测试接口") + public AjaxResult testrun(@RequestParam("imageUrl") String imageUrl, + @RequestParam("iconUrl") String iconUrl) { + return AjaxResult.ok(tiTouchOperateService.test(imageUrl,iconUrl)); + } } \ No newline at end of file diff --git a/cmvr-iot-admin/src/main/resources/application-dev.yml b/cmvr-iot-admin/src/main/resources/application-dev.yml index 8580433..5b987bd 100644 --- a/cmvr-iot-admin/src/main/resources/application-dev.yml +++ b/cmvr-iot-admin/src/main/resources/application-dev.yml @@ -120,9 +120,9 @@ api: INTENT_RECOGNITION: # 意图识别 app-id: d5dn5ibp9adhq1b34lig app-key: d6j5bcellh49on5tasvg - TOUCH_COORDINATES: # 意图识别 - app-id: d5thge2cktmipk78h82g - app-key: d1ebtabnjkflk4gmhikg + TI_TOUCH_COORDINATES: # 获取触控二维坐标 + app-id: d1ebtabnjkflk4gmhikg + app-key: d5thge2cktmipk78h82g evaluation: http://192.168.0.8:8000/analyze flowise: diff --git a/cmvr-iot-test/src/main/java/com/cmvr/test/flow/runtime/operator/edge/ti/TiTouchOperateService.java b/cmvr-iot-test/src/main/java/com/cmvr/test/flow/runtime/operator/edge/ti/TiTouchOperateService.java index b7ab3c2..35f2813 100644 --- a/cmvr-iot-test/src/main/java/com/cmvr/test/flow/runtime/operator/edge/ti/TiTouchOperateService.java +++ b/cmvr-iot-test/src/main/java/com/cmvr/test/flow/runtime/operator/edge/ti/TiTouchOperateService.java @@ -108,6 +108,16 @@ public class TiTouchOperateService implements EdgeOperateService { return exTiVehicleFunctionService.queryById(funcId); } + public String test(String imageUrl,String iconUrl) { + String pageImageUrl = uploadImageFromMinio(imageUrl); + + // icon图片 + String iconImageUrl = uploadImageFromMinio(iconUrl); + + // 获取触控坐标 + return getTouchCoordinates(pageImageUrl, iconImageUrl); + } + private String getTouchCoordinates(String pageImageUrl, String iconImageUrl) { AgentConfig agentConfig = apiProperties.getAgentConfig(ActionEnum.TI_TOUCH_COORDINATES.getAction()); Map params = new HashMap<>();