fix: 获取触控二维坐标
This commit is contained in:
parent
89b7ce697d
commit
890b4c2875
@ -5,6 +5,7 @@ import com.cmvr.common.core.domain.AjaxResult;
|
|||||||
import com.cmvr.test.flow.context.TaskContextManager;
|
import com.cmvr.test.flow.context.TaskContextManager;
|
||||||
import com.cmvr.test.flow.control.FlowControlService;
|
import com.cmvr.test.flow.control.FlowControlService;
|
||||||
import com.cmvr.test.flow.runtime.engine.FlowTaskRuntimeService;
|
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.domain.TeDetectionItem;
|
||||||
import com.cmvr.test.model.vo.FlowActionRequestVO;
|
import com.cmvr.test.model.vo.FlowActionRequestVO;
|
||||||
import com.cmvr.test.model.vo.TeFlowViewVO;
|
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.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
@ -37,6 +39,7 @@ public class TeFlowController extends BaseController {
|
|||||||
private final TaskContextManager taskContextManager;
|
private final TaskContextManager taskContextManager;
|
||||||
private final FlowControlService flowControlService;
|
private final FlowControlService flowControlService;
|
||||||
private final FlowActionExecutorService flowActionExecutorService;
|
private final FlowActionExecutorService flowActionExecutorService;
|
||||||
|
private final TiTouchOperateService tiTouchOperateService;
|
||||||
|
|
||||||
@ApiOperation("流程发布")
|
@ApiOperation("流程发布")
|
||||||
@PostMapping("/publish")
|
@PostMapping("/publish")
|
||||||
@ -95,4 +98,11 @@ public class TeFlowController extends BaseController {
|
|||||||
public AjaxResult actionExecute(@RequestBody FlowActionRequestVO flowActionRequestVO) {
|
public AjaxResult actionExecute(@RequestBody FlowActionRequestVO flowActionRequestVO) {
|
||||||
return AjaxResult.ok(flowActionExecutorService.actionExecute(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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -120,9 +120,9 @@ api:
|
|||||||
INTENT_RECOGNITION: # 意图识别
|
INTENT_RECOGNITION: # 意图识别
|
||||||
app-id: d5dn5ibp9adhq1b34lig
|
app-id: d5dn5ibp9adhq1b34lig
|
||||||
app-key: d6j5bcellh49on5tasvg
|
app-key: d6j5bcellh49on5tasvg
|
||||||
TOUCH_COORDINATES: # 意图识别
|
TI_TOUCH_COORDINATES: # 获取触控二维坐标
|
||||||
app-id: d5thge2cktmipk78h82g
|
app-id: d1ebtabnjkflk4gmhikg
|
||||||
app-key: d1ebtabnjkflk4gmhikg
|
app-key: d5thge2cktmipk78h82g
|
||||||
evaluation: http://192.168.0.8:8000/analyze
|
evaluation: http://192.168.0.8:8000/analyze
|
||||||
|
|
||||||
flowise:
|
flowise:
|
||||||
|
|||||||
@ -108,6 +108,16 @@ public class TiTouchOperateService implements EdgeOperateService {
|
|||||||
return exTiVehicleFunctionService.queryById(funcId);
|
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) {
|
private String getTouchCoordinates(String pageImageUrl, String iconImageUrl) {
|
||||||
AgentConfig agentConfig = apiProperties.getAgentConfig(ActionEnum.TI_TOUCH_COORDINATES.getAction());
|
AgentConfig agentConfig = apiProperties.getAgentConfig(ActionEnum.TI_TOUCH_COORDINATES.getAction());
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user