mirror of
https://github.com/azaion/admin.git
synced 2026-04-22 09:06:33 +00:00
fix login
add logging add scripts for server
This commit is contained in:
@@ -4,6 +4,7 @@ using Azaion.Common.Database;
|
||||
using Azaion.Common.Entities;
|
||||
using LinqToDB;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Azaion.Services;
|
||||
@@ -14,7 +15,7 @@ public interface IResourcesService
|
||||
Task SaveResource(IFormFile data, CancellationToken cancellationToken = default);
|
||||
}
|
||||
|
||||
public class ResourcesService(IOptions<ResourcesConfig> resourcesConfig) : IResourcesService
|
||||
public class ResourcesService(IOptions<ResourcesConfig> resourcesConfig, ILogger<ResourcesService> logger) : IResourcesService
|
||||
{
|
||||
public async Task<Stream> GetEncryptedResource(string fileName, string key, CancellationToken cancellationToken = default)
|
||||
{
|
||||
@@ -37,5 +38,6 @@ public class ResourcesService(IOptions<ResourcesConfig> resourcesConfig) : IReso
|
||||
var resourcePath = Path.Combine(resourcesConfig.Value.ResourcesFolder, data.FileName);
|
||||
await using var fileStream = new FileStream(resourcePath, FileMode.OpenOrCreate, FileAccess.ReadWrite);
|
||||
await data.CopyToAsync(fileStream, cancellationToken);
|
||||
logger.LogInformation($"Resource {data.FileName} Saved Successfully");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user