Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a906bf352d | ||
|
|
37f1772705 | ||
|
|
0a05503c78 | ||
|
|
a702602758 | ||
|
|
c01e5b634d | ||
|
|
6c2848cbf7 | ||
|
|
ae3c8e0d25 | ||
|
|
2ef0059395 | ||
|
|
d91a2d9fd5 | ||
|
|
a4bcd5e29e | ||
|
|
fe4612c801 | ||
|
|
58ade23b23 | ||
|
|
f1e46fca75 | ||
|
|
1e17fa1db4 | ||
|
|
7094114ea3 |
@@ -291,7 +291,10 @@ server.multi_endpoint false
|
|||||||
## 是否支持PC多端登陆,当server.multi_endpoint为true时,此开关无意义,当为false时,可以单独打开PC端多端登录。
|
## 是否支持PC多端登陆,当server.multi_endpoint为true时,此开关无意义,当为false时,可以单独打开PC端多端登录。
|
||||||
server.multi_pc_endpoint false
|
server.multi_pc_endpoint false
|
||||||
|
|
||||||
# 多平台连接状态通知(仅当multi_endpoint为false时有效),true时移动端可以收到pc或web端登录的通知。
|
## 是否支持PAD多端登陆,当server.multi_endpoint为true时,此开关无意义,当为false时,可以单独打开PAD端多端登录。
|
||||||
|
server.multi_pad_endpoint false
|
||||||
|
|
||||||
|
# 多平台连接状态通知(仅当multi_endpoint为false时有效),true时移动端可以收到pc或pad或web端登录的通知。
|
||||||
server.multi_platform_notification true
|
server.multi_platform_notification true
|
||||||
|
|
||||||
# 当pc或者web在线时,手机是否默认静音,默认为true。注意仅影响默认值,用户可以手动切换是否静音。
|
# 当pc或者web在线时,手机是否默认静音,默认为true。注意仅影响默认值,用户可以手动切换是否静音。
|
||||||
|
|||||||
+20
-51
@@ -5,7 +5,7 @@
|
|||||||
<relativePath>../</relativePath>
|
<relativePath>../</relativePath>
|
||||||
<artifactId>wildfirechat-parent</artifactId>
|
<artifactId>wildfirechat-parent</artifactId>
|
||||||
<groupId>cn.wildfirechat</groupId>
|
<groupId>cn.wildfirechat</groupId>
|
||||||
<version>1.2.2</version>
|
<version>1.2.4</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>moquette-broker</artifactId>
|
<artifactId>moquette-broker</artifactId>
|
||||||
@@ -37,14 +37,14 @@
|
|||||||
<!--用于与slf4j保持桥接-->
|
<!--用于与slf4j保持桥接-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
<artifactId>log4j-slf4j-impl</artifactId>
|
<artifactId>log4j-slf4j2-impl</artifactId>
|
||||||
<version>2.17.2</version>
|
<version>2.22.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- slf4j核心包-->
|
<!-- slf4j核心包-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
<version>1.7.25</version>
|
<version>2.0.12</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.lmax</groupId>
|
<groupId>com.lmax</groupId>
|
||||||
@@ -65,6 +65,18 @@
|
|||||||
<version>1.1.1</version>
|
<version>1.1.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>4.13.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.protobuf</groupId>
|
||||||
|
<artifactId>protobuf-java</artifactId>
|
||||||
|
<version>3.25.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.netty</groupId>
|
<groupId>io.netty</groupId>
|
||||||
<artifactId>netty-common</artifactId>
|
<artifactId>netty-common</artifactId>
|
||||||
@@ -129,37 +141,18 @@
|
|||||||
<version>3.11.5</version>
|
<version>3.11.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/com.xiaoleilu/hutool -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiaoleilu</groupId>
|
<groupId>cn.hutool</groupId>
|
||||||
<artifactId>hutool</artifactId>
|
<artifactId>hutool-all</artifactId>
|
||||||
<version>2.15.11</version>
|
<version>5.8.26</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Test dependencies -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<version>4.13.1</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/com.mchange/c3p0 -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.mchange</groupId>
|
<groupId>com.mchange</groupId>
|
||||||
<artifactId>c3p0</artifactId>
|
<artifactId>c3p0</artifactId>
|
||||||
<version>0.9.5.4</version>
|
<version>0.9.5.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- needs extra dependencies: objenesis & hamcrest -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.mockito</groupId>
|
|
||||||
<artifactId>mockito-core</artifactId>
|
|
||||||
<version>1.9.0</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.fusesource.mqtt-client</groupId>
|
<groupId>org.fusesource.mqtt-client</groupId>
|
||||||
<artifactId>mqtt-client</artifactId>
|
<artifactId>mqtt-client</artifactId>
|
||||||
@@ -172,28 +165,6 @@
|
|||||||
<version>1.2.2</version>
|
<version>1.2.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
|
||||||
<artifactId>websocket-client</artifactId>
|
|
||||||
<version>9.2.0.M1</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.assertj</groupId>
|
|
||||||
<artifactId>assertj-core</artifactId>
|
|
||||||
<!-- use 2.6.0 for Java 7 projects -->
|
|
||||||
<version>2.6.0</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.h2database</groupId>
|
|
||||||
<artifactId>h2</artifactId>
|
|
||||||
<version>1.4.191</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.qiniu</groupId>
|
<groupId>com.qiniu</groupId>
|
||||||
<artifactId>qiniu-java-sdk</artifactId>
|
<artifactId>qiniu-java-sdk</artifactId>
|
||||||
@@ -214,14 +185,12 @@
|
|||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.squareup.okhttp3</groupId>
|
<groupId>com.squareup.okhttp3</groupId>
|
||||||
<artifactId>okhttp</artifactId>
|
<artifactId>okhttp</artifactId>
|
||||||
<version>3.13.1</version>
|
<version>4.12.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.flywaydb/flyway-core -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.flywaydb</groupId>
|
<groupId>org.flywaydb</groupId>
|
||||||
<artifactId>flyway-core</artifactId>
|
<artifactId>flyway-core</artifactId>
|
||||||
|
|||||||
@@ -95,9 +95,15 @@ public class PushServer {
|
|||||||
pushMessage.deviceToken = session.getDeviceToken();
|
pushMessage.deviceToken = session.getDeviceToken();
|
||||||
pushMessage.unReceivedMsg = badge;
|
pushMessage.unReceivedMsg = badge;
|
||||||
pushMessage.userId = session.getUsername();
|
pushMessage.userId = session.getUsername();
|
||||||
if (session.getPlatform() == ProtoConstants.Platform.Platform_iOS || session.getPlatform() == ProtoConstants.Platform.Platform_Android) {
|
if (session.getPlatform() == ProtoConstants.Platform.Platform_iOS ||
|
||||||
|
session.getPlatform() == ProtoConstants.Platform.Platform_iPad ||
|
||||||
|
session.getPlatform() == ProtoConstants.Platform.Platform_Android ||
|
||||||
|
session.getPlatform() == ProtoConstants.Platform.Platform_APad ||
|
||||||
|
session.getPlatform() == ProtoConstants.Platform.Platform_Harmony ||
|
||||||
|
session.getPlatform() == ProtoConstants.Platform.Platform_HarmonyPad
|
||||||
|
) {
|
||||||
String url = androidPushServerUrl;
|
String url = androidPushServerUrl;
|
||||||
if (session.getPlatform() == ProtoConstants.Platform.Platform_iOS) {
|
if (session.getPlatform() == ProtoConstants.Platform.Platform_iOS || session.getPlatform() == ProtoConstants.Platform.Platform_iPad) {
|
||||||
url = iOSPushServerUrl;
|
url = iOSPushServerUrl;
|
||||||
pushMessage.voipDeviceToken = session.getVoipDeviceToken();
|
pushMessage.voipDeviceToken = session.getVoipDeviceToken();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
package com.xiaoleilu.loServer;
|
package com.xiaoleilu.loServer;
|
||||||
|
|
||||||
import com.xiaoleilu.hutool.log.Log;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.xiaoleilu.hutool.log.StaticLog;
|
|
||||||
import com.xiaoleilu.hutool.util.DateUtil;
|
|
||||||
import com.xiaoleilu.loServer.action.Action;
|
import com.xiaoleilu.loServer.action.Action;
|
||||||
import com.xiaoleilu.loServer.action.ClassUtil;
|
import com.xiaoleilu.loServer.action.ClassUtil;
|
||||||
import com.xiaoleilu.loServer.annotation.Route;
|
import com.xiaoleilu.loServer.annotation.Route;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.xiaoleilu.loServer;
|
package com.xiaoleilu.loServer;
|
||||||
|
|
||||||
import com.xiaoleilu.hutool.util.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.xiaoleilu.loServer.action.Action;
|
import com.xiaoleilu.loServer.action.Action;
|
||||||
import com.xiaoleilu.loServer.annotation.Route;
|
import com.xiaoleilu.loServer.annotation.Route;
|
||||||
import com.xiaoleilu.loServer.handler.AdminActionHandler;
|
import com.xiaoleilu.loServer.handler.AdminActionHandler;
|
||||||
|
|||||||
@@ -5,11 +5,9 @@ import java.nio.charset.Charset;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import com.xiaoleilu.hutool.lang.Singleton;
|
import cn.hutool.core.io.FileUtil;
|
||||||
import com.xiaoleilu.hutool.log.Log;
|
import cn.hutool.core.lang.Singleton;
|
||||||
import com.xiaoleilu.hutool.log.StaticLog;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.xiaoleilu.hutool.util.FileUtil;
|
|
||||||
import com.xiaoleilu.hutool.util.StrUtil;
|
|
||||||
import com.xiaoleilu.loServer.action.Action;
|
import com.xiaoleilu.loServer.action.Action;
|
||||||
import com.xiaoleilu.loServer.action.DefaultIndexAction;
|
import com.xiaoleilu.loServer.action.DefaultIndexAction;
|
||||||
import com.xiaoleilu.loServer.action.UnknownErrorAction;
|
import com.xiaoleilu.loServer.action.UnknownErrorAction;
|
||||||
@@ -189,7 +187,7 @@ public class ServerSetting {
|
|||||||
* @param filterClass Filter类
|
* @param filterClass Filter类
|
||||||
*/
|
*/
|
||||||
public static void setFilter(String path, Class<? extends Filter> filterClass) {
|
public static void setFilter(String path, Class<? extends Filter> filterClass) {
|
||||||
setFilter(path, (Filter)Singleton.get(filterClass));
|
setFilter(path, (Filter) Singleton.get(filterClass));
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------------------------- Filter end
|
//----------------------------------------------------------------------------------------------- Filter end
|
||||||
|
|
||||||
|
|||||||
@@ -8,13 +8,11 @@ import java.util.Date;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.io.FileUtil;
|
||||||
|
import cn.hutool.core.util.ReUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.hazelcast.core.HazelcastInstance;
|
import com.hazelcast.core.HazelcastInstance;
|
||||||
import com.xiaoleilu.hutool.log.Log;
|
|
||||||
import com.xiaoleilu.hutool.log.StaticLog;
|
|
||||||
import com.xiaoleilu.hutool.util.DateUtil;
|
|
||||||
import com.xiaoleilu.hutool.util.FileUtil;
|
|
||||||
import com.xiaoleilu.hutool.util.ReUtil;
|
|
||||||
import com.xiaoleilu.hutool.util.StrUtil;
|
|
||||||
import com.xiaoleilu.loServer.ServerSetting;
|
import com.xiaoleilu.loServer.ServerSetting;
|
||||||
import com.xiaoleilu.loServer.handler.Request;
|
import com.xiaoleilu.loServer.handler.Request;
|
||||||
import com.xiaoleilu.loServer.handler.Response;
|
import com.xiaoleilu.loServer.handler.Response;
|
||||||
@@ -24,6 +22,8 @@ import io.netty.handler.codec.http.HttpHeaderNames;
|
|||||||
import io.netty.handler.codec.http.HttpResponseStatus;
|
import io.netty.handler.codec.http.HttpResponseStatus;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import static cn.hutool.core.date.DatePattern.HTTP_DATETIME_PATTERN;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 默认的主页Action,当访问主页且没有定义主页Action时,调用此Action
|
* 默认的主页Action,当访问主页且没有定义主页Action时,调用此Action
|
||||||
*
|
*
|
||||||
@@ -96,7 +96,7 @@ public class FileAction extends Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static final Pattern INSECURE_URI = Pattern.compile(".*[<>&\"].*");
|
private static final Pattern INSECURE_URI = Pattern.compile(".*[<>&\"].*");
|
||||||
private static final SimpleDateFormat HTTP_DATE_FORMATER = new SimpleDateFormat(DateUtil.HTTP_DATETIME_PATTERN, Locale.US);
|
private static final SimpleDateFormat HTTP_DATE_FORMATER = new SimpleDateFormat(HTTP_DATETIME_PATTERN, Locale.US);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
package com.xiaoleilu.loServer.action;
|
package com.xiaoleilu.loServer.action;
|
||||||
|
|
||||||
import com.hazelcast.core.HazelcastInstance;
|
import com.hazelcast.core.HazelcastInstance;
|
||||||
import com.xiaoleilu.hutool.log.Log;
|
|
||||||
import com.xiaoleilu.hutool.log.StaticLog;
|
|
||||||
import com.xiaoleilu.hutool.util.StrUtil;
|
|
||||||
import com.xiaoleilu.loServer.handler.Request;
|
import com.xiaoleilu.loServer.handler.Request;
|
||||||
import com.xiaoleilu.loServer.handler.Response;
|
import com.xiaoleilu.loServer.handler.Response;
|
||||||
import io.moquette.spi.IMessagesStore;
|
import io.moquette.spi.IMessagesStore;
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ import java.io.PrintWriter;
|
|||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
|
|
||||||
import com.hazelcast.core.HazelcastInstance;
|
import com.hazelcast.core.HazelcastInstance;
|
||||||
import com.xiaoleilu.hutool.log.Log;
|
|
||||||
import com.xiaoleilu.hutool.log.StaticLog;
|
|
||||||
import com.xiaoleilu.hutool.util.StrUtil;
|
|
||||||
import com.xiaoleilu.loServer.handler.Request;
|
import com.xiaoleilu.loServer.handler.Request;
|
||||||
import com.xiaoleilu.loServer.handler.Response;
|
import com.xiaoleilu.loServer.handler.Response;
|
||||||
|
|
||||||
|
|||||||
@@ -48,10 +48,6 @@ public class CreateChatroomAction extends AdminAction {
|
|||||||
inputCreateChatroom.setChatroomId(messagesStore.getShortUUID());
|
inputCreateChatroom.setChatroomId(messagesStore.getShortUUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inputCreateChatroom.getPortrait() == null || inputCreateChatroom.getPortrait().length() == 0) {
|
|
||||||
inputCreateChatroom.setPortrait("https://avatars.io/gravatar/" + inputCreateChatroom.getChatroomId());
|
|
||||||
}
|
|
||||||
|
|
||||||
WFCMessage.ChatroomInfo info = inputCreateChatroom.toChatroomInfo();
|
WFCMessage.ChatroomInfo info = inputCreateChatroom.toChatroomInfo();
|
||||||
messagesStore.createChatroom(inputCreateChatroom.getChatroomId(), info);
|
messagesStore.createChatroom(inputCreateChatroom.getChatroomId(), info);
|
||||||
setResponseContent(RestResult.ok(new OutputCreateChatroom(inputCreateChatroom.getChatroomId())), response);
|
setResponseContent(RestResult.ok(new OutputCreateChatroom(inputCreateChatroom.getChatroomId())), response);
|
||||||
|
|||||||
@@ -45,23 +45,13 @@ public class CreateRobotAction extends AdminAction {
|
|||||||
if (inputCreateRobot != null
|
if (inputCreateRobot != null
|
||||||
&& !StringUtil.isNullOrEmpty(inputCreateRobot.getName())) {
|
&& !StringUtil.isNullOrEmpty(inputCreateRobot.getName())) {
|
||||||
|
|
||||||
if(StringUtil.isNullOrEmpty(inputCreateRobot.getPassword())) {
|
|
||||||
inputCreateRobot.setPassword(UUIDGenerator.getUUID());
|
|
||||||
}
|
|
||||||
|
|
||||||
if(StringUtil.isNullOrEmpty(inputCreateRobot.getUserId())) {
|
if(StringUtil.isNullOrEmpty(inputCreateRobot.getUserId())) {
|
||||||
inputCreateRobot.setUserId(messagesStore.getShortUUID());
|
inputCreateRobot.setUserId(messagesStore.getShortUUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inputCreateRobot.getPortrait() == null || inputCreateRobot.getPortrait().length() == 0) {
|
|
||||||
inputCreateRobot.setPortrait("https://avatars.io/gravatar/" + inputCreateRobot.getUserId());
|
|
||||||
}
|
|
||||||
|
|
||||||
WFCMessage.User newUser = inputCreateRobot.toUser();
|
WFCMessage.User newUser = inputCreateRobot.toUser();
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
messagesStore.addUserInfo(newUser, inputCreateRobot.getPassword());
|
messagesStore.addUserInfo(newUser);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Utility.printExecption(LOG, e, IMExceptionEvent.EventType.ADMIN_API_Exception);
|
Utility.printExecption(LOG, e, IMExceptionEvent.EventType.ADMIN_API_Exception);
|
||||||
|
|||||||
@@ -47,10 +47,6 @@ public class CreateUserAction extends AdminAction {
|
|||||||
&& !StringUtil.isNullOrEmpty(inputCreateUser.getName())
|
&& !StringUtil.isNullOrEmpty(inputCreateUser.getName())
|
||||||
&& (inputCreateUser.getType() == ProtoConstants.UserType.UserType_Normal || inputCreateUser.getType() == ProtoConstants.UserType.UserType_Admin || inputCreateUser.getType() == ProtoConstants.UserType.UserType_Super_Admin)) {
|
&& (inputCreateUser.getType() == ProtoConstants.UserType.UserType_Normal || inputCreateUser.getType() == ProtoConstants.UserType.UserType_Admin || inputCreateUser.getType() == ProtoConstants.UserType.UserType_Super_Admin)) {
|
||||||
|
|
||||||
if(StringUtil.isNullOrEmpty(inputCreateUser.getPassword())) {
|
|
||||||
inputCreateUser.setPassword(UUIDGenerator.getUUID());
|
|
||||||
}
|
|
||||||
|
|
||||||
if(StringUtil.isNullOrEmpty(inputCreateUser.getUserId())) {
|
if(StringUtil.isNullOrEmpty(inputCreateUser.getUserId())) {
|
||||||
inputCreateUser.setUserId(messagesStore.getShortUUID());
|
inputCreateUser.setUserId(messagesStore.getShortUUID());
|
||||||
}
|
}
|
||||||
@@ -85,7 +81,7 @@ public class CreateUserAction extends AdminAction {
|
|||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
messagesStore.addUserInfo(newUserBuilder.build(), inputCreateUser.getPassword());
|
messagesStore.addUserInfo(newUserBuilder.build());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Utility.printExecption(LOG, e, IMExceptionEvent.EventType.ADMIN_API_Exception);
|
Utility.printExecption(LOG, e, IMExceptionEvent.EventType.ADMIN_API_Exception);
|
||||||
|
|||||||
@@ -1,31 +1,32 @@
|
|||||||
package com.xiaoleilu.loServer.exception;
|
package com.xiaoleilu.loServer.exception;
|
||||||
|
|
||||||
import com.xiaoleilu.hutool.util.StrUtil;
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
/**
|
|
||||||
* 设置异常
|
/**
|
||||||
* @author xiaoleilu
|
* 设置异常
|
||||||
*/
|
* @author xiaoleilu
|
||||||
public class ServerSettingException extends RuntimeException{
|
*/
|
||||||
private static final long serialVersionUID = -4134588858314744501L;
|
public class ServerSettingException extends RuntimeException{
|
||||||
|
private static final long serialVersionUID = -4134588858314744501L;
|
||||||
public ServerSettingException(Throwable e) {
|
|
||||||
super(e);
|
public ServerSettingException(Throwable e) {
|
||||||
}
|
super(e);
|
||||||
|
}
|
||||||
public ServerSettingException(String message) {
|
|
||||||
super(message);
|
public ServerSettingException(String message) {
|
||||||
}
|
super(message);
|
||||||
|
}
|
||||||
public ServerSettingException(String messageTemplate, Object... params) {
|
|
||||||
super(StrUtil.format(messageTemplate, params));
|
public ServerSettingException(String messageTemplate, Object... params) {
|
||||||
}
|
super(StrUtil.format(messageTemplate, params));
|
||||||
|
}
|
||||||
public ServerSettingException(String message, Throwable throwable) {
|
|
||||||
super(message, throwable);
|
public ServerSettingException(String message, Throwable throwable) {
|
||||||
}
|
super(message, throwable);
|
||||||
|
}
|
||||||
public ServerSettingException(Throwable throwable, String messageTemplate, Object... params) {
|
|
||||||
super(StrUtil.format(messageTemplate, params), throwable);
|
public ServerSettingException(Throwable throwable, String messageTemplate, Object... params) {
|
||||||
}
|
super(StrUtil.format(messageTemplate, params), throwable);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.xiaoleilu.loServer.handler;
|
package com.xiaoleilu.loServer.handler;
|
||||||
|
|
||||||
|
import cn.hutool.core.lang.Singleton;
|
||||||
import cn.wildfirechat.common.IMExceptionEvent;
|
import cn.wildfirechat.common.IMExceptionEvent;
|
||||||
import com.xiaoleilu.hutool.lang.Singleton;
|
|
||||||
import com.xiaoleilu.loServer.ServerSetting;
|
import com.xiaoleilu.loServer.ServerSetting;
|
||||||
import com.xiaoleilu.loServer.action.Action;
|
import com.xiaoleilu.loServer.action.Action;
|
||||||
import com.xiaoleilu.loServer.action.UnknownErrorAction;
|
import com.xiaoleilu.loServer.action.UnknownErrorAction;
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
package com.xiaoleilu.loServer.handler;
|
package com.xiaoleilu.loServer.handler;
|
||||||
|
|
||||||
import com.xiaoleilu.hutool.lang.Singleton;
|
|
||||||
import com.xiaoleilu.loServer.ServerSetting;
|
import com.xiaoleilu.loServer.ServerSetting;
|
||||||
import com.xiaoleilu.loServer.action.Action;
|
import com.xiaoleilu.loServer.action.Action;
|
||||||
import com.xiaoleilu.loServer.action.FileAction;
|
import com.xiaoleilu.loServer.action.FileAction;
|
||||||
|
|||||||
+27
-28
@@ -1,28 +1,27 @@
|
|||||||
package com.xiaoleilu.loServer.handler;
|
package com.xiaoleilu.loServer.handler;
|
||||||
|
|
||||||
import com.xiaoleilu.hutool.log.StaticLog;
|
import cn.hutool.log.StaticLog;
|
||||||
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelPromise;
|
||||||
import io.netty.channel.ChannelPromise;
|
import io.netty.channel.FileRegion;
|
||||||
import io.netty.channel.FileRegion;
|
import io.netty.handler.codec.http.DefaultHttpResponse;
|
||||||
import io.netty.handler.codec.http.DefaultHttpResponse;
|
import io.netty.handler.codec.http.HttpContentCompressor;
|
||||||
import io.netty.handler.codec.http.HttpContentCompressor;
|
|
||||||
|
/**
|
||||||
/**
|
* 解决大文件传输与Gzip压缩冲突问题
|
||||||
* 解决大文件传输与Gzip压缩冲突问题
|
* @author Looly
|
||||||
* @author Looly
|
*
|
||||||
*
|
*/
|
||||||
*/
|
public class HttpChunkContentCompressor extends HttpContentCompressor {
|
||||||
public class HttpChunkContentCompressor extends HttpContentCompressor {
|
@Override
|
||||||
@Override
|
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
|
||||||
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
|
StaticLog.debug("Write object [{}]", msg);
|
||||||
StaticLog.debug("Write object [{}]", msg);
|
|
||||||
|
if (msg instanceof FileRegion || msg instanceof DefaultHttpResponse) {
|
||||||
if (msg instanceof FileRegion || msg instanceof DefaultHttpResponse) {
|
//文件传输不经过Gzip压缩
|
||||||
//文件传输不经过Gzip压缩
|
ctx.write(msg, promise);
|
||||||
ctx.write(msg, promise);
|
}else{
|
||||||
}else{
|
super.write(ctx, msg, promise);
|
||||||
super.write(ctx, msg, promise);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.xiaoleilu.loServer.handler;
|
package com.xiaoleilu.loServer.handler;
|
||||||
|
|
||||||
import io.netty.util.internal.StringUtil;
|
import io.netty.util.internal.StringUtil;
|
||||||
import com.xiaoleilu.hutool.util.FileUtil;
|
|
||||||
import io.netty.buffer.Unpooled;
|
import io.netty.buffer.Unpooled;
|
||||||
import io.netty.channel.ChannelFuture;
|
import io.netty.channel.ChannelFuture;
|
||||||
import io.netty.channel.ChannelFutureListener;
|
import io.netty.channel.ChannelFutureListener;
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
package com.xiaoleilu.loServer.handler;
|
package com.xiaoleilu.loServer.handler;
|
||||||
|
|
||||||
import com.xiaoleilu.hutool.lang.Singleton;
|
|
||||||
import com.xiaoleilu.loServer.ServerSetting;
|
import com.xiaoleilu.loServer.ServerSetting;
|
||||||
import com.xiaoleilu.loServer.action.Action;
|
import com.xiaoleilu.loServer.action.Action;
|
||||||
import com.xiaoleilu.loServer.action.FileAction;
|
import com.xiaoleilu.loServer.action.FileAction;
|
||||||
|
|||||||
@@ -10,15 +10,12 @@ import java.util.Map;
|
|||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import com.xiaoleilu.hutool.http.HttpUtil;
|
import cn.hutool.core.convert.Convert;
|
||||||
import com.xiaoleilu.hutool.lang.Conver;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.xiaoleilu.hutool.log.Log;
|
import cn.hutool.core.net.NetUtil;
|
||||||
import com.xiaoleilu.hutool.log.StaticLog;
|
import cn.hutool.core.util.CharsetUtil;
|
||||||
import com.xiaoleilu.hutool.util.CharsetUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.xiaoleilu.hutool.util.DateUtil;
|
import cn.hutool.core.util.URLUtil;
|
||||||
import com.xiaoleilu.hutool.util.StrUtil;
|
|
||||||
import com.xiaoleilu.hutool.util.URLUtil;
|
|
||||||
|
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.handler.codec.http.FullHttpRequest;
|
import io.netty.handler.codec.http.FullHttpRequest;
|
||||||
import io.netty.handler.codec.http.HttpHeaderNames;
|
import io.netty.handler.codec.http.HttpHeaderNames;
|
||||||
@@ -261,7 +258,7 @@ public class Request {
|
|||||||
* @return 获得Integer类型请求参数
|
* @return 获得Integer类型请求参数
|
||||||
*/
|
*/
|
||||||
public Integer getIntParam(String name, Integer defaultValue) {
|
public Integer getIntParam(String name, Integer defaultValue) {
|
||||||
return Conver.toInt(getParam(name), defaultValue);
|
return Convert.toInt(getParam(name), defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -270,7 +267,7 @@ public class Request {
|
|||||||
* @return 获得long类型请求参数
|
* @return 获得long类型请求参数
|
||||||
*/
|
*/
|
||||||
public Long getLongParam(String name, Long defaultValue) {
|
public Long getLongParam(String name, Long defaultValue) {
|
||||||
return Conver.toLong(getParam(name), defaultValue);
|
return Convert.toLong(getParam(name), defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -279,7 +276,7 @@ public class Request {
|
|||||||
* @return 获得Double类型请求参数
|
* @return 获得Double类型请求参数
|
||||||
*/
|
*/
|
||||||
public Double getDoubleParam(String name, Double defaultValue) {
|
public Double getDoubleParam(String name, Double defaultValue) {
|
||||||
return Conver.toDouble(getParam(name), defaultValue);
|
return Convert.toDouble(getParam(name), defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -288,7 +285,7 @@ public class Request {
|
|||||||
* @return 获得Float类型请求参数
|
* @return 获得Float类型请求参数
|
||||||
*/
|
*/
|
||||||
public Float getFloatParam(String name, Float defaultValue) {
|
public Float getFloatParam(String name, Float defaultValue) {
|
||||||
return Conver.toFloat(getParam(name), defaultValue);
|
return Convert.toFloat(getParam(name), defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -297,7 +294,7 @@ public class Request {
|
|||||||
* @return 获得Boolean类型请求参数
|
* @return 获得Boolean类型请求参数
|
||||||
*/
|
*/
|
||||||
public Boolean getBoolParam(String name, Boolean defaultValue) {
|
public Boolean getBoolParam(String name, Boolean defaultValue) {
|
||||||
return Conver.toBool(getParam(name), defaultValue);
|
return Convert.toBool(getParam(name), defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -477,7 +474,7 @@ public class Request {
|
|||||||
protected void putIp(ChannelHandlerContext ctx) {
|
protected void putIp(ChannelHandlerContext ctx) {
|
||||||
String ip = getHeader("X-Forwarded-For");
|
String ip = getHeader("X-Forwarded-For");
|
||||||
if (StrUtil.isNotBlank(ip)) {
|
if (StrUtil.isNotBlank(ip)) {
|
||||||
ip = HttpUtil.getMultistageReverseProxyIp(ip);
|
ip = NetUtil.getMultistageReverseProxyIp(ip);
|
||||||
} else {
|
} else {
|
||||||
final InetSocketAddress insocket = (InetSocketAddress) ctx.channel().remoteAddress();
|
final InetSocketAddress insocket = (InetSocketAddress) ctx.channel().remoteAddress();
|
||||||
ip = insocket.getAddress().getHostAddress();
|
ip = insocket.getAddress().getHostAddress();
|
||||||
|
|||||||
@@ -13,12 +13,9 @@ import java.util.Map.Entry;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import com.xiaoleilu.hutool.http.HttpUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.xiaoleilu.hutool.log.Log;
|
import cn.hutool.core.util.CharsetUtil;
|
||||||
import com.xiaoleilu.hutool.log.StaticLog;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.xiaoleilu.hutool.util.CharsetUtil;
|
|
||||||
import com.xiaoleilu.hutool.util.DateUtil;
|
|
||||||
import com.xiaoleilu.hutool.util.StrUtil;
|
|
||||||
import com.xiaoleilu.loServer.ServerSetting;
|
import com.xiaoleilu.loServer.ServerSetting;
|
||||||
import com.xiaoleilu.loServer.listener.FileProgressiveFutureListener;
|
import com.xiaoleilu.loServer.listener.FileProgressiveFutureListener;
|
||||||
|
|
||||||
@@ -44,6 +41,8 @@ import io.netty.handler.codec.http.cookie.ServerCookieEncoder;
|
|||||||
import org.apache.tika.Tika;
|
import org.apache.tika.Tika;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import static cn.hutool.core.date.DatePattern.HTTP_DATETIME_PATTERN;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 响应对象
|
* 响应对象
|
||||||
*
|
*
|
||||||
@@ -332,7 +331,7 @@ public class Response {
|
|||||||
* @param httpCacheSeconds 缓存时间,单位秒
|
* @param httpCacheSeconds 缓存时间,单位秒
|
||||||
*/
|
*/
|
||||||
public void setDateAndCache(long lastModify, int httpCacheSeconds) {
|
public void setDateAndCache(long lastModify, int httpCacheSeconds) {
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat(DateUtil.HTTP_DATETIME_PATTERN, Locale.US);
|
SimpleDateFormat formatter = new SimpleDateFormat(HTTP_DATETIME_PATTERN, Locale.US);
|
||||||
formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
|
formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||||
|
|
||||||
// Date header
|
// Date header
|
||||||
|
|||||||
+1
-4
@@ -2,10 +2,7 @@ package com.xiaoleilu.loServer.listener;
|
|||||||
|
|
||||||
import java.io.RandomAccessFile;
|
import java.io.RandomAccessFile;
|
||||||
|
|
||||||
import com.xiaoleilu.hutool.io.IoUtil;
|
import cn.hutool.core.io.IoUtil;
|
||||||
import com.xiaoleilu.hutool.log.Log;
|
|
||||||
import com.xiaoleilu.hutool.log.StaticLog;
|
|
||||||
|
|
||||||
import io.netty.channel.ChannelProgressiveFuture;
|
import io.netty.channel.ChannelProgressiveFuture;
|
||||||
import io.netty.channel.ChannelProgressiveFutureListener;
|
import io.netty.channel.ChannelProgressiveFutureListener;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ public final class BrokerConstants {
|
|||||||
|
|
||||||
public static final String SERVER_MULTI_ENDPOINT = "server.multi_endpoint";
|
public static final String SERVER_MULTI_ENDPOINT = "server.multi_endpoint";
|
||||||
public static final String SERVER_MULTI_PC_ENDPOINT = "server.multi_pc_endpoint";
|
public static final String SERVER_MULTI_PC_ENDPOINT = "server.multi_pc_endpoint";
|
||||||
|
public static final String SERVER_MULTI_PAD_ENDPOINT = "server.multi_pad_endpoint";
|
||||||
public static final String SERVER_MULTI_PLATFROM_NOTIFICATION = "server.multi_platform_notification";
|
public static final String SERVER_MULTI_PLATFROM_NOTIFICATION = "server.multi_platform_notification";
|
||||||
public static final String SERVER_MOBILE_DEFAULT_SILENT_WHEN_PC_ONLINE = "server.mobile_default_silent_when_pc_online";
|
public static final String SERVER_MOBILE_DEFAULT_SILENT_WHEN_PC_ONLINE = "server.mobile_default_silent_when_pc_online";
|
||||||
public static final String SERVER_CLIENT_SUPPORT_KICKOFF_EVENT = "server.client_support_kickoff_event";
|
public static final String SERVER_CLIENT_SUPPORT_KICKOFF_EVENT = "server.client_support_kickoff_event";
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ package io.moquette.imhandler;
|
|||||||
|
|
||||||
import cn.wildfirechat.proto.ProtoConstants;
|
import cn.wildfirechat.proto.ProtoConstants;
|
||||||
import cn.wildfirechat.proto.WFCMessage;
|
import cn.wildfirechat.proto.WFCMessage;
|
||||||
import com.xiaoleilu.hutool.system.UserInfo;
|
|
||||||
import io.moquette.persistence.MemorySessionStore;
|
import io.moquette.persistence.MemorySessionStore;
|
||||||
import io.moquette.spi.impl.Qos1PublishHandler;
|
import io.moquette.spi.impl.Qos1PublishHandler;
|
||||||
import io.moquette.spi.impl.security.TokenAuthenticator;
|
import io.moquette.spi.impl.security.TokenAuthenticator;
|
||||||
|
|||||||
@@ -1798,10 +1798,12 @@ public class DatabaseStore {
|
|||||||
try {
|
try {
|
||||||
connection = DBUtil.getConnection();
|
connection = DBUtil.getConnection();
|
||||||
String sql;
|
String sql;
|
||||||
if (platform == ProtoConstants.Platform.Platform_Windows || platform == ProtoConstants.Platform.Platform_OSX || platform == ProtoConstants.Platform.Platform_LINUX) {
|
if (platform == ProtoConstants.Platform.Platform_Windows || platform == ProtoConstants.Platform.Platform_OSX || platform == ProtoConstants.Platform.Platform_LINUX || platform == ProtoConstants.Platform.Platform_HarmonyPC) {
|
||||||
|
sql = "update t_user_session set `_deleted` = ?, `_token` = ?, `_voip_token` = ?, `_dt` = ? where `_uid`=? and (`_platform` = ? or `_platform` = ? or `_platform` = ? or `_platform` = ?) and `_cid` <> ? and `_deleted` = 0";
|
||||||
|
} else if(platform == ProtoConstants.Platform.Platform_iOS || platform == ProtoConstants.Platform.Platform_Android || platform == ProtoConstants.Platform.Platform_Harmony) {
|
||||||
|
sql = "update t_user_session set `_deleted` = ?, `_token` = ?, `_voip_token` = ?, `_dt` = ? where `_uid`=? and (`_platform` = ? or `_platform` = ? or `_platform` = ?) and `_cid` <> ? and `_deleted` = 0";
|
||||||
|
} else if(platform == ProtoConstants.Platform.Platform_iPad || platform == ProtoConstants.Platform.Platform_APad || platform == ProtoConstants.Platform.Platform_HarmonyPad) {
|
||||||
sql = "update t_user_session set `_deleted` = ?, `_token` = ?, `_voip_token` = ?, `_dt` = ? where `_uid`=? and (`_platform` = ? or `_platform` = ? or `_platform` = ?) and `_cid` <> ? and `_deleted` = 0";
|
sql = "update t_user_session set `_deleted` = ?, `_token` = ?, `_voip_token` = ?, `_dt` = ? where `_uid`=? and (`_platform` = ? or `_platform` = ? or `_platform` = ?) and `_cid` <> ? and `_deleted` = 0";
|
||||||
} else if(platform == ProtoConstants.Platform.Platform_iOS || platform == ProtoConstants.Platform.Platform_Android) {
|
|
||||||
sql = "update t_user_session set `_deleted` = ?, `_token` = ?, `_voip_token` = ?, `_dt` = ? where `_uid`=? and (`_platform` = ? or `_platform` = ?) and `_cid` <> ? and `_deleted` = 0";
|
|
||||||
} else {
|
} else {
|
||||||
sql = "update t_user_session set `_deleted` = ?, `_token` = ?, `_voip_token` = ?, `_dt` = ? where `_uid`=? and `_platform` = ? and `_cid` <> ? and `_deleted` = 0";
|
sql = "update t_user_session set `_deleted` = ?, `_token` = ?, `_voip_token` = ?, `_dt` = ? where `_uid`=? and `_platform` = ? and `_cid` <> ? and `_deleted` = 0";
|
||||||
}
|
}
|
||||||
@@ -1816,13 +1818,19 @@ public class DatabaseStore {
|
|||||||
|
|
||||||
statement.setString(index++, uid);
|
statement.setString(index++, uid);
|
||||||
|
|
||||||
if (platform == ProtoConstants.Platform.Platform_Windows || platform == ProtoConstants.Platform.Platform_OSX || platform == ProtoConstants.Platform.Platform_LINUX) {
|
if (platform == ProtoConstants.Platform.Platform_Windows || platform == ProtoConstants.Platform.Platform_OSX || platform == ProtoConstants.Platform.Platform_LINUX || platform == ProtoConstants.Platform.Platform_HarmonyPC) {
|
||||||
statement.setInt(index++, ProtoConstants.Platform.Platform_Windows);
|
statement.setInt(index++, ProtoConstants.Platform.Platform_Windows);
|
||||||
statement.setInt(index++, ProtoConstants.Platform.Platform_OSX);
|
statement.setInt(index++, ProtoConstants.Platform.Platform_OSX);
|
||||||
statement.setInt(index++, ProtoConstants.Platform.Platform_LINUX);
|
statement.setInt(index++, ProtoConstants.Platform.Platform_LINUX);
|
||||||
} else if(platform == ProtoConstants.Platform.Platform_iOS || platform == ProtoConstants.Platform.Platform_Android) {
|
statement.setInt(index++, ProtoConstants.Platform.Platform_HarmonyPC);
|
||||||
|
} else if(platform == ProtoConstants.Platform.Platform_iOS || platform == ProtoConstants.Platform.Platform_Android || platform == ProtoConstants.Platform.Platform_Harmony) {
|
||||||
statement.setInt(index++, ProtoConstants.Platform.Platform_iOS);
|
statement.setInt(index++, ProtoConstants.Platform.Platform_iOS);
|
||||||
statement.setInt(index++, ProtoConstants.Platform.Platform_Android);
|
statement.setInt(index++, ProtoConstants.Platform.Platform_Android);
|
||||||
|
statement.setInt(index++, ProtoConstants.Platform.Platform_Harmony);
|
||||||
|
} else if(platform == ProtoConstants.Platform.Platform_iPad || platform == ProtoConstants.Platform.Platform_APad || platform == ProtoConstants.Platform.Platform_HarmonyPad) {
|
||||||
|
statement.setInt(index++, ProtoConstants.Platform.Platform_iPad);
|
||||||
|
statement.setInt(index++, ProtoConstants.Platform.Platform_APad);
|
||||||
|
statement.setInt(index++, ProtoConstants.Platform.Platform_HarmonyPad);
|
||||||
} else {
|
} else {
|
||||||
statement.setInt(index++, platform);
|
statement.setInt(index++, platform);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import com.google.gson.Gson;
|
|||||||
import com.google.protobuf.ByteString;
|
import com.google.protobuf.ByteString;
|
||||||
import com.hazelcast.core.*;
|
import com.hazelcast.core.*;
|
||||||
import com.hazelcast.util.StringUtil;
|
import com.hazelcast.util.StringUtil;
|
||||||
import com.xiaoleilu.hutool.system.UserInfo;
|
|
||||||
import com.xiaoleilu.loServer.RestResult;
|
import com.xiaoleilu.loServer.RestResult;
|
||||||
import com.xiaoleilu.loServer.action.admin.AdminAction;
|
import com.xiaoleilu.loServer.action.admin.AdminAction;
|
||||||
import com.xiaoleilu.loServer.model.FriendData;
|
import com.xiaoleilu.loServer.model.FriendData;
|
||||||
@@ -2764,6 +2763,7 @@ public class MemoryMessagesStore implements IMessagesStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String pcValue = null;
|
String pcValue = null;
|
||||||
|
String padValue = null;
|
||||||
for (MemorySessionStore.Session s : m_Server.getStore().sessionsStore().sessionForUser(session.username)) {
|
for (MemorySessionStore.Session s : m_Server.getStore().sessionsStore().sessionForUser(session.username)) {
|
||||||
if (s.getDeleted() != 0 || !m_Server.getConnectionsManager().isConnected(s.getClientID())) {
|
if (s.getDeleted() != 0 || !m_Server.getConnectionsManager().isConnected(s.getClientID())) {
|
||||||
continue;
|
continue;
|
||||||
@@ -2773,8 +2773,14 @@ public class MemoryMessagesStore implements IMessagesStore {
|
|||||||
case Platform_LINUX:
|
case Platform_LINUX:
|
||||||
case Platform_Windows:
|
case Platform_Windows:
|
||||||
case Platform_OSX:
|
case Platform_OSX:
|
||||||
|
case Platform_HarmonyPC:
|
||||||
pcValue = System.currentTimeMillis() + "|" + s.getPlatform() + "|" + s.getClientID() + "|" + s.getPhoneName();
|
pcValue = System.currentTimeMillis() + "|" + s.getPlatform() + "|" + s.getClientID() + "|" + s.getPhoneName();
|
||||||
break;
|
break;
|
||||||
|
case Platform_iPad:
|
||||||
|
case Platform_APad:
|
||||||
|
case Platform_HarmonyPad:
|
||||||
|
padValue = System.currentTimeMillis() + "|" + s.getPlatform() + "|" + s.getClientID() + "|" + s.getPhoneName();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -2784,6 +2790,11 @@ public class MemoryMessagesStore implements IMessagesStore {
|
|||||||
if (!isOnlineValueEqual(pcentry, pcValue)) {
|
if (!isOnlineValueEqual(pcentry, pcValue)) {
|
||||||
updateUserSettings(session.username, WFCMessage.ModifyUserSettingReq.newBuilder().setScope(kUserSettingPCOnline).setKey("PC").setValue(pcValue==null?"":pcValue).build(), session.clientID);
|
updateUserSettings(session.username, WFCMessage.ModifyUserSettingReq.newBuilder().setScope(kUserSettingPCOnline).setKey("PC").setValue(pcValue==null?"":pcValue).build(), session.clientID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WFCMessage.UserSettingEntry padentry = getUserSetting(session.getUsername(), kUserSettingPCOnline, "Pad");
|
||||||
|
if (!isOnlineValueEqual(padentry, padValue)) {
|
||||||
|
updateUserSettings(session.username, WFCMessage.ModifyUserSettingReq.newBuilder().setScope(kUserSettingPCOnline).setKey("Pad").setValue(padValue==null?"":padValue).build(), session.clientID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -2882,7 +2893,7 @@ public class MemoryMessagesStore implements IMessagesStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addUserInfo(WFCMessage.User user, String password) throws Exception {
|
public void addUserInfo(WFCMessage.User user) throws Exception {
|
||||||
HazelcastInstance hzInstance = m_Server.getHazelcastInstance();
|
HazelcastInstance hzInstance = m_Server.getHazelcastInstance();
|
||||||
IMap<String, WFCMessage.User> mUserMap = hzInstance.getMap(USERS);
|
IMap<String, WFCMessage.User> mUserMap = hzInstance.getMap(USERS);
|
||||||
if (databaseStore.isUidAndNameConflict(user.getUid(), user.getName())) {
|
if (databaseStore.isUidAndNameConflict(user.getUid(), user.getName())) {
|
||||||
@@ -2890,7 +2901,6 @@ public class MemoryMessagesStore implements IMessagesStore {
|
|||||||
}
|
}
|
||||||
databaseStore.updateUser(user);
|
databaseStore.updateUser(user);
|
||||||
mUserMap.put(user.getUid(), user);
|
mUserMap.put(user.getUid(), user);
|
||||||
databaseStore.updateUserPassword(user.getUid(), password);
|
|
||||||
|
|
||||||
callbackUserInfoEvent(user);
|
callbackUserInfoEvent(user);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ public class MemorySessionStore implements ISessionsStore {
|
|||||||
|
|
||||||
private boolean supportMultiEndpoint = false;
|
private boolean supportMultiEndpoint = false;
|
||||||
private boolean supportMultiPCEndpoint = false;
|
private boolean supportMultiPCEndpoint = false;
|
||||||
|
private boolean supportMultiPadEndpoint = false;
|
||||||
private boolean clientSupportKickoff = false;
|
private boolean clientSupportKickoff = false;
|
||||||
|
|
||||||
public static class Session implements Comparable<Session>{
|
public static class Session implements Comparable<Session>{
|
||||||
@@ -292,6 +293,10 @@ public class MemorySessionStore implements ISessionsStore {
|
|||||||
supportMultiPCEndpoint = Boolean.parseBoolean(server.getConfig().getProperty(BrokerConstants.SERVER_MULTI_PC_ENDPOINT, "false"));
|
supportMultiPCEndpoint = Boolean.parseBoolean(server.getConfig().getProperty(BrokerConstants.SERVER_MULTI_PC_ENDPOINT, "false"));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
supportMultiPadEndpoint = Boolean.parseBoolean(server.getConfig().getProperty(BrokerConstants.SERVER_MULTI_PAD_ENDPOINT, "false"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
clientSupportKickoff = Boolean.parseBoolean(server.getConfig().getProperty(BrokerConstants.SERVER_CLIENT_SUPPORT_KICKOFF_EVENT, "false"));
|
clientSupportKickoff = Boolean.parseBoolean(server.getConfig().getProperty(BrokerConstants.SERVER_CLIENT_SUPPORT_KICKOFF_EVENT, "false"));
|
||||||
@@ -396,6 +401,10 @@ public class MemorySessionStore implements ISessionsStore {
|
|||||||
&& !(platform == ProtoConstants.Platform.Platform_Windows && supportMultiPCEndpoint)
|
&& !(platform == ProtoConstants.Platform.Platform_Windows && supportMultiPCEndpoint)
|
||||||
&& !(platform == ProtoConstants.Platform.Platform_LINUX && supportMultiPCEndpoint)
|
&& !(platform == ProtoConstants.Platform.Platform_LINUX && supportMultiPCEndpoint)
|
||||||
&& !(platform == ProtoConstants.Platform.Platform_OSX && supportMultiPCEndpoint)
|
&& !(platform == ProtoConstants.Platform.Platform_OSX && supportMultiPCEndpoint)
|
||||||
|
&& !(platform == ProtoConstants.Platform.Platform_HarmonyPC && supportMultiPCEndpoint)
|
||||||
|
&& !(platform == ProtoConstants.Platform.Platform_iPad && supportMultiPadEndpoint)
|
||||||
|
&& !(platform == ProtoConstants.Platform.Platform_APad && supportMultiPadEndpoint)
|
||||||
|
&& !(platform == ProtoConstants.Platform.Platform_HarmonyPad && supportMultiPadEndpoint)
|
||||||
) {
|
) {
|
||||||
databaseStore.clearMultiEndpoint(username, clientID, platform);
|
databaseStore.clearMultiEndpoint(username, clientID, platform);
|
||||||
if (userSessions.get(username) != null) {
|
if (userSessions.get(username) != null) {
|
||||||
@@ -410,15 +419,19 @@ public class MemorySessionStore implements ISessionsStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean remove = false;
|
boolean remove = false;
|
||||||
if (platform == ProtoConstants.Platform.Platform_Android || platform == ProtoConstants.Platform.Platform_iOS) {
|
if (platform == ProtoConstants.Platform.Platform_Android || platform == ProtoConstants.Platform.Platform_iOS || platform == ProtoConstants.Platform.Platform_Harmony) {
|
||||||
if (s.getPlatform() == ProtoConstants.Platform.Platform_Android || s.getPlatform() == ProtoConstants.Platform.Platform_iOS) {
|
if (s.getPlatform() == ProtoConstants.Platform.Platform_Android || s.getPlatform() == ProtoConstants.Platform.Platform_iOS || s.getPlatform() == ProtoConstants.Platform.Platform_Harmony) {
|
||||||
remove = true;
|
remove = true;
|
||||||
}
|
}
|
||||||
} else if(platform == ProtoConstants.Platform.Platform_OSX || platform == ProtoConstants.Platform.Platform_Windows || platform == ProtoConstants.Platform.Platform_LINUX) {
|
} else if(platform == ProtoConstants.Platform.Platform_iPad || platform == ProtoConstants.Platform.Platform_APad || platform == ProtoConstants.Platform.Platform_HarmonyPad) {
|
||||||
if (s.getPlatform() == ProtoConstants.Platform.Platform_OSX || s.getPlatform() == ProtoConstants.Platform.Platform_Windows || s.getPlatform() == ProtoConstants.Platform.Platform_LINUX) {
|
if (s.getPlatform() == ProtoConstants.Platform.Platform_iPad || s.getPlatform() == ProtoConstants.Platform.Platform_APad || s.getPlatform() == ProtoConstants.Platform.Platform_HarmonyPad) {
|
||||||
remove = true;
|
remove = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else if(platform == ProtoConstants.Platform.Platform_OSX || platform == ProtoConstants.Platform.Platform_Windows || platform == ProtoConstants.Platform.Platform_LINUX || platform == ProtoConstants.Platform.Platform_HarmonyPC) {
|
||||||
|
if (s.getPlatform() == ProtoConstants.Platform.Platform_OSX || s.getPlatform() == ProtoConstants.Platform.Platform_Windows || s.getPlatform() == ProtoConstants.Platform.Platform_LINUX || s.getPlatform() == ProtoConstants.Platform.Platform_HarmonyPC) {
|
||||||
|
remove = true;
|
||||||
|
}
|
||||||
|
} else { //web, microapp
|
||||||
if (s.getPlatform() ==platform) {
|
if (s.getPlatform() ==platform) {
|
||||||
remove = true;
|
remove = true;
|
||||||
}
|
}
|
||||||
@@ -747,7 +760,12 @@ public class MemorySessionStore implements ISessionsStore {
|
|||||||
if (session.getPlatform() == ProtoConstants.Platform.Platform_LINUX
|
if (session.getPlatform() == ProtoConstants.Platform.Platform_LINUX
|
||||||
|| session.getPlatform() == ProtoConstants.Platform.Platform_WEB
|
|| session.getPlatform() == ProtoConstants.Platform.Platform_WEB
|
||||||
|| session.getPlatform() == ProtoConstants.Platform.Platform_Windows
|
|| session.getPlatform() == ProtoConstants.Platform.Platform_Windows
|
||||||
|| session.getPlatform() == ProtoConstants.Platform.Platform_OSX) {
|
|| session.getPlatform() == ProtoConstants.Platform.Platform_OSX
|
||||||
|
|| session.getPlatform() == ProtoConstants.Platform.Platform_HarmonyPC
|
||||||
|
|| session.getPlatform() == ProtoConstants.Platform.Platform_iPad
|
||||||
|
|| session.getPlatform() == ProtoConstants.Platform.Platform_APad
|
||||||
|
|| session.getPlatform() == ProtoConstants.Platform.Platform_HarmonyPad
|
||||||
|
) {
|
||||||
databaseStore.updateSessionDeleted(operator, pcClientId, 1);
|
databaseStore.updateSessionDeleted(operator, pcClientId, 1);
|
||||||
sessions.remove(pcClientId);
|
sessions.remove(pcClientId);
|
||||||
mServer.getProcessor().kickoffSession(session);
|
mServer.getProcessor().kickoffSession(session);
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ public interface IMessagesStore {
|
|||||||
List<InputOutputUserBlockStatus> getUserStatusList();
|
List<InputOutputUserBlockStatus> getUserStatusList();
|
||||||
|
|
||||||
ErrorCode updateUserInfo(InputOutputUserInfo userInfo, int flag);
|
ErrorCode updateUserInfo(InputOutputUserInfo userInfo, int flag);
|
||||||
void addUserInfo(WFCMessage.User user, String password) throws Exception;
|
void addUserInfo(WFCMessage.User user) throws Exception;
|
||||||
void destroyUser(String userId);
|
void destroyUser(String userId);
|
||||||
void updateUserInfo(WFCMessage.User user) throws Exception;
|
void updateUserInfo(WFCMessage.User user) throws Exception;
|
||||||
WFCMessage.User getUserInfo(String userId);
|
WFCMessage.User getUserInfo(String userId);
|
||||||
|
|||||||
@@ -223,7 +223,12 @@ public class MessagesPublisher {
|
|||||||
if (targetSession.getPlatform() == ProtoConstants.Platform.Platform_WEB
|
if (targetSession.getPlatform() == ProtoConstants.Platform.Platform_WEB
|
||||||
|| targetSession.getPlatform() == ProtoConstants.Platform.Platform_Windows
|
|| targetSession.getPlatform() == ProtoConstants.Platform.Platform_Windows
|
||||||
|| targetSession.getPlatform() == ProtoConstants.Platform.Platform_LINUX
|
|| targetSession.getPlatform() == ProtoConstants.Platform.Platform_LINUX
|
||||||
|| targetSession.getPlatform() == ProtoConstants.Platform.Platform_OSX) {
|
|| targetSession.getPlatform() == ProtoConstants.Platform.Platform_OSX
|
||||||
|
|| targetSession.getPlatform() == ProtoConstants.Platform.Platform_HarmonyPC
|
||||||
|
|| targetSession.getPlatform() == ProtoConstants.Platform.Platform_iPad
|
||||||
|
|| targetSession.getPlatform() == ProtoConstants.Platform.Platform_APad
|
||||||
|
|| targetSession.getPlatform() == ProtoConstants.Platform.Platform_HarmonyPad
|
||||||
|
) {
|
||||||
boolean targetIsActive = this.connectionDescriptors.isConnected(targetSession.getClientSession().clientID);
|
boolean targetIsActive = this.connectionDescriptors.isConnected(targetSession.getClientSession().clientID);
|
||||||
if (targetIsActive) {
|
if (targetIsActive) {
|
||||||
isPcOnline = true;
|
isPcOnline = true;
|
||||||
@@ -469,6 +474,33 @@ public class MessagesPublisher {
|
|||||||
LOG.info("the target {} of user {} is not active", targetSession.getClientID(), targetSession.getUsername());
|
LOG.info("the target {} of user {} is not active", targetSession.getClientID(), targetSession.getUsername());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(sessions.isEmpty() && message.getContent().getType() == 403 && !user.equals(message.getFromUser())) {
|
||||||
|
WFCMessage.User userInfo = m_messagesStore.getUserInfo(user);
|
||||||
|
if (userInfo != null && userInfo.getType() == ProtoConstants.UserType.UserType_Robot) {
|
||||||
|
WFCMessage.Robot robot = m_messagesStore.getRobot(user);
|
||||||
|
if (robot != null && !StringUtil.isNullOrEmpty(robot.getCallback())) {
|
||||||
|
OutputClient outputClient = null;
|
||||||
|
if(m_messagesStore.isRobotCallbackWithClientInfo() && !StringUtil.isNullOrEmpty(exceptClientId)) {
|
||||||
|
Session session = m_sessionsStore.getSession(exceptClientId);
|
||||||
|
if(session != null && session.getUsername().equals(message.getFromUser())) {
|
||||||
|
outputClient = new OutputClient(session.getPlatform(), exceptClientId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final WFCMessage.Message finalMsg = message;
|
||||||
|
OutputClient finalOutputClient = outputClient;
|
||||||
|
Server.getServer().getCallbackScheduler().execute(() -> {
|
||||||
|
try {
|
||||||
|
HttpUtils.httpJsonPost(robot.getCallback(), GsonUtil.gson.toJson(OutputMessageData.fromProtoMessage(finalMsg, finalOutputClient), OutputMessageData.class), HttpUtils.HttpPostType.POST_TYPE_Robot_Message_Callback);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Utility.printExecption(LOG, e, EVENT_CALLBACK_Exception);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package io.moquette.spi.impl;
|
package io.moquette.spi.impl;
|
||||||
|
|
||||||
import cn.wildfirechat.common.ErrorCode;
|
import cn.wildfirechat.common.ErrorCode;
|
||||||
|
import cn.wildfirechat.pojos.OutputCheckUserOnline;
|
||||||
import cn.wildfirechat.pojos.UserOnlineStatus;
|
import cn.wildfirechat.pojos.UserOnlineStatus;
|
||||||
import cn.wildfirechat.proto.ProtoConstants;
|
import cn.wildfirechat.proto.ProtoConstants;
|
||||||
import cn.wildfirechat.proto.WFCMessage;
|
import cn.wildfirechat.proto.WFCMessage;
|
||||||
@@ -266,7 +267,27 @@ public class ProtocolProcessor {
|
|||||||
if (!StringUtil.isNullOrEmpty(mUserOnlineStatusCallback)) {
|
if (!StringUtil.isNullOrEmpty(mUserOnlineStatusCallback)) {
|
||||||
mServer.getCallbackScheduler().execute(() -> {
|
mServer.getCallbackScheduler().execute(() -> {
|
||||||
try {
|
try {
|
||||||
HttpUtils.httpJsonPost(mUserOnlineStatusCallback, GsonUtil.gson.toJson(new UserOnlineStatus(userId, clientId, platform, status, packageName)), HttpUtils.HttpPostType.POST_TYPE_User_Online_Event_Callback);
|
int sessionstatus;
|
||||||
|
Collection<MemorySessionStore.Session> useSessions = m_sessionsStore.sessionForUser(userId);
|
||||||
|
UserOnlineStatus userOnlineStatus = new UserOnlineStatus(userId, clientId, platform, status, packageName);
|
||||||
|
userOnlineStatus.sessions = new ArrayList<>();
|
||||||
|
|
||||||
|
for (MemorySessionStore.Session session : useSessions) {
|
||||||
|
if (session.getDeleted() > 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
ConnectionDescriptor descriptor = connectionDescriptors.getConnection(session.getClientID());
|
||||||
|
if (descriptor == null) {
|
||||||
|
sessionstatus = 1;
|
||||||
|
} else {
|
||||||
|
sessionstatus = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
userOnlineStatus.sessions.add(new OutputCheckUserOnline.Session(userId, session.getClientID(), session.getPlatform(), sessionstatus, session.getLastActiveTime(), session.getAppName()));
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpUtils.httpJsonPost(mUserOnlineStatusCallback, GsonUtil.gson.toJson(userOnlineStatus), HttpUtils.HttpPostType.POST_TYPE_User_Online_Event_Callback);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Utility.printExecption(LOG, e, EVENT_CALLBACK_Exception);
|
Utility.printExecption(LOG, e, EVENT_CALLBACK_Exception);
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import java.io.IOException;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.zip.GZIPOutputStream;
|
import java.util.zip.GZIPOutputStream;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ReflectUtil;
|
||||||
import cn.wildfirechat.proto.ProtoConstants;
|
import cn.wildfirechat.proto.ProtoConstants;
|
||||||
import cn.wildfirechat.server.ThreadPoolExecutorWrapper;
|
import cn.wildfirechat.server.ThreadPoolExecutorWrapper;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
@@ -92,7 +93,7 @@ public class Qos1PublishHandler extends QosPublishHandler {
|
|||||||
for (Class cls:ClassUtil.getAllAssignedClass(IMHandler.class)) {
|
for (Class cls:ClassUtil.getAllAssignedClass(IMHandler.class)) {
|
||||||
Handler annotation = (Handler)cls.getAnnotation(Handler.class);
|
Handler annotation = (Handler)cls.getAnnotation(Handler.class);
|
||||||
if(annotation != null) {
|
if(annotation != null) {
|
||||||
IMHandler handler = (IMHandler) com.xiaoleilu.hutool.util.ClassUtil.newInstance(cls);
|
IMHandler handler = (IMHandler) ReflectUtil.newInstance(cls);
|
||||||
m_imHandlers.put(annotation.value(), handler);
|
m_imHandlers.put(annotation.value(), handler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -140,7 +141,7 @@ public class Qos1PublishHandler extends QosPublishHandler {
|
|||||||
status = 0;
|
status = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
out.addSession(userId, session.getClientID(), session.getPlatform(), status, session.getLastActiveTime());
|
out.addSession(userId, session.getClientID(), session.getPlatform(), status, session.getLastActiveTime(), session.getAppName());
|
||||||
}
|
}
|
||||||
|
|
||||||
callback.onRouteHandled(GsonUtil.gson.toJson(out).getBytes());
|
callback.onRouteHandled(GsonUtil.gson.toJson(out).getBytes());
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>wildfirechat-parent</artifactId>
|
<artifactId>wildfirechat-parent</artifactId>
|
||||||
<groupId>cn.wildfirechat</groupId>
|
<groupId>cn.wildfirechat</groupId>
|
||||||
<version>1.2.2</version>
|
<version>1.2.4</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public interface APIPath {
|
|||||||
String Check_User_Subscribe_Channel = "/admin/channel/is_subscribed";
|
String Check_User_Subscribe_Channel = "/admin/channel/is_subscribed";
|
||||||
String Get_System_Setting = "/admin/system/get_setting";
|
String Get_System_Setting = "/admin/system/get_setting";
|
||||||
String Put_System_Setting = "/admin/system/put_setting";
|
String Put_System_Setting = "/admin/system/put_setting";
|
||||||
|
String GET_CUSTOMER = "/admin/customer";
|
||||||
String Health = "/admin/health";
|
String Health = "/admin/health";
|
||||||
|
|
||||||
String Conference_List = "/admin/conference/list";
|
String Conference_List = "/admin/conference/list";
|
||||||
@@ -138,4 +138,6 @@ public interface APIPath {
|
|||||||
String Robot_Group_Member_Quit = "/robot/group/member/quit";
|
String Robot_Group_Member_Quit = "/robot/group/member/quit";
|
||||||
String Robot_Group_Transfer = "/robot/group/transfer";
|
String Robot_Group_Transfer = "/robot/group/transfer";
|
||||||
String Robot_Group_Set_Manager = "/robot/group/manager/set";
|
String Robot_Group_Set_Manager = "/robot/group/manager/set";
|
||||||
|
|
||||||
|
String Robot_Conference_Request = "/robot/conference/request";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package cn.wildfirechat.pojos;
|
||||||
|
|
||||||
|
public class InputConferenceRequest {
|
||||||
|
public String userId;
|
||||||
|
public String clientId;
|
||||||
|
public String request;
|
||||||
|
public long sessionId;
|
||||||
|
public String roomId;
|
||||||
|
public String data;
|
||||||
|
public boolean advance;
|
||||||
|
|
||||||
|
public InputConferenceRequest() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public InputConferenceRequest(String userId, String clientId, String request, long sessionId, String roomId, String data, boolean advance) {
|
||||||
|
this.userId = userId;
|
||||||
|
this.clientId = clientId;
|
||||||
|
this.request = request;
|
||||||
|
this.sessionId = sessionId;
|
||||||
|
this.roomId = roomId;
|
||||||
|
this.data = data;
|
||||||
|
this.advance = advance;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,18 +19,23 @@ public class OutputCheckUserOnline {
|
|||||||
public int platform;
|
public int platform;
|
||||||
public int status; //0 online, 1 have session offline
|
public int status; //0 online, 1 have session offline
|
||||||
public long lastSeen;
|
public long lastSeen;
|
||||||
|
public String packageName;
|
||||||
|
|
||||||
public Session(String clientId, String userId, int platform, int status, long lastSeen) {
|
public Session() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public Session(String clientId, String userId, int platform, int status, long lastSeen, String packageName) {
|
||||||
this.clientId = clientId;
|
this.clientId = clientId;
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.platform = platform;
|
this.platform = platform;
|
||||||
this.status = status;
|
this.status = status;
|
||||||
this.lastSeen = lastSeen;
|
this.lastSeen = lastSeen;
|
||||||
|
this.packageName = packageName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addSession(String userId, String clientId, int platform, int status, long lastSeen) {
|
public void addSession(String userId, String clientId, int platform, int status, long lastSeen, String packageName) {
|
||||||
Session session = new Session(clientId, userId, platform, status, lastSeen);
|
Session session = new Session(clientId, userId, platform, status, lastSeen, packageName);
|
||||||
sessions.add(session);
|
sessions.add(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package cn.wildfirechat.pojos;
|
||||||
|
|
||||||
|
public class OutputReadData {
|
||||||
|
public String user;
|
||||||
|
public Conversation conversation;
|
||||||
|
public long readTime;
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package cn.wildfirechat.pojos;
|
package cn.wildfirechat.pojos;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class UserOnlineStatus {
|
public class UserOnlineStatus {
|
||||||
public static final int ONLINE = 0;
|
public static final int ONLINE = 0;
|
||||||
public static final int OFFLINE = 1;
|
public static final int OFFLINE = 1;
|
||||||
@@ -11,6 +13,9 @@ public class UserOnlineStatus {
|
|||||||
public int status;
|
public int status;
|
||||||
public long timestamp;
|
public long timestamp;
|
||||||
public String packageName;
|
public String packageName;
|
||||||
|
public int customState;
|
||||||
|
public String customText;
|
||||||
|
public List<OutputCheckUserOnline.Session> sessions;
|
||||||
|
|
||||||
public UserOnlineStatus() {
|
public UserOnlineStatus() {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ public class ProtoConstants {
|
|||||||
int Platform_LINUX = 7;
|
int Platform_LINUX = 7;
|
||||||
int Platform_iPad = 8;
|
int Platform_iPad = 8;
|
||||||
int Platform_APad = 9;
|
int Platform_APad = 9;
|
||||||
|
int Platform_Harmony = 10;
|
||||||
|
int Platform_HarmonyPad = 11;
|
||||||
|
int Platform_HarmonyPC = 12;
|
||||||
|
int Platform_MAX = Platform_HarmonyPC;
|
||||||
}
|
}
|
||||||
|
|
||||||
//message NotifyMessage & PullMessageRequest -> type
|
//message NotifyMessage & PullMessageRequest -> type
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<!--<relativePath>../pom.xml</relativePath>-->
|
<!--<relativePath>../pom.xml</relativePath>-->
|
||||||
<artifactId>wildfirechat-parent</artifactId>
|
<artifactId>wildfirechat-parent</artifactId>
|
||||||
<groupId>cn.wildfirechat</groupId>
|
<groupId>cn.wildfirechat</groupId>
|
||||||
<version>1.2.2</version>
|
<version>1.2.4</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>distribution</artifactId>
|
<artifactId>distribution</artifactId>
|
||||||
|
|||||||
@@ -289,7 +289,10 @@ server.multi_endpoint false
|
|||||||
## 是否支持PC多端登陆,当server.multi_endpoint为true时,此开关无意义,当为false时,可以单独打开PC端多端登录。
|
## 是否支持PC多端登陆,当server.multi_endpoint为true时,此开关无意义,当为false时,可以单独打开PC端多端登录。
|
||||||
server.multi_pc_endpoint false
|
server.multi_pc_endpoint false
|
||||||
|
|
||||||
# 多平台连接状态通知(仅当multi_endpoint为false时有效),true时移动端可以收到pc或web端登录的通知。
|
## 是否支持PAD多端登陆,当server.multi_endpoint为true时,此开关无意义,当为false时,可以单独打开PAD端多端登录。
|
||||||
|
server.multi_pad_endpoint false
|
||||||
|
|
||||||
|
# 多平台连接状态通知(仅当multi_endpoint为false时有效),true时移动端可以收到pc或pad或web端登录的通知。
|
||||||
server.multi_platform_notification true
|
server.multi_platform_notification true
|
||||||
|
|
||||||
# 当pc或者web在线时,手机是否默认静音,默认为true。注意仅影响默认值,用户可以手动切换是否静音。
|
# 当pc或者web在线时,手机是否默认静音,默认为true。注意仅影响默认值,用户可以手动切换是否静音。
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<artifactId>wildfirechat-parent</artifactId>
|
<artifactId>wildfirechat-parent</artifactId>
|
||||||
|
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>1.2.2</version>
|
<version>1.2.4</version>
|
||||||
<name>Wildfire Chat</name>
|
<name>Wildfire Chat</name>
|
||||||
<description>Wildfire Chat Server</description>
|
<description>Wildfire Chat Server</description>
|
||||||
<inceptionYear>2019</inceptionYear>
|
<inceptionYear>2019</inceptionYear>
|
||||||
|
|||||||
@@ -12,6 +12,19 @@
|
|||||||
|
|
||||||
# 更新记录
|
# 更新记录
|
||||||
|
|
||||||
|
--------------
|
||||||
|
Release note 1.2.4:
|
||||||
|
1. 去掉用户的默认密码。
|
||||||
|
2. 去掉频道和机器人的默认头像。
|
||||||
|
3. 修改在线状态回调数据,返回此用户的所有端状态。
|
||||||
|
|
||||||
|
--------------
|
||||||
|
Release note 1.2.3:
|
||||||
|
1. 同步专业版IM服务server SDK。
|
||||||
|
2. 添加对鸿蒙平台的支持。
|
||||||
|
3. 解决server端音视频SDK信令支持问题。
|
||||||
|
4. 升级部分依赖,解决漏洞问题
|
||||||
|
|
||||||
--------------
|
--------------
|
||||||
Release note 1.2.2:
|
Release note 1.2.2:
|
||||||
1. 解决搜索特殊字符时的转义问题。
|
1. 解决搜索特殊字符时的转义问题。
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>wildfirechat-parent</artifactId>
|
<artifactId>wildfirechat-parent</artifactId>
|
||||||
<groupId>cn.wildfirechat</groupId>
|
<groupId>cn.wildfirechat</groupId>
|
||||||
<version>1.2.2</version>
|
<version>1.2.4</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -97,4 +97,8 @@ public class GeneralAdmin {
|
|||||||
public static IMResult<HealthCheckResult> healthCheck() throws Exception {
|
public static IMResult<HealthCheckResult> healthCheck() throws Exception {
|
||||||
return AdminHttpUtils.httpGet(APIPath.Health, HealthCheckResult.class);
|
return AdminHttpUtils.httpGet(APIPath.Health, HealthCheckResult.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IMResult<String> getCustomer() throws Exception {
|
||||||
|
return AdminHttpUtils.httpJsonPost(APIPath.GET_CUSTOMER, null, String.class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -268,5 +268,10 @@ public class RobotService {
|
|||||||
return configData;
|
return configData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IMResult<String> sendConferenceRequest(String robotId, String clientId, String request, long sessionId, String roomId, String data, boolean advance) throws Exception {
|
||||||
|
String path = APIPath.Robot_Conference_Request;
|
||||||
|
InputConferenceRequest input = new InputConferenceRequest(robotId, clientId, request, sessionId, roomId, data, advance);
|
||||||
|
return robotHttpUtils.httpJsonPost(path, input, String.class);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user