feat: 触控交互(部分)
This commit is contained in:
parent
e553e66379
commit
5d41c6b1ae
@ -13,7 +13,8 @@ public enum FlowSceneTypeEnum {
|
||||
NORMAL(0, "普通流程场景", "NORMAL"),
|
||||
VI_WAKEUP_CORPUS(1, "语音交互-唤醒场景", "VI_WAKEUP_CORPUS"),
|
||||
VI_SINGLE_CORPUS(2, "语音交互-单次对话场景", "VI_SINGLE_CORPUS"),
|
||||
VI_CONTINUOUS_CORPUS(3, "语音交互-连续对话场景", "VI_CONTINUOUS_CORPUS");
|
||||
VI_CONTINUOUS_CORPUS(3, "语音交互-连续对话场景", "VI_CONTINUOUS_CORPUS"),
|
||||
TI_TOUCH(4, "触控交互场景", "TI_TOUCH");
|
||||
|
||||
private final int code; // 数字类型
|
||||
private final String desc; // 描述
|
||||
|
||||
@ -18,6 +18,7 @@ public enum NodeTypeEnum {
|
||||
STOP_LOOP("stopLoop"),
|
||||
END("end"),
|
||||
SLEEP("sleep"),
|
||||
HTTP("http"),
|
||||
SUB_END("subEnd"),
|
||||
;
|
||||
|
||||
|
||||
@ -286,6 +286,8 @@ public class FlowModelBuilder {
|
||||
return NodeTypeEnum.STOP_LOOP;
|
||||
case "sleep":
|
||||
return NodeTypeEnum.SLEEP;
|
||||
case "http":
|
||||
return NodeTypeEnum.HTTP;
|
||||
default:
|
||||
return NodeTypeEnum.FUNCTION;
|
||||
}
|
||||
|
||||
@ -18,7 +18,10 @@ public class FlowHttpNodeHandler implements FlowNodeTypeHandler {
|
||||
|
||||
@Override
|
||||
public TaskNodeExecuteResult handle(TaskNodeExecuteMessage message) {
|
||||
try {
|
||||
JSONObject output = new JSONObject();
|
||||
output.put("result", "主页");
|
||||
return TaskNodeExecuteResult.success(output);
|
||||
/* try {
|
||||
JSONObject inputParams = message.getInputParams();
|
||||
|
||||
// 1. 必填参数校验
|
||||
@ -91,6 +94,6 @@ public class FlowHttpNodeHandler implements FlowNodeTypeHandler {
|
||||
} catch (Exception e) {
|
||||
log.error("[FLOW][HTTP] 执行异常", e);
|
||||
return TaskNodeExecuteResult.failure(e.getMessage());
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.text.StrPool;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.cmvr.common.config.properties.MinioProperties;
|
||||
import com.cmvr.common.core.minio.MinioService;
|
||||
@ -66,11 +67,10 @@ public class TiTouchOperateService implements EdgeOperateService {
|
||||
switch (action) {
|
||||
case TI_PATH_SEARCH: {
|
||||
// 当前界面
|
||||
String currentLocation = inputParams.getString("currentLocation");
|
||||
|
||||
// String currentLocation = inputParams.getString("currentLocation");
|
||||
String currentLocation = "主页";
|
||||
// 查询功能
|
||||
long funcId = inputParams.getLongValue("funcId");
|
||||
JSONObject funcObj = exTiVehicleFunctionService.queryById(funcId);
|
||||
JSONObject funcObj = getFuncObj(message.getIterations(),inputParams);
|
||||
|
||||
String funcKey = funcObj.getString("funcKey");
|
||||
String iconUrl = funcObj.getString("iconUrl");
|
||||
@ -134,6 +134,13 @@ public class TiTouchOperateService implements EdgeOperateService {
|
||||
return TaskNodeExecuteResult.success(output);
|
||||
}
|
||||
|
||||
private JSONObject getFuncObj(List<Integer> iterations, JSONObject inputParams) {
|
||||
JSONArray funcIds = inputParams.getJSONArray("funcId");
|
||||
int index = iterations.get(0) - 1;
|
||||
Long funcId = funcIds.toJavaList(Long.class).get(index);
|
||||
return exTiVehicleFunctionService.queryById(funcId);
|
||||
}
|
||||
|
||||
private String getTouchCoordinates(String pageImageUrl, String iconImageUrl) {
|
||||
AgentConfig agentConfig = apiProperties.getAgentConfig(ActionEnum.TI_TOUCH_COORDINATES.getAction());
|
||||
Map<String, String> params = new HashMap<>();
|
||||
|
||||
@ -3,6 +3,7 @@ package com.cmvr.ti.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.cmvr.test.model.domain.TeTaskInst;
|
||||
import com.cmvr.test.model.vo.TeQueryProjectOrchestraItemVO;
|
||||
import com.cmvr.test.model.vo.TeQueryTaskOrchestraItemVO;
|
||||
import com.cmvr.test.model.vo.TeTaskExecuteProjectVO;
|
||||
import com.cmvr.ti.model.domain.TiProject;
|
||||
|
||||
@ -19,7 +20,7 @@ public interface ITiProjectService extends IService<TiProject> {
|
||||
|
||||
public int deleteTiProjectByProjectIds(String[] projectIds);
|
||||
|
||||
public List<TeQueryProjectOrchestraItemVO> queryExecuteRunParams(String projectId);
|
||||
public List<TeQueryTaskOrchestraItemVO> queryExecuteRunParams(String projectId);
|
||||
|
||||
public String executeProject(TeTaskExecuteProjectVO taskExecuteProjectVO);
|
||||
|
||||
|
||||
@ -13,9 +13,10 @@ import com.cmvr.test.enums.RunModeEnum;
|
||||
import com.cmvr.test.flow.runtime.engine.FlowTaskRuntimeService;
|
||||
import com.cmvr.test.model.domain.TeTaskConfigInfo;
|
||||
import com.cmvr.test.model.domain.TeTaskInst;
|
||||
import com.cmvr.test.model.vo.TeQueryProjectOrchestraItemVO;
|
||||
import com.cmvr.test.model.vo.TeQueryTaskOrchestraItemVO;
|
||||
import com.cmvr.test.model.vo.TeTaskExecuteProjectVO;
|
||||
import com.cmvr.test.service.ITeTaskConfigInfoService;
|
||||
import com.cmvr.test.service.ITeTaskOrchestrationService;
|
||||
import com.cmvr.ti.mapper.TiProjectMapper;
|
||||
import com.cmvr.ti.model.domain.TiProject;
|
||||
import com.cmvr.ti.model.domain.TiVehicleFunction;
|
||||
@ -25,7 +26,6 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -33,6 +33,7 @@ import java.util.stream.Collectors;
|
||||
@RequiredArgsConstructor
|
||||
public class TiProjectServiceImpl extends ServiceImpl<TiProjectMapper, TiProject> implements ITiProjectService {
|
||||
|
||||
private final ITeTaskOrchestrationService taskOrchestrationService;
|
||||
private final ITeTaskConfigInfoService taskConfigInfoService;
|
||||
private final FlowTaskRuntimeService flowTaskRuntimeService;
|
||||
private final ITiVehicleFunctionService tiVehicleFunctionService;
|
||||
@ -93,8 +94,8 @@ public class TiProjectServiceImpl extends ServiceImpl<TiProjectMapper, TiProject
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TeQueryProjectOrchestraItemVO> queryExecuteRunParams(String projectId) {
|
||||
return Collections.emptyList();
|
||||
public List<TeQueryTaskOrchestraItemVO> queryExecuteRunParams(String projectId) {
|
||||
return taskOrchestrationService.queryByTaskId(projectId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
Reference in New Issue
Block a user