From 29c1da23d903b271f123479b7329e747414f3fcf Mon Sep 17 00:00:00 2001 From: bunny <1319900154@qq.com> Date: Fri, 13 Sep 2024 08:37:24 +0800 Subject: [PATCH] =?UTF-8?q?:rocket:=20feat(=E6=96=B0=E5=A2=9E):=20?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E6=B5=8B=E8=AF=95=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bunny.Common/Bunny.Common.csproj | 2 -- Bunny.Common/Context/Database/EFCoreContext.cs | 2 -- Bunny.Common/Context/Database/GetPagedResultAsync.cs | 2 +- Bunny.Common/Context/Middleware/MinioContext.cs | 1 - Bunny.Common/Context/Middleware/RedisContext.cs | 2 -- Bunny.Service/IService/Service/UserService.cs | 1 + 6 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Bunny.Common/Bunny.Common.csproj b/Bunny.Common/Bunny.Common.csproj index 0628694..964eb00 100644 --- a/Bunny.Common/Bunny.Common.csproj +++ b/Bunny.Common/Bunny.Common.csproj @@ -7,7 +7,6 @@ - @@ -22,7 +21,6 @@ all - diff --git a/Bunny.Common/Context/Database/EFCoreContext.cs b/Bunny.Common/Context/Database/EFCoreContext.cs index 61ef95a..1ef0790 100644 --- a/Bunny.Common/Context/Database/EFCoreContext.cs +++ b/Bunny.Common/Context/Database/EFCoreContext.cs @@ -45,9 +45,7 @@ public class EfCoreContext : DbContext /// protected override void OnConfiguring(DbContextOptionsBuilder options) { - Log.Info("正在连接数据库。。。"); options.UseSqlServer(DbPath); - Log.Info("连接数据库完成层。。。"); } /// diff --git a/Bunny.Common/Context/Database/GetPagedResultAsync.cs b/Bunny.Common/Context/Database/GetPagedResultAsync.cs index 51feaa0..dbad035 100644 --- a/Bunny.Common/Context/Database/GetPagedResultAsync.cs +++ b/Bunny.Common/Context/Database/GetPagedResultAsync.cs @@ -7,7 +7,7 @@ public static class GetPagedResultAsync { public static async Task> GetPagedListAsync(IQueryable source, int page, int limit) { - var total = await source.CountAsync(); + var total = source.Count(); IEnumerable items = await source.Skip((page - 1) * limit).Take(limit).ToListAsync(); return new PageResult(page, limit, total, items); } diff --git a/Bunny.Common/Context/Middleware/MinioContext.cs b/Bunny.Common/Context/Middleware/MinioContext.cs index abca19a..b6a898b 100644 --- a/Bunny.Common/Context/Middleware/MinioContext.cs +++ b/Bunny.Common/Context/Middleware/MinioContext.cs @@ -19,6 +19,5 @@ public static class MinioContext MinioClient = new MinioClient().WithEndpoint(endpoint).WithCredentials(accessKey, secretKey) // .WithSSL() // 使用HTTPS .Build(); - Log.Info($"Minio 初始化...\t初始化桶:{BucketName}"); } } \ No newline at end of file diff --git a/Bunny.Common/Context/Middleware/RedisContext.cs b/Bunny.Common/Context/Middleware/RedisContext.cs index 46a9c10..7d5a7ad 100644 --- a/Bunny.Common/Context/Middleware/RedisContext.cs +++ b/Bunny.Common/Context/Middleware/RedisContext.cs @@ -33,7 +33,5 @@ public static class RedisContext // 创建连接对象 RedisDatabase = connect.GetDatabase(); - - Log.Info("Redis 初始化..."); } } \ No newline at end of file diff --git a/Bunny.Service/IService/Service/UserService.cs b/Bunny.Service/IService/Service/UserService.cs index 31cbc15..bc03731 100644 --- a/Bunny.Service/IService/Service/UserService.cs +++ b/Bunny.Service/IService/Service/UserService.cs @@ -120,6 +120,7 @@ public class UserService : IUserService public Task> QueryPage(int page, int limit) { var pagedListAsync = GetPagedResultAsync.GetPagedListFromSqlAsync(DbContext, "select * from System_Users ", page, limit); + var listAsync = GetPagedResultAsync.GetPagedListAsync(DbContext.Users.Where(users => users.Username == "admin"), page, limit); return pagedListAsync; } } \ No newline at end of file