远程wvp问题
This commit is contained in:
parent
5c0bf09c95
commit
f693f036df
@ -5,6 +5,7 @@ import lombok.Data;
|
||||
@Data
|
||||
public class WvpActiveStorageConfig {
|
||||
private String host;
|
||||
private String zlmHost;
|
||||
private String loginName;
|
||||
private String loginPassword;
|
||||
private String app = "rtp";
|
||||
|
@ -9,7 +9,9 @@ import com.ycwl.basic.device.entity.common.FileObject;
|
||||
import com.ycwl.basic.device.entity.wvp_active.WvpActiveStorageConfig;
|
||||
import com.ycwl.basic.storage.exceptions.StorageConfigException;
|
||||
import com.ycwl.basic.storage.exceptions.StorageUnsupportedException;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.net.URI;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
@ -97,7 +99,16 @@ public class WvpActiveStorageOperator extends ADeviceStorageOperator {
|
||||
JSONObject result = JSON.parseObject(jsonResult);
|
||||
if (result.getInteger("code") == 0) {
|
||||
JSONObject data = result.getJSONObject("data");
|
||||
return data.getString("httpPath");
|
||||
String httpPath = data.getString("httpPath");
|
||||
if (StringUtils.isBlank(this.config.getZlmHost())) {
|
||||
return httpPath;
|
||||
}
|
||||
// 替换host
|
||||
URI uri = URI.create(httpPath);
|
||||
if (uri.getQuery() == null) {
|
||||
return this.config.getZlmHost() + uri.getPath();
|
||||
}
|
||||
return this.config.getZlmHost() + uri.getPath() + "?" + uri.getQuery();
|
||||
} else {
|
||||
throw new StorageUnsupportedException("获取播放地址失败,原因为:" + result.getString("msg"));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user