From 111805ffeaaf43c7fd7256e27c12e27343a2a871 Mon Sep 17 00:00:00 2001 From: lzw <605106923@qq.com> Date: Wed, 3 Nov 2021 18:38:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/RoleController.cs | 15 +-------------- .../Yi.Framework.ApiMicroservice/Startup.cs | 4 ++-- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/RoleController.cs b/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/RoleController.cs index 4681efe4..46fe2cc3 100644 --- a/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/RoleController.cs +++ b/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/RoleController.cs @@ -29,20 +29,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers { return Result.Success().SetData(await _roleService.GetAllEntitiesTrueAsync()); } - [HttpPost] - public async Task GetRoleFlie() - { - var roleList = await _roleService.GetAllEntitiesTrueAsync(); - Dictionary dt = new(); - dt.Add("输出", "文件"); - var byteStream = Excel.ExportExcel(roleList.ToList(), dt).ToString(); - MemoryStream s = new MemoryStream(); - StreamWriter writer = new StreamWriter(s); - writer.Write(byteStream); - writer.Flush(); - //stream.Read(byteStream, 0, byteStream.Length); - return new FileStreamResult(s, "application/vnd.ms-excel"); - } + /// /// æ›´ diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/Startup.cs b/Yi.Framework/Yi.Framework.ApiMicroservice/Startup.cs index 2129958d..060e93ab 100644 --- a/Yi.Framework/Yi.Framework.ApiMicroservice/Startup.cs +++ b/Yi.Framework/Yi.Framework.ApiMicroservice/Startup.cs @@ -84,7 +84,7 @@ namespace Yi.Framework.ApiMicroservice #endregion // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IWebHostEnvironment env,IDbContextFactory _DbFactory, CacheClientDB _cacheClientDB) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env,IDbContextFactory _DbFactory) { //if (env.IsDevelopment()) { @@ -142,7 +142,7 @@ namespace Yi.Framework.ApiMicroservice //Êý¾Ý¿âÖÖ×Ó×¢Èë #endregion app.UseDbSeedInitService(_DbFactory); - app.UseRedisInitService(_cacheClientDB); + //app.UseRedisInitService(_cacheClientDB); #region //Endpoints×¢Èë #endregion