指定service使用的数据源

pull/1288/head
648540858 2024-01-22 15:56:24 +08:00
parent 0e94aeaf5f
commit d68aebd409
15 changed files with 32 additions and 2 deletions

View File

@ -1,5 +1,6 @@
package com.genersoft.iot.vmp.service.impl; package com.genersoft.iot.vmp.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm; import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm;
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
import com.genersoft.iot.vmp.service.IDeviceAlarmService; import com.genersoft.iot.vmp.service.IDeviceAlarmService;
@ -12,6 +13,7 @@ import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@Service @Service
@DS("master")
public class DeviceAlarmServiceImpl implements IDeviceAlarmService { public class DeviceAlarmServiceImpl implements IDeviceAlarmService {
@Autowired @Autowired

View File

@ -1,5 +1,6 @@
package com.genersoft.iot.vmp.service.impl; package com.genersoft.iot.vmp.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.common.InviteInfo; import com.genersoft.iot.vmp.common.InviteInfo;
import com.genersoft.iot.vmp.common.InviteSessionType; import com.genersoft.iot.vmp.common.InviteSessionType;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
@ -27,6 +28,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
* @author lin * @author lin
*/ */
@Service @Service
@DS("master")
public class DeviceChannelServiceImpl implements IDeviceChannelService { public class DeviceChannelServiceImpl implements IDeviceChannelService {
private final static Logger logger = LoggerFactory.getLogger(DeviceChannelServiceImpl.class); private final static Logger logger = LoggerFactory.getLogger(DeviceChannelServiceImpl.class);

View File

@ -1,5 +1,6 @@
package com.genersoft.iot.vmp.service.impl; package com.genersoft.iot.vmp.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.common.VideoManagerConstants; import com.genersoft.iot.vmp.common.VideoManagerConstants;
import com.genersoft.iot.vmp.conf.DynamicTask; import com.genersoft.iot.vmp.conf.DynamicTask;
import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.conf.UserSetting;
@ -45,6 +46,7 @@ import java.util.concurrent.TimeUnit;
* *
*/ */
@Service @Service
@DS("master")
public class DeviceServiceImpl implements IDeviceService { public class DeviceServiceImpl implements IDeviceService {
private final static Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class); private final static Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);

View File

@ -1,5 +1,6 @@
package com.genersoft.iot.vmp.service.impl; package com.genersoft.iot.vmp.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.gb28181.bean.*; import com.genersoft.iot.vmp.gb28181.bean.*;
import com.genersoft.iot.vmp.gb28181.event.EventPublisher; import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent; import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
@ -25,6 +26,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
@Service @Service
@DS("master")
public class GbStreamServiceImpl implements IGbStreamService { public class GbStreamServiceImpl implements IGbStreamService {
private final static Logger logger = LoggerFactory.getLogger(GbStreamServiceImpl.class); private final static Logger logger = LoggerFactory.getLogger(GbStreamServiceImpl.class);

View File

@ -1,6 +1,7 @@
package com.genersoft.iot.vmp.service.impl; package com.genersoft.iot.vmp.service.impl;
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSON;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.common.InviteInfo; import com.genersoft.iot.vmp.common.InviteInfo;
import com.genersoft.iot.vmp.common.InviteSessionStatus; import com.genersoft.iot.vmp.common.InviteSessionStatus;
import com.genersoft.iot.vmp.common.InviteSessionType; import com.genersoft.iot.vmp.common.InviteSessionType;
@ -20,6 +21,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
@Service @Service
@DS("master")
public class InviteStreamServiceImpl implements IInviteStreamService { public class InviteStreamServiceImpl implements IInviteStreamService {
private final Logger logger = LoggerFactory.getLogger(InviteStreamServiceImpl.class); private final Logger logger = LoggerFactory.getLogger(InviteStreamServiceImpl.class);

View File

@ -1,5 +1,6 @@
package com.genersoft.iot.vmp.service.impl; package com.genersoft.iot.vmp.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm; import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm;
import com.genersoft.iot.vmp.service.ILogService; import com.genersoft.iot.vmp.service.ILogService;
import com.genersoft.iot.vmp.storager.dao.LogMapper; import com.genersoft.iot.vmp.storager.dao.LogMapper;
@ -12,6 +13,7 @@ import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@Service @Service
@DS("master")
public class LogServiceImpl implements ILogService { public class LogServiceImpl implements ILogService {
@Autowired @Autowired

View File

@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.service.impl;
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.common.CommonCallback; import com.genersoft.iot.vmp.common.CommonCallback;
import com.genersoft.iot.vmp.common.VideoManagerConstants; import com.genersoft.iot.vmp.common.VideoManagerConstants;
import com.genersoft.iot.vmp.conf.DynamicTask; import com.genersoft.iot.vmp.conf.DynamicTask;
@ -53,6 +54,7 @@ import java.util.concurrent.ExecutionException;
* *
*/ */
@Service @Service
@DS("master")
public class MediaServerServiceImpl implements IMediaServerService { public class MediaServerServiceImpl implements IMediaServerService {
private final static Logger logger = LoggerFactory.getLogger(MediaServerServiceImpl.class); private final static Logger logger = LoggerFactory.getLogger(MediaServerServiceImpl.class);
@ -304,7 +306,6 @@ public class MediaServerServiceImpl implements IMediaServerService {
@Override @Override
public MediaServerItem getDefaultMediaServer() { public MediaServerItem getDefaultMediaServer() {
return mediaServerMapper.queryDefault(); return mediaServerMapper.queryDefault();
} }

View File

@ -1,5 +1,6 @@
package com.genersoft.iot.vmp.service.impl; package com.genersoft.iot.vmp.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.gb28181.bean.*; import com.genersoft.iot.vmp.gb28181.bean.*;
import com.genersoft.iot.vmp.gb28181.event.EventPublisher; import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent; import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
@ -27,6 +28,7 @@ import java.util.Map;
* @author lin * @author lin
*/ */
@Service @Service
@DS("master")
public class PlatformChannelServiceImpl implements IPlatformChannelService { public class PlatformChannelServiceImpl implements IPlatformChannelService {
private final static Logger logger = LoggerFactory.getLogger(PlatformChannelServiceImpl.class); private final static Logger logger = LoggerFactory.getLogger(PlatformChannelServiceImpl.class);

View File

@ -1,5 +1,6 @@
package com.genersoft.iot.vmp.service.impl; package com.genersoft.iot.vmp.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.conf.DynamicTask; import com.genersoft.iot.vmp.conf.DynamicTask;
import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.gb28181.bean.*; import com.genersoft.iot.vmp.gb28181.bean.*;
@ -38,6 +39,7 @@ import java.util.*;
* @author lin * @author lin
*/ */
@Service @Service
@DS("master")
public class PlatformServiceImpl implements IPlatformService { public class PlatformServiceImpl implements IPlatformService {
private final static String REGISTER_KEY_PREFIX = "platform_register_"; private final static String REGISTER_KEY_PREFIX = "platform_register_";

View File

@ -1,6 +1,7 @@
package com.genersoft.iot.vmp.service.impl; package com.genersoft.iot.vmp.service.impl;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.common.InviteInfo; import com.genersoft.iot.vmp.common.InviteInfo;
import com.genersoft.iot.vmp.common.InviteSessionStatus; import com.genersoft.iot.vmp.common.InviteSessionStatus;
import com.genersoft.iot.vmp.common.InviteSessionType; import com.genersoft.iot.vmp.common.InviteSessionType;
@ -57,6 +58,7 @@ import java.util.Vector;
@SuppressWarnings(value = {"rawtypes", "unchecked"}) @SuppressWarnings(value = {"rawtypes", "unchecked"})
@Service @Service
@DS("master")
public class PlayServiceImpl implements IPlayService { public class PlayServiceImpl implements IPlayService {
private final static Logger logger = LoggerFactory.getLogger(PlayServiceImpl.class); private final static Logger logger = LoggerFactory.getLogger(PlayServiceImpl.class);

View File

@ -1,5 +1,6 @@
package com.genersoft.iot.vmp.service.impl; package com.genersoft.iot.vmp.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.service.IRoleService; import com.genersoft.iot.vmp.service.IRoleService;
import com.genersoft.iot.vmp.storager.dao.RoleMapper; import com.genersoft.iot.vmp.storager.dao.RoleMapper;
import com.genersoft.iot.vmp.storager.dao.dto.Role; import com.genersoft.iot.vmp.storager.dao.dto.Role;
@ -9,6 +10,7 @@ import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@Service @Service
@DS("master")
public class RoleServerImpl implements IRoleService { public class RoleServerImpl implements IRoleService {
@Autowired @Autowired

View File

@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.service.impl;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.common.GeneralCallback; import com.genersoft.iot.vmp.common.GeneralCallback;
import com.genersoft.iot.vmp.common.StreamInfo; import com.genersoft.iot.vmp.common.StreamInfo;
import com.genersoft.iot.vmp.conf.DynamicTask; import com.genersoft.iot.vmp.conf.DynamicTask;
@ -53,6 +54,7 @@ import java.util.stream.Collectors;
* *
*/ */
@Service @Service
@DS("master")
public class StreamProxyServiceImpl implements IStreamProxyService { public class StreamProxyServiceImpl implements IStreamProxyService {
private final static Logger logger = LoggerFactory.getLogger(StreamProxyServiceImpl.class); private final static Logger logger = LoggerFactory.getLogger(StreamProxyServiceImpl.class);

View File

@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.TypeReference; import com.alibaba.fastjson2.TypeReference;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.conf.MediaConfig; import com.genersoft.iot.vmp.conf.MediaConfig;
import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.gb28181.bean.*; import com.genersoft.iot.vmp.gb28181.bean.*;
@ -36,6 +37,7 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
@DS("master")
public class StreamPushServiceImpl implements IStreamPushService { public class StreamPushServiceImpl implements IStreamPushService {
private final static Logger logger = LoggerFactory.getLogger(StreamPushServiceImpl.class); private final static Logger logger = LoggerFactory.getLogger(StreamPushServiceImpl.class);

View File

@ -1,5 +1,6 @@
package com.genersoft.iot.vmp.service.impl; package com.genersoft.iot.vmp.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.service.IUserService; import com.genersoft.iot.vmp.service.IUserService;
import com.genersoft.iot.vmp.storager.dao.UserMapper; import com.genersoft.iot.vmp.storager.dao.UserMapper;
import com.genersoft.iot.vmp.storager.dao.dto.User; import com.genersoft.iot.vmp.storager.dao.dto.User;
@ -12,6 +13,7 @@ import org.springframework.util.DigestUtils;
import java.util.List; import java.util.List;
@Service @Service
@DS("master")
public class UserServiceImpl implements IUserService { public class UserServiceImpl implements IUserService {
@Autowired @Autowired

View File

@ -194,6 +194,9 @@ public class CloudRecordController {
@RequestParam(required = false) String mediaServerId, @RequestParam(required = false) String mediaServerId,
@RequestParam(required = false) Boolean isEnd @RequestParam(required = false) Boolean isEnd
){ ){
if (ObjectUtils.isEmpty(mediaServerId)) {
mediaServerId = null;
}
return cloudRecordService.queryTask(app, stream, callId, taskId, mediaServerId, isEnd); return cloudRecordService.queryTask(app, stream, callId, taskId, mediaServerId, isEnd);
} }