This commit is contained in:
77
2024-09-23 01:52:32 +08:00
parent 13b7464e03
commit 7606abb5ad
3 changed files with 10 additions and 0 deletions

View File

@@ -93,6 +93,10 @@ public class ChatManager {
Long userId = LoginHelper.getUserId();
User fromUser = userService.getById(userId);
User toUser = userService.getById(callReq.getToUid());
boolean openVideo = systemConfigManager.getSystemConfigOfBool(SystemConfigEnum.OPEN_VIDEO);
if(!openVideo){
throw new ServiceException("聊天功能未开放");
}
if(fromUser == null){
throw new ServiceException("用户不存在");
}

View File

@@ -21,6 +21,8 @@ public enum SystemConfigEnum {
OPEN_REGISTER("1", "开启注册",SystemConfigGroupEnum.BUSINESS, new BooleanSystemConfigCheck()),
INIT_VIDEO_MESSAGE("提示禁止任何涉黄、任何微信QQ引导到其它平台行为", "视频接通提示语",SystemConfigGroupEnum.BUSINESS),
SHARE_URL("https://h5.qx96688.com/index/invite/index", "分享链接",SystemConfigGroupEnum.BUSINESS),
OPEN_MESSAGE("1", "开启聊天功能",SystemConfigGroupEnum.BUSINESS),
OPEN_VIDEO("1", "开启视频功能",SystemConfigGroupEnum.BUSINESS),
// INVITE_GIFT_RATE("100", "礼物分销成功率",SystemConfigGroupEnum.BUSINESS, new RateIntegerSystemConfigCheck()),
// INVITE_GUARD_RATE("100", "守护分销成功率",SystemConfigGroupEnum.BUSINESS, new RateIntegerSystemConfigCheck()),
// INVITE_VIDEO_RATE("100", "视频分销成功率",SystemConfigGroupEnum.BUSINESS, new RateIntegerSystemConfigCheck()),

View File

@@ -99,6 +99,10 @@ public class ImService {
resp.setContent(message.getContent());
return resp;
}
boolean openMessage = systemConfigManager.getSystemConfigOfBool(SystemConfigEnum.OPEN_MESSAGE);
if(!openMessage){
throw new ServiceException("聊天功能未开放");
}
if(fromUserId.equals(toUserId)){
throw new ServiceException("不能给自己发送哦!");
}