fix 整理minio

This commit is contained in:
cheche
2024-01-26 10:26:06 +08:00
parent b5ccf3008e
commit 930ba41220
3 changed files with 6 additions and 16 deletions

View File

@@ -2,7 +2,6 @@
using Dlhis.Common.Response;
using Dlhis.Common.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
namespace Dlhis.Common.Controllers;
@@ -13,11 +12,11 @@ namespace Dlhis.Common.Controllers;
[Authorize]
[Route("api/[controller]")]
[ApiController]
public class ApkFIileController : ControllerBase
public class ApkFileController : ControllerBase
{
private IApkFIileService _apkFIileService;
public ApkFIileController(IApkFIileService apkFIileService)
public ApkFileController(IApkFIileService apkFIileService)
{
_apkFIileService = apkFIileService;
}

View File

@@ -1,11 +1,8 @@
using Kurisu.AspNetCore.Startup;
using Kurisu.SqlSugar.Extensions;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.Extensions.DependencyInjection;
using Minio;
namespace Dlhis.Common.Packs
{
namespace Dlhis.Common.Packs;
public class MinioPack : BaseAppPack
{
public override bool IsBeforeUseRouting { get; }
@@ -18,10 +15,9 @@ namespace Dlhis.Common.Packs
.WithCredentials("Zbjj05OFtR19e5TJopQU", "UMXtNdZhufhAAyYJ3XND4cEgZNUsgOWtbUzksizK")
.Build();
services.AddSingleton(minioClient);
}
}
}

View File

@@ -1,12 +1,7 @@
using Dlhis.Common.Request;
using Dlhis.Entity.Common;
using Google.Protobuf.WellKnownTypes;
using Kurisu.SqlSugar.Services;
using Minio;
using Minio.DataModel.Args;
using Minio.Exceptions;
using Npgsql.Replication.PgOutput.Messages;
using System.IO;
namespace Dlhis.Common.Services.Implements
{
@@ -57,7 +52,7 @@ namespace Dlhis.Common.Services.Implements
var url = await _client.PresignedGetObjectAsync(new PresignedGetObjectArgs()
.WithBucket(bucketName)
.WithObject(fileName)
.WithExpiry(60 * 60 * 24));//链接时效
.WithExpiry(60 * 60 * 24*7));//链接时效
return url;
}
catch (MinioException e)