修改机器人接口

This commit is contained in:
haozq 2025-08-12 13:56:43 +08:00
parent a4d4b6d4cb
commit 0c4de8bd29
5 changed files with 60 additions and 18 deletions

View File

@ -13,7 +13,23 @@ import java.util.List;
@Slf4j
public class QxUtils {
public static String setLightModel(String opeId,String value){
StringBuilder builder=new StringBuilder();
try{
builder.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
builder.append("<M Type=\"ComReq\">");
builder.append("<C Type=\"S\" Prio=\"1\" EPID=\"system\">");
builder.append("<Res Type=\"ST\" Idx=\"0\" OptID=\"").append(opeId).append("\" >");
builder.append("<Param ").append("Value=\"").append(value).append("\" ").append(">");
builder.append("</Param>");
builder.append("</Res>");
builder.append("</C>");
builder.append("</M>");
}catch (Exception e){
log.error(e.toString(),e);
}
return builder.toString();
}
public static String setVideoSource(String opeId,String value){
StringBuilder builder=new StringBuilder();
try{
@ -30,8 +46,6 @@ public class QxUtils {
log.error(e.toString(),e);
}
return builder.toString();
}
public static String getStartVideo(String type,String opeId,String id,String loop,String enable){
@ -130,6 +144,9 @@ public class QxUtils {
return builder.toString();
}
/**
* 机器人状态
* @param type 指令类型

View File

@ -117,7 +117,14 @@ public class XxmSendUtils {
*/
public static String ROBOT_TASK_IMAGE="C_IVS_QueryIVSPayload";
/**
*警报灯
*/
public static String ROBOT_LIGHT_MODE="F_ST_AlarmLightMode";
/**
* 2.8 启用低电量自动回充
*/
public static String ROBOT_AUTO_CHARGE="F_ST_RobotAutoCharge";
/**
* 机器人-播放
*/

View File

@ -305,6 +305,16 @@ public class RobotServiceImpl implements IRobotService {
String xml= QxUtils.setVideoSource(XxmSendUtils.ROBOT_VIDEO_SOURCE,robotVo.getSound());
String res= QxVideotape.sendXmlPost(token,TVideoConfigUtil.Q2HTTPURL,robotVo.getPuId(),xml);
return AjaxResult.success(XmlUtils.getSuccess(res));
}else if("19".equals(robotVo.getType())){
//设置警报灯
String xml=QxUtils.setLightModel(XxmSendUtils.ROBOT_LIGHT_MODE,robotVo.getValue());
String res= QxVideotape.sendXmlPost(token,TVideoConfigUtil.Q2HTTPURL,robotVo.getPuId(),xml);
return AjaxResult.success(XmlUtils.getSuccess(res));
}else if("20".equals(robotVo.getType())){
//设置警报灯
String xml=QxUtils.setLightModel(XxmSendUtils.ROBOT_AUTO_CHARGE,robotVo.getValue());
String res= QxVideotape.sendXmlPost(token,TVideoConfigUtil.Q2HTTPURL,robotVo.getPuId(),xml);
return AjaxResult.success(XmlUtils.getSuccess(res));
}

View File

@ -73,4 +73,7 @@ public class RobotVo {
private String sound;
private String value;
}

View File

@ -16,18 +16,18 @@ spring:
driverClassName: com.mysql.cj.jdbc.Driver
druid:
# 主库数据源
# master:
# url: jdbc:mysql://192.168.0.14:4417/sbd_robot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: root
# password: Bonus@admin123!
# master:
# url: jdbc:mysql://127.0.0.1:3306/wunan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true
# username: root
# password: ccw1998@yyt1999
master:
url: jdbc:mysql://127.0.0.1:23306/wunan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true
url: jdbc:mysql://192.168.0.14:4417/sbd_robot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: youotech123#
password: Bonus@admin123!
# master:
# url: jdbc:mysql://127.0.0.1:3306/sbd_robot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: mroot
# password: bonus@admin123
# master:
# url: jdbc:mysql://127.0.0.1:23306/wunan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: root
# password: youotech123#
# 从库数据源
slave:
# 从数据源开关/默认关闭
@ -77,15 +77,20 @@ spring:
merge-sql: true
wall:
config:
multi-statement-allow: false
multi-statement-allow: true
#minio:
# endpoint: http://127.0.0.1:9001
# accessKey: root
# secretKey: bonus@admin123
# bucketName: robot
#minio:
# endpoint: http://10.138.55.114:9000
# accessKey: minioadmin
# secretKey: minioadmin
# bucketName: robot
minio:
endpoint: http://10.138.55.114:9000
accessKey: minioadmin
secretKey: minioadmin
endpoint: http://192.168.0.14:9090
accessKey: minio
secretKey: bonus@admin123
bucketName: robot