From 627355dae6941ec2c66c26dc52e818424630d7c9 Mon Sep 17 00:00:00 2001 From: wxd <123@qq.com> Date: Fri, 12 Apr 2024 17:27:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Books/HelloAAppService.cs | 8 +-- .../Books/QiNiuDemo.cs | 67 ------------------- 2 files changed, 1 insertion(+), 74 deletions(-) delete mode 100644 src/Shentun.Peis.Application/Books/QiNiuDemo.cs diff --git a/src/Shentun.Peis.Application/Books/HelloAAppService.cs b/src/Shentun.Peis.Application/Books/HelloAAppService.cs index 26812ee..32682f2 100644 --- a/src/Shentun.Peis.Application/Books/HelloAAppService.cs +++ b/src/Shentun.Peis.Application/Books/HelloAAppService.cs @@ -53,13 +53,7 @@ namespace Shentun.Peis.Books } - - public async void Sa() - { - var s1 = await _helloARepository.FindAsync(m => m.AName == "45645454"); - - QiNiuHelper.Upload_QiNiu(); - } + public async Task> GetListAsync() { diff --git a/src/Shentun.Peis.Application/Books/QiNiuDemo.cs b/src/Shentun.Peis.Application/Books/QiNiuDemo.cs deleted file mode 100644 index 28d3099..0000000 --- a/src/Shentun.Peis.Application/Books/QiNiuDemo.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp.Application.Services; -using System.IO; -using Aliyun.OSS; -using System.Security.AccessControl; - -namespace Shentun.Peis.Books -{ - - - public static class QiNiuHelper - { - - // 阿里云账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM - // 用户进行API访问或日常运维,请登录RAM控制台创建RAM用户。 - - const string accessKeyId = "LTAI5tBNDdiV7JudVvaQhU1t"; - const string accessKeySecret = "sA6k0TbeX8w2cv7YhcTed7wyt0EBdN"; - - // yourEndpoint填写Bucket所在地域对应的Endpoint。以华东1(杭州)为例,Endpoint - // 填写为https://oss-cn-hangzhou.aliyuncs.com。 - const string endpoint = "https://oss-cn-beijing.aliyuncs.com"; - - // 填写Bucket名称。 - const string bucketName = "whdshake"; - - public static void Upload_QiNiu() - { - - - // 填写Object完整路径。Object完整路径中不能包含Bucket名称。 - // 即:objectName为文件上传到阿里云OSS上的文件夹路径 - var objectName = "imgae/222.png"; - - // 填写本地文件的完整路径。如果未指定本地路径, - // 则默认从示例程序所属项目对应本地路径中上传文件。 - var localFilename = @"D:\aaa.png"; - - //System.Web.HttpContext.Current.Server.MapPath("imgae.png"); - // 创建OssClient实例。 - var client = new Aliyun.OSS.OssClient(endpoint, accessKeyId, accessKeySecret); - try - { - // 上传文件。 - client.PutObject(bucketName, objectName, localFilename); - Console.WriteLine("1"); - } - catch (Exception ex) - { - Console.WriteLine(ex.Message); - } - - } - - - } - - - - - - -}