增加U3d同步协议
This commit is contained in:
parent
989f0a723b
commit
577fe18c21
@ -0,0 +1,22 @@
|
||||
package com.qiuguo.iot.base.enums;
|
||||
|
||||
/*
|
||||
* 关键字梅举
|
||||
* 作者:吴林
|
||||
* */
|
||||
public enum KeyTypeEnum {
|
||||
SYSTEM_COMMAND(0, "系统自定义名称关键字"),
|
||||
USER_BIND_NAME(1, "用户绑定的设备名称"),
|
||||
SYSTEM_ACTION(2, "系统自定义动作动词"),
|
||||
;
|
||||
KeyTypeEnum(Integer c, String n){
|
||||
code = c;
|
||||
name = n;
|
||||
}
|
||||
private Integer code;
|
||||
private String name;
|
||||
|
||||
public Integer getCode() {return code;}
|
||||
|
||||
public String getName() {return name;}
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
package com.qiuguo.iot.data.resp.u3d;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 与U3D通过MQ交互信息
|
||||
*/
|
||||
@Data
|
||||
public class U3dMsg {
|
||||
/**
|
||||
* 消息类型:0:跳舞 1 :换装 2:口型 100:IOT
|
||||
*/
|
||||
private Integer msgType;
|
||||
|
||||
/**
|
||||
* msgType=0,1,3时数字人ID,msgType=3时设备所在虚拟世界ID
|
||||
*/
|
||||
private Long metaId;
|
||||
|
||||
/**
|
||||
* 状态ID
|
||||
*/
|
||||
private Long statusId;
|
||||
|
||||
/**
|
||||
* 场景ID
|
||||
*/
|
||||
private Long scenceId;
|
||||
|
||||
/**
|
||||
* 类型ID
|
||||
*/
|
||||
private Long typeId;
|
||||
|
||||
/**
|
||||
* 坐标x
|
||||
*/
|
||||
String x;
|
||||
/**
|
||||
* 坐标y
|
||||
*/
|
||||
String y;
|
||||
|
||||
/**
|
||||
* 坐标z
|
||||
*/
|
||||
String z;
|
||||
/**
|
||||
* 发送时间
|
||||
*/
|
||||
Long time;
|
||||
}
|
||||
@ -14,7 +14,7 @@ public class SystemTalkKeyAndDeviceName {
|
||||
int index;
|
||||
|
||||
/**
|
||||
* 类型 0 系统自定义关键字 1 用户设备名称
|
||||
* 类型 0 系统自定义名称关键字 1 用户设备名称 2 系统自定义动词
|
||||
*/
|
||||
Integer type;
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.qiuguo.iot.third.service;
|
||||
|
||||
import com.qiuguo.iot.base.enums.KeyTypeEnum;
|
||||
import com.qiuguo.iot.base.enums.YesNo;
|
||||
import com.qiuguo.iot.third.enums.ChinesePartSpeechEnum;
|
||||
import com.qiuguo.iot.base.enums.DeviceTypeEnum;
|
||||
@ -58,16 +59,25 @@ public class NlpService {
|
||||
for(SystemTalkAnswerConfigEntity entity : systemTalkAnswerConfigService.getCommandList()){
|
||||
SystemTalkKeyAndDeviceName systemTalkKeyAndDeviceName = new SystemTalkKeyAndDeviceName();
|
||||
systemTalkKeyAndDeviceName.setKey(entity.getAskKey());
|
||||
systemTalkKeyAndDeviceName.setType(0);
|
||||
systemTalkKeyAndDeviceName.setType(KeyTypeEnum.SYSTEM_COMMAND.getCode());
|
||||
systemTalkKeyAndDeviceName.setIndex(i++);
|
||||
systemTalkKeyAndDeviceNameList.add(systemTalkKeyAndDeviceName);
|
||||
}
|
||||
|
||||
/*i = 0;
|
||||
for(SystemTalkAnswerConfigEntity entity : systemTalkAnswerConfigService.getSystemTalkWithKeyGroup().values()){
|
||||
SystemTalkKeyAndDeviceName systemTalkKeyAndDeviceName = new SystemTalkKeyAndDeviceName();
|
||||
systemTalkKeyAndDeviceName.setKey(entity.getAskKey());
|
||||
systemTalkKeyAndDeviceName.setType(KeyTypeEnum.SYSTEM_ACTION.getCode());
|
||||
systemTalkKeyAndDeviceName.setIndex(i++);
|
||||
systemTalkKeyAndDeviceNameList.add(systemTalkKeyAndDeviceName);
|
||||
}*/
|
||||
|
||||
i = 0;
|
||||
for(DeviceUserBindEntity entity : deviceUserBindEntityPagerResult.getData()){
|
||||
SystemTalkKeyAndDeviceName systemTalkKeyAndDeviceName = new SystemTalkKeyAndDeviceName();
|
||||
systemTalkKeyAndDeviceName.setKey(entity.getBindName());
|
||||
systemTalkKeyAndDeviceName.setType(1);
|
||||
systemTalkKeyAndDeviceName.setType(KeyTypeEnum.USER_BIND_NAME.getCode());
|
||||
systemTalkKeyAndDeviceName.setIndex(i++);
|
||||
systemTalkKeyAndDeviceNameList.add(systemTalkKeyAndDeviceName);
|
||||
}
|
||||
@ -82,15 +92,18 @@ public class NlpService {
|
||||
for(SystemTalkKeyAndDeviceName sysTalkKeyAndDeviceName :systemTalkKeyAndDeviceNameList){
|
||||
if(pText.indexOf(sysTalkKeyAndDeviceName.getKey()) >= 0){
|
||||
//找到对应的名称
|
||||
if(sysTalkKeyAndDeviceName.getType().equals(YesNo.YES.getCode())){
|
||||
if(sysTalkKeyAndDeviceName.getType().equals(KeyTypeEnum.USER_BIND_NAME.getCode())){
|
||||
//用户绑定设备名称
|
||||
pText = pText.replace(sysTalkKeyAndDeviceName.getKey(), ">" + (i++) + ">");
|
||||
includs.add(deviceUserBindEntityPagerResult.getData().get(sysTalkKeyAndDeviceName.getIndex()));
|
||||
}else{
|
||||
}else if(sysTalkKeyAndDeviceName.getType().equals(KeyTypeEnum.SYSTEM_COMMAND.getCode())){
|
||||
//是系统自定义动词后的名称
|
||||
pText = pText.replace(sysTalkKeyAndDeviceName.getKey(), "#" + (j++) + "#");
|
||||
commands.add(systemTalkAnswerConfigService.getCommandList().get(sysTalkKeyAndDeviceName.getIndex()));
|
||||
|
||||
}else{
|
||||
//系统自定义动作
|
||||
pText = pText.replace(sysTalkKeyAndDeviceName.getKey(), "<" + (j++) + "<");
|
||||
commands.add(systemTalkAnswerConfigService.getCommandList().get(sysTalkKeyAndDeviceName.getIndex()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ public class MysqlMain {
|
||||
}
|
||||
List<TablesBean> list = new ArrayList<>();
|
||||
|
||||
list.add(new TablesBean("device_user_bind"));
|
||||
list.add(new TablesBean("system_address"));
|
||||
//list.add(new TablesBean("system_same_talk"));
|
||||
|
||||
List<TablesBean> list2 = new ArrayList<TablesBean>();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user