fix 整理minio
This commit is contained in:
@@ -2,7 +2,6 @@
|
|||||||
using Dlhis.Common.Response;
|
using Dlhis.Common.Response;
|
||||||
using Dlhis.Common.Services;
|
using Dlhis.Common.Services;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace Dlhis.Common.Controllers;
|
namespace Dlhis.Common.Controllers;
|
||||||
@@ -13,11 +12,11 @@ namespace Dlhis.Common.Controllers;
|
|||||||
[Authorize]
|
[Authorize]
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class ApkFIileController : ControllerBase
|
public class ApkFileController : ControllerBase
|
||||||
{
|
{
|
||||||
private IApkFIileService _apkFIileService;
|
private IApkFIileService _apkFIileService;
|
||||||
|
|
||||||
public ApkFIileController(IApkFIileService apkFIileService)
|
public ApkFileController(IApkFIileService apkFIileService)
|
||||||
{
|
{
|
||||||
_apkFIileService = apkFIileService;
|
_apkFIileService = apkFIileService;
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,8 @@
|
|||||||
using Kurisu.AspNetCore.Startup;
|
using Kurisu.AspNetCore.Startup;
|
||||||
using Kurisu.SqlSugar.Extensions;
|
|
||||||
using Microsoft.AspNetCore.Http.Features;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Minio;
|
using Minio;
|
||||||
|
|
||||||
namespace Dlhis.Common.Packs
|
namespace Dlhis.Common.Packs;
|
||||||
{
|
|
||||||
public class MinioPack : BaseAppPack
|
public class MinioPack : BaseAppPack
|
||||||
{
|
{
|
||||||
public override bool IsBeforeUseRouting { get; }
|
public override bool IsBeforeUseRouting { get; }
|
||||||
@@ -18,10 +15,9 @@ namespace Dlhis.Common.Packs
|
|||||||
.WithCredentials("Zbjj05OFtR19e5TJopQU", "UMXtNdZhufhAAyYJ3XND4cEgZNUsgOWtbUzksizK")
|
.WithCredentials("Zbjj05OFtR19e5TJopQU", "UMXtNdZhufhAAyYJ3XND4cEgZNUsgOWtbUzksizK")
|
||||||
.Build();
|
.Build();
|
||||||
services.AddSingleton(minioClient);
|
services.AddSingleton(minioClient);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,12 +1,7 @@
|
|||||||
using Dlhis.Common.Request;
|
using Dlhis.Common.Request;
|
||||||
using Dlhis.Entity.Common;
|
|
||||||
using Google.Protobuf.WellKnownTypes;
|
|
||||||
using Kurisu.SqlSugar.Services;
|
|
||||||
using Minio;
|
using Minio;
|
||||||
using Minio.DataModel.Args;
|
using Minio.DataModel.Args;
|
||||||
using Minio.Exceptions;
|
using Minio.Exceptions;
|
||||||
using Npgsql.Replication.PgOutput.Messages;
|
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
namespace Dlhis.Common.Services.Implements
|
namespace Dlhis.Common.Services.Implements
|
||||||
{
|
{
|
||||||
@@ -57,7 +52,7 @@ namespace Dlhis.Common.Services.Implements
|
|||||||
var url = await _client.PresignedGetObjectAsync(new PresignedGetObjectArgs()
|
var url = await _client.PresignedGetObjectAsync(new PresignedGetObjectArgs()
|
||||||
.WithBucket(bucketName)
|
.WithBucket(bucketName)
|
||||||
.WithObject(fileName)
|
.WithObject(fileName)
|
||||||
.WithExpiry(60 * 60 * 24));//链接时效
|
.WithExpiry(60 * 60 * 24*7));//链接时效
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
catch (MinioException e)
|
catch (MinioException e)
|
||||||
|
|||||||
Reference in New Issue
Block a user