Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
49ffbad759
|
|
@ -196,7 +196,7 @@ public interface IOSSService
|
|||
|
||||
List<string> GetRootFolderNames();
|
||||
|
||||
public ObjectStoreDTO GetObjectStoreTempToken(string? domain = null, bool? isGetAllTempToken = null);
|
||||
public ObjectStoreDTO GetObjectStoreTempToken(string? domain = null, bool? isGetAllTempToken = null, string? objectUse = null);
|
||||
|
||||
public Task MoveObject(string sourcePath, string destPath, bool overwrite = true);
|
||||
|
||||
|
|
@ -1502,9 +1502,9 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
|||
{
|
||||
foreach (var config in ObjectStoreServiceOptions.SyncConfigList.Where(t => t.IsOpenSync))
|
||||
{
|
||||
ObjectStoreServiceOptions.ObjectStoreUse = config.Primary;
|
||||
|
||||
GetObjectStoreTempToken();
|
||||
|
||||
GetObjectStoreTempToken(objectUse: config.Primary);
|
||||
|
||||
await DeleteFromPrefixInternal(prefix, isCache);
|
||||
}
|
||||
|
|
@ -1678,9 +1678,8 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
|||
{
|
||||
foreach (var config in ObjectStoreServiceOptions.SyncConfigList.Where(t => t.IsOpenSync))
|
||||
{
|
||||
ObjectStoreServiceOptions.ObjectStoreUse = config.Primary;
|
||||
|
||||
GetObjectStoreTempToken();
|
||||
GetObjectStoreTempToken(objectUse: config.Primary);
|
||||
|
||||
await DeleteObjectsInternal(objectKeys, isCache);
|
||||
}
|
||||
|
|
@ -1858,30 +1857,35 @@ public class OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options,
|
|||
|
||||
|
||||
|
||||
public ObjectStoreDTO GetObjectStoreTempToken(string? domain = null, bool? isGetAllTempToken = null)
|
||||
public ObjectStoreDTO GetObjectStoreTempToken(string? domain = null, bool? isGetAllTempToken = null, string? objectUse = null)
|
||||
{
|
||||
|
||||
string objectStoreUse = string.Empty;
|
||||
//如果传递了域名,并且打开了存储同步,根据域名使用的具体存储覆盖之前的配置,否则就用固定的配置
|
||||
if (ObjectStoreServiceOptions.IsOpenStoreSync && domain.IsNotNullOrEmpty())
|
||||
//使用指定配置
|
||||
if (objectUse != null)
|
||||
{
|
||||
objectStoreUse = objectUse?.Trim() ?? string.Empty;
|
||||
}
|
||||
//根据域名动态判断
|
||||
else
|
||||
{
|
||||
//如果传递了域名,并且打开了存储同步,根据域名使用的具体存储覆盖之前的配置,否则就用固定的配置
|
||||
if (ObjectStoreServiceOptions.IsOpenStoreSync && domain.IsNotNullOrEmpty() && ObjectStoreServiceOptions.SyncConfigList.Any(t => t.Domain == domain))
|
||||
{
|
||||
var userDomain = domain?.Trim();
|
||||
|
||||
var find = ObjectStoreServiceOptions.SyncConfigList.FirstOrDefault(t => t.Domain == userDomain);
|
||||
var find = ObjectStoreServiceOptions.SyncConfigList.FirstOrDefault(t => t.Domain == domain);
|
||||
if (find != null)
|
||||
{
|
||||
objectStoreUse = find.Primary;
|
||||
}
|
||||
else
|
||||
{
|
||||
//本地localhost 时候,默认给值
|
||||
objectStoreUse = ObjectStoreServiceOptions.ObjectStoreUse;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//兜底,如果是本地测试环境,那就使用部署默认配置
|
||||
objectStoreUse = ObjectStoreServiceOptions.ObjectStoreUse;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var objectStoreDTO = new ObjectStoreDTO() { ObjectStoreUse = objectStoreUse, IsOpenStoreSync = ObjectStoreServiceOptions.IsOpenStoreSync, SyncConfigList = ObjectStoreServiceOptions.SyncConfigList };
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue