초기커밋

This commit is contained in:
2025-05-01 07:20:41 +09:00
commit 98bb2e3c5c
2747 changed files with 646947 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
using System.Text;
using System.Text.Json;
using System.Collections.Generic;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Options;
using Amazon.S3;
using MetaAssets;
using UGQApiServer.Models;
using UGQApiServer.Settings;
using UGQApiServer.Storage;
using UGQDatabase.Models;
using UGQDataAccess.Settings;
namespace UGQApiServer.UGQData;
public class UGQBannerImageList
{
readonly AmazonS3Client _s3Client;
readonly S3Settings _settings;
public UGQBannerImageList(IOptions<S3Settings> settings)
{
_settings = settings.Value;
_s3Client = new AmazonS3Client(_settings.AccessKey, _settings.SecretAccessKey, Amazon.RegionEndpoint.USEast1);
}
public async Task<List<string>> getFiles()
{
var res = await _s3Client.ListObjectsAsync(_settings.BucketName, "preset");
return res.S3Objects.Where(x => x.Key.EndsWith(".png"))
.Select(x => x.Key).ToList();
}
}