From 50f23827d88677b88c9afd2b0c0688fdb4ac4657 Mon Sep 17 00:00:00 2001 From: Argo-MacBookPro Date: Mon, 24 Jun 2019 10:42:59 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E5=A2=9E=E5=8A=A0xml=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Client/Program.cs | 12 +++++++++++ Bootstrap.Client/Startup.cs | 19 ++++++++++++++++++ Bootstrap.DataAccess.MongoDB/App.cs | 3 +++ Bootstrap.DataAccess.MongoDB/Log.cs | 2 -- Bootstrap.DataAccess.MongoDB/LoginUser.cs | 3 +++ Bootstrap.DataAccess.MongoDB/RejectUser.cs | 21 ++++++++++++++++++++ Bootstrap.DataAccess.MongoDB/Role.cs | 1 - Bootstrap.DataAccess.MongoDB/User.cs | 6 ++++++ Bootstrap.DataAccess/App.cs | 3 +++ Bootstrap.DataAccess/DbManager.cs | 1 + Bootstrap.DataAccess/Group.cs | 4 +--- Bootstrap.DataAccess/Helper/AppHelper.cs | 6 ++++++ Bootstrap.DataAccess/Helper/GroupHelper.cs | 14 ++++++++++++- Bootstrap.DataAccess/Helper/LogHelper.cs | 3 +++ Bootstrap.DataAccess/Helper/LoginHelper.cs | 2 +- Bootstrap.DataAccess/Helper/MessageHelper.cs | 10 ++++++++++ Bootstrap.DataAccess/Helper/RoleHelper.cs | 18 +++++++++++++++++ Bootstrap.DataAccess/Helper/TraceHelper.cs | 3 +++ Bootstrap.DataAccess/Helper/UserHelper.cs | 15 ++++++++++++++ 19 files changed, 138 insertions(+), 8 deletions(-) diff --git a/Bootstrap.Client/Program.cs b/Bootstrap.Client/Program.cs index 8049dde4..9bd3da05 100644 --- a/Bootstrap.Client/Program.cs +++ b/Bootstrap.Client/Program.cs @@ -3,13 +3,25 @@ using Microsoft.AspNetCore.Hosting; namespace Bootstrap.Client { + /// + /// + /// public class Program { + /// + /// + /// + /// public static void Main(string[] args) { CreateWebHostBuilder(args).Build().Run(); } + /// + /// + /// + /// + /// public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup(); diff --git a/Bootstrap.Client/Startup.cs b/Bootstrap.Client/Startup.cs index 7f3b9cbb..a1afd781 100644 --- a/Bootstrap.Client/Startup.cs +++ b/Bootstrap.Client/Startup.cs @@ -14,16 +14,30 @@ using System; namespace Bootstrap.Client { + /// + /// + /// public class Startup { + /// + /// + /// + /// public Startup(IConfiguration configuration) { Configuration = configuration; } + /// + /// + /// public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. + /// + /// + /// + /// public void ConfigureServices(IServiceCollection services) { services.Configure(options => @@ -53,6 +67,11 @@ namespace Bootstrap.Client } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + /// + /// + /// + /// + /// public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) diff --git a/Bootstrap.DataAccess.MongoDB/App.cs b/Bootstrap.DataAccess.MongoDB/App.cs index 4e0dd502..a190094c 100644 --- a/Bootstrap.DataAccess.MongoDB/App.cs +++ b/Bootstrap.DataAccess.MongoDB/App.cs @@ -5,6 +5,9 @@ using System.Linq; namespace Bootstrap.DataAccess.MongoDB { + /// + /// + /// public class App : DataAccess.App { /// diff --git a/Bootstrap.DataAccess.MongoDB/Log.cs b/Bootstrap.DataAccess.MongoDB/Log.cs index 45bbc02d..92f89d9a 100644 --- a/Bootstrap.DataAccess.MongoDB/Log.cs +++ b/Bootstrap.DataAccess.MongoDB/Log.cs @@ -86,8 +86,6 @@ namespace Bootstrap.DataAccess.MongoDB /// /// 删除日志信息 /// - /// - /// private static void DeleteLogAsync() => System.Threading.Tasks.Task.Run(() => DbManager.Logs.DeleteMany(log => log.LogTime < DateTime.Now.AddDays(-7))); /// diff --git a/Bootstrap.DataAccess.MongoDB/LoginUser.cs b/Bootstrap.DataAccess.MongoDB/LoginUser.cs index 2354538a..84bb79e3 100644 --- a/Bootstrap.DataAccess.MongoDB/LoginUser.cs +++ b/Bootstrap.DataAccess.MongoDB/LoginUser.cs @@ -27,6 +27,9 @@ namespace Bootstrap.DataAccess.MongoDB /// /// /// + /// + /// + /// /// public override Page RetrieveByPages(PaginationOption po, DateTime? startTime, DateTime? endTime, string ip) { diff --git a/Bootstrap.DataAccess.MongoDB/RejectUser.cs b/Bootstrap.DataAccess.MongoDB/RejectUser.cs index 1f9d7f63..1ded6dfc 100644 --- a/Bootstrap.DataAccess.MongoDB/RejectUser.cs +++ b/Bootstrap.DataAccess.MongoDB/RejectUser.cs @@ -2,6 +2,9 @@ namespace Bootstrap.DataAccess.MongoDB { + /// + /// + /// public class RejectUser { /// @@ -9,16 +12,34 @@ namespace Bootstrap.DataAccess.MongoDB /// public string Id { get; set; } + /// + /// + /// public string UserName { get; set; } + /// + /// + /// public string DisplayName { get; set; } + /// + /// + /// public DateTime RegisterTime { get; set; } + /// + /// + /// public string RejectedBy { get; set; } + /// + /// + /// public DateTime RejectedTime { get; set; } + /// + /// + /// public string RejectedReason { get; set; } } } diff --git a/Bootstrap.DataAccess.MongoDB/Role.cs b/Bootstrap.DataAccess.MongoDB/Role.cs index d730fbf5..667dfa3c 100644 --- a/Bootstrap.DataAccess.MongoDB/Role.cs +++ b/Bootstrap.DataAccess.MongoDB/Role.cs @@ -22,7 +22,6 @@ namespace Bootstrap.DataAccess.MongoDB /// /// /// - /// /// public override IEnumerable Retrieves() { diff --git a/Bootstrap.DataAccess.MongoDB/User.cs b/Bootstrap.DataAccess.MongoDB/User.cs index f0f27419..4834a8a8 100644 --- a/Bootstrap.DataAccess.MongoDB/User.cs +++ b/Bootstrap.DataAccess.MongoDB/User.cs @@ -58,6 +58,12 @@ namespace Bootstrap.DataAccess.MongoDB return u != null && !string.IsNullOrEmpty(u.PassSalt) && u.Password == LgbCryptography.ComputeHash(password, u.PassSalt); } + /// + /// + /// + /// + /// + /// public override bool SaveApp(string userName, string app) { var update = Builders.Update.Set(u => u.App, app); diff --git a/Bootstrap.DataAccess/App.cs b/Bootstrap.DataAccess/App.cs index 960def19..4eed76da 100644 --- a/Bootstrap.DataAccess/App.cs +++ b/Bootstrap.DataAccess/App.cs @@ -6,6 +6,9 @@ using System.Linq; namespace Bootstrap.DataAccess { + /// + /// + /// public class App { /// diff --git a/Bootstrap.DataAccess/DbManager.cs b/Bootstrap.DataAccess/DbManager.cs index d1c407f9..af473a18 100644 --- a/Bootstrap.DataAccess/DbManager.cs +++ b/Bootstrap.DataAccess/DbManager.cs @@ -14,6 +14,7 @@ namespace Bootstrap.DataAccess /// /// /// + /// /// public static IDatabase Create(string connectionName = null, bool keepAlive = false) { diff --git a/Bootstrap.DataAccess/Group.cs b/Bootstrap.DataAccess/Group.cs index 1d4aac42..60f3a2ab 100644 --- a/Bootstrap.DataAccess/Group.cs +++ b/Bootstrap.DataAccess/Group.cs @@ -1,5 +1,4 @@ using Bootstrap.Security.DataAccess; -using Longbow.Data; using PetaPoco; using System; using System.Collections.Generic; @@ -37,14 +36,13 @@ namespace Bootstrap.DataAccess /// /// 查询所有群组信息 /// - /// /// public virtual IEnumerable Retrieves() => DbManager.Create().Fetch(); /// /// 删除群组信息 /// - /// + /// public virtual bool Delete(IEnumerable value) { bool ret = false; diff --git a/Bootstrap.DataAccess/Helper/AppHelper.cs b/Bootstrap.DataAccess/Helper/AppHelper.cs index 49c76a50..f3109247 100644 --- a/Bootstrap.DataAccess/Helper/AppHelper.cs +++ b/Bootstrap.DataAccess/Helper/AppHelper.cs @@ -4,8 +4,14 @@ using System.Collections.Generic; namespace Bootstrap.DataAccess { + /// + /// + /// public static class AppHelper { + /// + /// + /// public const string RetrieveAppsByRoleIdDataKey = "AppHelper-RetrieveAppsByRoleId"; /// diff --git a/Bootstrap.DataAccess/Helper/GroupHelper.cs b/Bootstrap.DataAccess/Helper/GroupHelper.cs index fa23c481..525a70cd 100644 --- a/Bootstrap.DataAccess/Helper/GroupHelper.cs +++ b/Bootstrap.DataAccess/Helper/GroupHelper.cs @@ -1,4 +1,4 @@ -using Longbow.Cache; +using Longbow.Cache; using Longbow.Data; using System.Collections.Generic; @@ -9,9 +9,21 @@ namespace Bootstrap.DataAccess /// public static class GroupHelper { + /// + /// + /// public const string RetrieveGroupsDataKey = "GroupHelper-RetrieveGroups"; + /// + /// + /// public const string RetrieveGroupsByUserIdDataKey = "GroupHelper-RetrieveGroupsByUserId"; + /// + /// + /// public const string RetrieveGroupsByRoleIdDataKey = "GroupHelper-RetrieveGroupsByRoleId"; + /// + /// + /// public const string RetrieveGroupsByUserNameDataKey = "GroupHelper-RetrieveGroupsByUserName"; /// diff --git a/Bootstrap.DataAccess/Helper/LogHelper.cs b/Bootstrap.DataAccess/Helper/LogHelper.cs index 05f1bb35..394e16c7 100644 --- a/Bootstrap.DataAccess/Helper/LogHelper.cs +++ b/Bootstrap.DataAccess/Helper/LogHelper.cs @@ -15,6 +15,9 @@ namespace Bootstrap.DataAccess /// 查询所有日志信息 /// /// + /// + /// + /// /// public static Page RetrievePages(PaginationOption op, DateTime? startTime, DateTime? endTime, string opType) => DbContextManager.Create().RetrievePages(op, startTime, endTime, opType); diff --git a/Bootstrap.DataAccess/Helper/LoginHelper.cs b/Bootstrap.DataAccess/Helper/LoginHelper.cs index 05a3a84f..430eafbb 100644 --- a/Bootstrap.DataAccess/Helper/LoginHelper.cs +++ b/Bootstrap.DataAccess/Helper/LoginHelper.cs @@ -14,7 +14,7 @@ namespace Bootstrap.DataAccess /// /// /// - /// + /// /// public static bool Log(LoginUser user) { diff --git a/Bootstrap.DataAccess/Helper/MessageHelper.cs b/Bootstrap.DataAccess/Helper/MessageHelper.cs index c8c91cc1..2e1a8a6e 100644 --- a/Bootstrap.DataAccess/Helper/MessageHelper.cs +++ b/Bootstrap.DataAccess/Helper/MessageHelper.cs @@ -14,29 +14,34 @@ namespace Bootstrap.DataAccess /// /// public const string RetrieveMessageDataKey = "MessageHelper-RetrieveMessages"; + /// /// 收件箱 /// /// public static IEnumerable Inbox(string userName) => DbContextManager.Create().Inbox(userName); + /// /// 发件箱 /// /// /// public static IEnumerable SendMail(string userName) => DbContextManager.Create().SendMail(userName); + /// /// 垃圾箱 /// /// /// public static IEnumerable Trash(string userName) => DbContextManager.Create().Trash(userName); + /// /// 标旗 /// /// /// public static IEnumerable Mark(string userName) => DbContextManager.Create().Mark(userName); + /// /// 获取Header处显示的消息列表 /// @@ -44,6 +49,11 @@ namespace Bootstrap.DataAccess /// public static IEnumerable Retrieves(string userName) => CacheManager.GetOrAdd(RetrieveMessageDataKey, key => DbContextManager.Create().RetrieveHeaders(userName).OrderByDescending(n => n.SendTime)); + /// + /// + /// + /// + /// public static bool Save(Message msg) { if (string.IsNullOrEmpty(msg.Id)) msg.Id = null; diff --git a/Bootstrap.DataAccess/Helper/RoleHelper.cs b/Bootstrap.DataAccess/Helper/RoleHelper.cs index d2845c1c..81d98fb6 100644 --- a/Bootstrap.DataAccess/Helper/RoleHelper.cs +++ b/Bootstrap.DataAccess/Helper/RoleHelper.cs @@ -11,11 +11,29 @@ namespace Bootstrap.DataAccess /// public static class RoleHelper { + /// + /// + /// public const string RetrieveRolesDataKey = "RoleHelper-RetrieveRoles"; + /// + /// + /// public const string RetrieveRolesByUserIdDataKey = "RoleHelper-RetrieveRolesByUserId"; + /// + /// + /// public const string RetrieveRolesByMenuIdDataKey = "RoleHelper-RetrieveRolesByMenuId"; + /// + /// + /// public const string RetrieveRolesByGroupIdDataKey = "RoleHelper-RetrieveRolesByGroupId"; + /// + /// + /// public const string RetrieveRolesByUserNameDataKey = "RoleHelper-RetrieveRolesByUserName"; + /// + /// + /// public const string RetrieveRolesByUrlDataKey = "RoleHelper-RetrieveRolesByUrl"; /// diff --git a/Bootstrap.DataAccess/Helper/TraceHelper.cs b/Bootstrap.DataAccess/Helper/TraceHelper.cs index 0c5f3061..e7c5ef55 100644 --- a/Bootstrap.DataAccess/Helper/TraceHelper.cs +++ b/Bootstrap.DataAccess/Helper/TraceHelper.cs @@ -8,6 +8,9 @@ using System.Collections.Generic; namespace Bootstrap.DataAccess { + /// + /// + /// public static class TraceHelper { diff --git a/Bootstrap.DataAccess/Helper/UserHelper.cs b/Bootstrap.DataAccess/Helper/UserHelper.cs index 1920a92a..83762483 100644 --- a/Bootstrap.DataAccess/Helper/UserHelper.cs +++ b/Bootstrap.DataAccess/Helper/UserHelper.cs @@ -13,10 +13,25 @@ namespace Bootstrap.DataAccess /// public static class UserHelper { + /// + /// + /// public const string RetrieveUsersDataKey = "UserHelper-RetrieveUsers"; + /// + /// + /// public const string RetrieveUsersByRoleIdDataKey = "UserHelper-RetrieveUsersByRoleId"; + /// + /// + /// public const string RetrieveUsersByGroupIdDataKey = "UserHelper-RetrieveUsersByGroupId"; + /// + /// + /// public const string RetrieveNewUsersDataKey = "UserHelper-RetrieveNewUsers"; + /// + /// + /// public const string RetrieveUsersByNameDataKey = "BootstrapUser-RetrieveUsersByName"; private static bool UserChecker(User user)