|
@@ -156,7 +156,7 @@ public class StoreServiceImpl implements StoreService {
|
|
|
public String getSignedUrl(String domain, int owner, String objectId, int expire) throws Exception {
|
|
public String getSignedUrl(String domain, int owner, String objectId, int expire) throws Exception {
|
|
|
ObjectMeta objectMeta = objectRepository.getObjectMetaById(objectId);
|
|
ObjectMeta objectMeta = objectRepository.getObjectMetaById(objectId);
|
|
|
if (objectMeta == null) {
|
|
if (objectMeta == null) {
|
|
|
- String errMsg = String.format("%s not exist in oss-store", objectId);
|
|
|
|
|
|
|
+ String errMsg = String.format("objectId %s not exist in oss-store", objectId);
|
|
|
throw new Exception(errMsg);
|
|
throw new Exception(errMsg);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -164,6 +164,21 @@ public class StoreServiceImpl implements StoreService {
|
|
|
return signService.getSignedUrl(owner, url, expire);
|
|
return signService.getSignedUrl(owner, url, expire);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public String getSignedUrl(String objectUrl, int owner, int expire) throws Exception {
|
|
|
|
|
+ // //oss.reghao.cn/file/abc/def
|
|
|
|
|
+ String objectUrl1 = objectUrl.replace("//", "");
|
|
|
|
|
+ int idx = objectUrl1.indexOf("/");
|
|
|
|
|
+ String domain = objectUrl1.substring(0, idx);
|
|
|
|
|
+ String objectName = objectUrl1.substring(idx+1);
|
|
|
|
|
+ ObjectMeta objectMeta = objectRepository.getObjectMetaByName(objectName, owner);
|
|
|
|
|
+ if (objectMeta == null) {
|
|
|
|
|
+ String errMsg = String.format("objectName %s not exist in oss-store", objectName);
|
|
|
|
|
+ throw new Exception(errMsg);
|
|
|
|
|
+ }
|
|
|
|
|
+ return signService.getSignedUrl(owner, objectUrl, expire);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public VideoInfo getVideoInfo(String objectId) throws Exception {
|
|
public VideoInfo getVideoInfo(String objectId) throws Exception {
|
|
|
VideoInfo videoInfo = mediaFileProcessor.getVideoInfo(objectId);
|
|
VideoInfo videoInfo = mediaFileProcessor.getVideoInfo(objectId);
|