优化代码空字符串判断
This commit is contained in:
@@ -24,6 +24,8 @@ import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.context.request.async.DeferredResult;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@@ -405,12 +407,11 @@ public class PlayServiceImpl implements IPlayService {
|
||||
if (device == null) {
|
||||
return null;
|
||||
}
|
||||
String mediaServerId = device.getMediaServerId();
|
||||
MediaServerItem mediaServerItem;
|
||||
if (mediaServerId == null || "".equals(device.getMediaServerId()) || "auto".equals(device.getMediaServerId())) {
|
||||
if (ObjectUtils.isEmpty(device.getMediaServerId()) || "auto".equals(device.getMediaServerId())) {
|
||||
mediaServerItem = mediaServerService.getMediaServerForMinimumLoad();
|
||||
} else {
|
||||
mediaServerItem = mediaServerService.getOne(mediaServerId);
|
||||
mediaServerItem = mediaServerService.getOne(device.getMediaServerId());
|
||||
}
|
||||
if (mediaServerItem == null) {
|
||||
logger.warn("点播时未找到可使用的ZLM...");
|
||||
|
||||
@@ -98,7 +98,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
||||
@Override
|
||||
public StreamInfo save(StreamProxyItem param) {
|
||||
MediaServerItem mediaInfo;
|
||||
if (param.getMediaServerId() == null || "".equals(param.getMediaServerId()) || "auto".equals(param.getMediaServerId())){
|
||||
if (ObjectUtils.isEmpty(param.getMediaServerId()) || "auto".equals(param.getMediaServerId())){
|
||||
mediaInfo = mediaServerService.getMediaServerForMinimumLoad();
|
||||
}else {
|
||||
mediaInfo = mediaServerService.getOne(param.getMediaServerId());
|
||||
|
||||
Reference in New Issue
Block a user