解决冲突

This commit is contained in:
2025-07-21 13:59:35 +08:00
2 changed files with 143 additions and 141 deletions

View File

@ -1,75 +1,76 @@
//package com.ho.datacollect.util;
//
//public class AnotherMqttConfigUtil {
//
// public static String[] commonTopic = new String[]{
// "+/device/27d83a2844ff5866",
// "+/device/77ba753718908d1a",
// "1/device/+"
// };
//
// /**
// * 获取登录验证的监听主题
// * @return
// */
// public static String[] getLoginRequestTopic(){
// String log = "/login/request";
// String[] str = new String[commonTopic.length];
// for (int i = 0; i < commonTopic.length; i++) {
// str[i] = commonTopic[i]+log;
// }
// return str;
// }
//
// /**
// * 读取文件请求的监听主题
// * @return
// */
// public static String[] getReadRequestTopic(){
// String log = "/read/response";
// String[] str = new String[commonTopic.length];
// for (int i = 0; i < commonTopic.length; i++) {
// str[i] = commonTopic[i]+log;
// }
// return str;
// }
//
// /**
// * 写文件响应的监听主题
// * @return
// */
// public static String[] getWriteRequestTopic(){
// String log = "/write/response";
// String[] str = new String[commonTopic.length];
// for (int i = 0; i < commonTopic.length; i++) {
// str[i] = commonTopic[i]+log;
// }
// return str;
// }
//
// /**
// * 获取数据上送监听主题
// * @return
// */
// public static String[] getReportPushTopic(){
// String log = "/report/push";
// String[] str = new String[commonTopic.length];
// for (int i = 0; i < commonTopic.length; i++) {
// str[i] = commonTopic[i]+log;
// }
// return str;
// }
//
// /**
// * 获取远程控制主题
// * @return
// */
// public static String[] getControlResponseTopic(){
// String log = "/control/response";
// String[] str = new String[commonTopic.length];
// for (int i = 0; i < commonTopic.length; i++) {
// str[i] = commonTopic[i]+log;
// }
// return str;
// }
//}
package com.ho.datacollect.util;
public class AnotherMqttConfigUtil {
public static String[] commonTopic = new String[]{
"+/device/27d83a2844ff5866",
"+/device/77ba753718908d1a",
"+/device/93372fa4f4c4ebcf",
"1/device/+"
};
/**
* 获取登录验证的监听主题
* @return
*/
public static String[] getLoginRequestTopic(){
String log = "/login/request";
String[] str = new String[commonTopic.length];
for (int i = 0; i < commonTopic.length; i++) {
str[i] = commonTopic[i]+log;
}
return str;
}
/**
* 读取文件请求的监听主题
* @return
*/
public static String[] getReadRequestTopic(){
String log = "/read/response";
String[] str = new String[commonTopic.length];
for (int i = 0; i < commonTopic.length; i++) {
str[i] = commonTopic[i]+log;
}
return str;
}
/**
* 写文件响应的监听主题
* @return
*/
public static String[] getWriteRequestTopic(){
String log = "/write/response";
String[] str = new String[commonTopic.length];
for (int i = 0; i < commonTopic.length; i++) {
str[i] = commonTopic[i]+log;
}
return str;
}
/**
* 获取数据上送监听主题
* @return
*/
public static String[] getReportPushTopic(){
String log = "/report/push";
String[] str = new String[commonTopic.length];
for (int i = 0; i < commonTopic.length; i++) {
str[i] = commonTopic[i]+log;
}
return str;
}
/**
* 获取远程控制主题
* @return
*/
public static String[] getControlResponseTopic(){
String log = "/control/response";
String[] str = new String[commonTopic.length];
for (int i = 0; i < commonTopic.length; i++) {
str[i] = commonTopic[i]+log;
}
return str;
}
}

View File

@ -1,66 +1,67 @@
//package com.ho.filecenter.util;
//
//import java.util.Arrays;
//import java.util.List;
//
//public class AnotherMqttConfigUtil {
//
// public static String[] commonTopic = new String[]{
// "+/device/27d83a2844ff5866",
// "+/device/77ba753718908d1a",
// "1/device/+"
// };
//
// /**
// * 获取文件请求监听主题
// * @return
// */
// public static String[] getFileRequestTopic(){
// String log = "/file/request";
// String[] str = new String[commonTopic.length];
// for (int i = 0; i < commonTopic.length; i++) {
// str[i] = commonTopic[i]+log;
// }
// return str;
// }
//
// /**
// * 读取文件响应监听主题
// * @return
// */
// public static String[] getFileResponseTopic(){
// String log = "/file/response";
// String[] str = new String[commonTopic.length];
// for (int i = 0; i < commonTopic.length; i++) {
// str[i] = commonTopic[i]+log;
// }
// return str;
// }
//
// public static String[] getCurveResponseTopic(){
// String log = "/curve/response";
// String[] str = new String[commonTopic.length];
// for (int i = 0; i < commonTopic.length; i++) {
// str[i] = commonTopic[i]+log;
// }
// return str;
// }
//
// public static String[] getDispatchResponseTopic(){
// String log = "/dispatch/response";
// String[] str = new String[commonTopic.length];
// for (int i = 0; i < commonTopic.length; i++) {
// str[i] = commonTopic[i]+log;
// }
// return str;
// }
//
// /**
// * 获取SN配置合集
// * @return
// */
// public static List<String> getSnList(){
// List<String> strings = Arrays.asList(commonTopic);
// return strings;
// }
//}
package com.ho.filecenter.util;
import java.util.Arrays;
import java.util.List;
public class AnotherMqttConfigUtil {
public static String[] commonTopic = new String[]{
"+/device/27d83a2844ff5866",
"+/device/77ba753718908d1a",
"+/device/93372fa4f4c4ebcf",
"1/device/+"
};
/**
* 获取文件请求监听主题
* @return
*/
public static String[] getFileRequestTopic(){
String log = "/file/request";
String[] str = new String[commonTopic.length];
for (int i = 0; i < commonTopic.length; i++) {
str[i] = commonTopic[i]+log;
}
return str;
}
/**
* 读取文件响应监听主题
* @return
*/
public static String[] getFileResponseTopic(){
String log = "/file/response";
String[] str = new String[commonTopic.length];
for (int i = 0; i < commonTopic.length; i++) {
str[i] = commonTopic[i]+log;
}
return str;
}
public static String[] getCurveResponseTopic(){
String log = "/curve/response";
String[] str = new String[commonTopic.length];
for (int i = 0; i < commonTopic.length; i++) {
str[i] = commonTopic[i]+log;
}
return str;
}
public static String[] getDispatchResponseTopic(){
String log = "/dispatch/response";
String[] str = new String[commonTopic.length];
for (int i = 0; i < commonTopic.length; i++) {
str[i] = commonTopic[i]+log;
}
return str;
}
/**
* 获取SN配置合集
* @return
*/
public static List<String> getSnList(){
List<String> strings = Arrays.asList(commonTopic);
return strings;
}
}