♻️ Extract the Storage service to DysonNetwork.Drive microservice
This commit is contained in:
@ -15,6 +15,7 @@
|
||||
<PackageReference Include="NodaTime" Version="3.2.2" />
|
||||
<PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.2.0" />
|
||||
<PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.3.0" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite" Version="9.0.4" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime" Version="9.0.4" />
|
||||
<PackageReference Include="Otp.NET" Version="1.4.0" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.8.41" />
|
||||
|
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using DysonNetwork.Common.Models;
|
||||
using NodaTime;
|
||||
|
||||
namespace DysonNetwork.Common.Interfaces
|
||||
{
|
||||
public interface IFileReferenceServiceClient
|
||||
{
|
||||
Task<CloudFileReference> CreateReferenceAsync(
|
||||
string fileId,
|
||||
string usage,
|
||||
string resourceId,
|
||||
Instant? expiredAt = null,
|
||||
Duration? duration = null);
|
||||
|
||||
Task DeleteReferenceAsync(string referenceId);
|
||||
Task DeleteResourceReferencesAsync(string resourceId, string? usage = null);
|
||||
Task<List<CloudFileReference>> GetFileReferencesAsync(string fileId);
|
||||
Task<List<CloudFileReference>> GetResourceReferencesAsync(string resourceId, string? usage = null);
|
||||
Task<bool> HasReferencesAsync(string fileId);
|
||||
Task UpdateReferenceExpirationAsync(string referenceId, Instant? expiredAt);
|
||||
}
|
||||
}
|
17
DysonNetwork.Common/Interfaces/IFileServiceClient.cs
Normal file
17
DysonNetwork.Common/Interfaces/IFileServiceClient.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using DysonNetwork.Common.Models;
|
||||
|
||||
namespace DysonNetwork.Common.Interfaces
|
||||
{
|
||||
public interface IFileServiceClient
|
||||
{
|
||||
Task<CloudFile> GetFileAsync(string fileId);
|
||||
Task<Stream> GetFileStreamAsync(string fileId);
|
||||
Task<CloudFile> UploadFileAsync(Stream fileStream, string fileName, string? contentType = null);
|
||||
Task DeleteFileAsync(string fileId);
|
||||
Task<CloudFile> ProcessImageAsync(Stream imageStream, string fileName, string? contentType = null);
|
||||
Task<string> GetFileUrl(string fileId, bool useCdn = false);
|
||||
}
|
||||
}
|
@ -14,9 +14,9 @@ public class AuthSession : ModelBase
|
||||
public Instant? ExpiredAt { get; set; }
|
||||
|
||||
public Guid AccountId { get; set; }
|
||||
[JsonIgnore] public Models.Account Account { get; set; } = null!;
|
||||
[JsonIgnore] public Account Account { get; set; } = null!;
|
||||
public Guid ChallengeId { get; set; }
|
||||
public AuthChallenge AuthChallenge { get; set; } = null!;
|
||||
public AuthChallenge Challenge { get; set; } = null!;
|
||||
public Guid? AppId { get; set; }
|
||||
public CustomApp? App { get; set; }
|
||||
}
|
||||
|
Reference in New Issue
Block a user