[集群-自动切换过国标级联] 启动时自动注册上级只注册本平台的上级
parent
d022eb72d6
commit
91b0ba4d5e
|
@ -31,10 +31,13 @@ public class SipPlatformRunner implements CommandLineRunner {
|
|||
@Autowired
|
||||
private ISIPCommanderForPlatform sipCommanderForPlatform;
|
||||
|
||||
@Autowired
|
||||
private UserSetting userSetting;
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
// 获取所有启用的平台
|
||||
List<Platform> parentPlatforms = platformService.queryEnablePlatformList();
|
||||
List<Platform> parentPlatforms = platformService.queryEnablePlatformList(userSetting.getServerId());
|
||||
|
||||
for (Platform platform : parentPlatforms) {
|
||||
|
||||
|
|
|
@ -77,8 +77,8 @@ public interface PlatformMapper {
|
|||
" </script>")
|
||||
List<Platform> queryList(@Param("query") String query);
|
||||
|
||||
@Select("SELECT * FROM wvp_platform WHERE enable=#{enable} ")
|
||||
List<Platform> queryEnableParentPlatformList(boolean enable);
|
||||
@Select("SELECT * FROM wvp_platform WHERE serverId=#{serverId} and enable=#{enable} ")
|
||||
List<Platform> queryEnableParentPlatformList(@Param("serverId") String serverId, @Param("enable") boolean enable);
|
||||
|
||||
@Select("SELECT * FROM wvp_platform WHERE enable=true and as_message_channel=true")
|
||||
List<Platform> queryEnablePlatformListWithAsMessageChannel();
|
||||
|
|
|
@ -82,7 +82,7 @@ public interface IPlatformService {
|
|||
|
||||
Platform queryOne(Integer platformId);
|
||||
|
||||
List<Platform> queryEnablePlatformList();
|
||||
List<Platform> queryEnablePlatformList(String serverId);
|
||||
|
||||
void delete(Integer platformId, CommonCallback<Object> callback);
|
||||
}
|
||||
|
|
|
@ -857,8 +857,8 @@ public class PlatformServiceImpl implements IPlatformService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Platform> queryEnablePlatformList() {
|
||||
return platformMapper.queryEnableParentPlatformList(true);
|
||||
public List<Platform> queryEnablePlatformList(String serverId) {
|
||||
return platformMapper.queryEnableParentPlatformList(serverId,true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -105,7 +105,7 @@ public class RedisAlarmMsgListener implements MessageListener {
|
|||
if (ObjectUtils.isEmpty(gbId)) {
|
||||
if (userSetting.getSendToPlatformsWhenIdLost()) {
|
||||
// 发送给所有的上级
|
||||
List<Platform> parentPlatforms = platformService.queryEnablePlatformList();
|
||||
List<Platform> parentPlatforms = platformService.queryEnablePlatformList(userSetting.getServerId());
|
||||
if (!parentPlatforms.isEmpty()) {
|
||||
for (Platform parentPlatform : parentPlatforms) {
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue