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