style: 增加xml注释

This commit is contained in:
Argo-MacBookPro 2019-06-24 10:42:59 +08:00
parent a25ae6e265
commit 50f23827d8
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
19 changed files with 138 additions and 8 deletions

View File

@ -3,13 +3,25 @@ using Microsoft.AspNetCore.Hosting;
namespace Bootstrap.Client namespace Bootstrap.Client
{ {
/// <summary>
///
/// </summary>
public class Program public class Program
{ {
/// <summary>
///
/// </summary>
/// <param name="args"></param>
public static void Main(string[] args) public static void Main(string[] args)
{ {
CreateWebHostBuilder(args).Build().Run(); CreateWebHostBuilder(args).Build().Run();
} }
/// <summary>
///
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
public static IWebHostBuilder CreateWebHostBuilder(string[] args) => public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args) WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>(); .UseStartup<Startup>();

View File

@ -14,16 +14,30 @@ using System;
namespace Bootstrap.Client namespace Bootstrap.Client
{ {
/// <summary>
///
/// </summary>
public class Startup public class Startup
{ {
/// <summary>
///
/// </summary>
/// <param name="configuration"></param>
public Startup(IConfiguration configuration) public Startup(IConfiguration configuration)
{ {
Configuration = configuration; Configuration = configuration;
} }
/// <summary>
///
/// </summary>
public IConfiguration Configuration { get; } public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container. // This method gets called by the runtime. Use this method to add services to the container.
/// <summary>
///
/// </summary>
/// <param name="services"></param>
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.Configure<CookiePolicyOptions>(options => services.Configure<CookiePolicyOptions>(options =>
@ -53,6 +67,11 @@ namespace Bootstrap.Client
} }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
/// <summary>
///
/// </summary>
/// <param name="app"></param>
/// <param name="env"></param>
public void Configure(IApplicationBuilder app, IHostingEnvironment env) public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{ {
if (env.IsDevelopment()) if (env.IsDevelopment())

View File

@ -5,6 +5,9 @@ using System.Linq;
namespace Bootstrap.DataAccess.MongoDB namespace Bootstrap.DataAccess.MongoDB
{ {
/// <summary>
///
/// </summary>
public class App : DataAccess.App public class App : DataAccess.App
{ {
/// <summary> /// <summary>

View File

@ -86,8 +86,6 @@ namespace Bootstrap.DataAccess.MongoDB
/// <summary> /// <summary>
/// 删除日志信息 /// 删除日志信息
/// </summary> /// </summary>
/// <param name="value"></param>
/// <returns></returns>
private static void DeleteLogAsync() => System.Threading.Tasks.Task.Run(() => DbManager.Logs.DeleteMany(log => log.LogTime < DateTime.Now.AddDays(-7))); private static void DeleteLogAsync() => System.Threading.Tasks.Task.Run(() => DbManager.Logs.DeleteMany(log => log.LogTime < DateTime.Now.AddDays(-7)));
/// <summary> /// <summary>

View File

@ -27,6 +27,9 @@ namespace Bootstrap.DataAccess.MongoDB
/// ///
/// </summary> /// </summary>
/// <param name="po"></param> /// <param name="po"></param>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="ip"></param>
/// <returns></returns> /// <returns></returns>
public override Page<DataAccess.LoginUser> RetrieveByPages(PaginationOption po, DateTime? startTime, DateTime? endTime, string ip) public override Page<DataAccess.LoginUser> RetrieveByPages(PaginationOption po, DateTime? startTime, DateTime? endTime, string ip)
{ {

View File

@ -2,6 +2,9 @@
namespace Bootstrap.DataAccess.MongoDB namespace Bootstrap.DataAccess.MongoDB
{ {
/// <summary>
///
/// </summary>
public class RejectUser public class RejectUser
{ {
/// <summary> /// <summary>
@ -9,16 +12,34 @@ namespace Bootstrap.DataAccess.MongoDB
/// </summary> /// </summary>
public string Id { get; set; } public string Id { get; set; }
/// <summary>
///
/// </summary>
public string UserName { get; set; } public string UserName { get; set; }
/// <summary>
///
/// </summary>
public string DisplayName { get; set; } public string DisplayName { get; set; }
/// <summary>
///
/// </summary>
public DateTime RegisterTime { get; set; } public DateTime RegisterTime { get; set; }
/// <summary>
///
/// </summary>
public string RejectedBy { get; set; } public string RejectedBy { get; set; }
/// <summary>
///
/// </summary>
public DateTime RejectedTime { get; set; } public DateTime RejectedTime { get; set; }
/// <summary>
///
/// </summary>
public string RejectedReason { get; set; } public string RejectedReason { get; set; }
} }
} }

View File

@ -22,7 +22,6 @@ namespace Bootstrap.DataAccess.MongoDB
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="id"></param>
/// <returns></returns> /// <returns></returns>
public override IEnumerable<DataAccess.Role> Retrieves() public override IEnumerable<DataAccess.Role> Retrieves()
{ {

View File

@ -58,6 +58,12 @@ namespace Bootstrap.DataAccess.MongoDB
return u != null && !string.IsNullOrEmpty(u.PassSalt) && u.Password == LgbCryptography.ComputeHash(password, u.PassSalt); return u != null && !string.IsNullOrEmpty(u.PassSalt) && u.Password == LgbCryptography.ComputeHash(password, u.PassSalt);
} }
/// <summary>
///
/// </summary>
/// <param name="userName"></param>
/// <param name="app"></param>
/// <returns></returns>
public override bool SaveApp(string userName, string app) public override bool SaveApp(string userName, string app)
{ {
var update = Builders<User>.Update.Set(u => u.App, app); var update = Builders<User>.Update.Set(u => u.App, app);

View File

@ -6,6 +6,9 @@ using System.Linq;
namespace Bootstrap.DataAccess namespace Bootstrap.DataAccess
{ {
/// <summary>
///
/// </summary>
public class App public class App
{ {
/// <summary> /// <summary>

View File

@ -14,6 +14,7 @@ namespace Bootstrap.DataAccess
/// ///
/// </summary> /// </summary>
/// <param name="connectionName"></param> /// <param name="connectionName"></param>
/// <param name="keepAlive"></param>
/// <returns></returns> /// <returns></returns>
public static IDatabase Create(string connectionName = null, bool keepAlive = false) public static IDatabase Create(string connectionName = null, bool keepAlive = false)
{ {

View File

@ -1,5 +1,4 @@
using Bootstrap.Security.DataAccess; using Bootstrap.Security.DataAccess;
using Longbow.Data;
using PetaPoco; using PetaPoco;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -37,14 +36,13 @@ namespace Bootstrap.DataAccess
/// <summary> /// <summary>
/// 查询所有群组信息 /// 查询所有群组信息
/// </summary> /// </summary>
/// <param name="id"></param>
/// <returns></returns> /// <returns></returns>
public virtual IEnumerable<Group> Retrieves() => DbManager.Create().Fetch<Group>(); public virtual IEnumerable<Group> Retrieves() => DbManager.Create().Fetch<Group>();
/// <summary> /// <summary>
/// 删除群组信息 /// 删除群组信息
/// </summary> /// </summary>
/// <param name="ids"></param> /// <param name="value"></param>
public virtual bool Delete(IEnumerable<string> value) public virtual bool Delete(IEnumerable<string> value)
{ {
bool ret = false; bool ret = false;

View File

@ -4,8 +4,14 @@ using System.Collections.Generic;
namespace Bootstrap.DataAccess namespace Bootstrap.DataAccess
{ {
/// <summary>
///
/// </summary>
public static class AppHelper public static class AppHelper
{ {
/// <summary>
///
/// </summary>
public const string RetrieveAppsByRoleIdDataKey = "AppHelper-RetrieveAppsByRoleId"; public const string RetrieveAppsByRoleIdDataKey = "AppHelper-RetrieveAppsByRoleId";
/// <summary> /// <summary>

View File

@ -1,4 +1,4 @@
using Longbow.Cache; using Longbow.Cache;
using Longbow.Data; using Longbow.Data;
using System.Collections.Generic; using System.Collections.Generic;
@ -9,9 +9,21 @@ namespace Bootstrap.DataAccess
/// </summary> /// </summary>
public static class GroupHelper public static class GroupHelper
{ {
/// <summary>
///
/// </summary>
public const string RetrieveGroupsDataKey = "GroupHelper-RetrieveGroups"; public const string RetrieveGroupsDataKey = "GroupHelper-RetrieveGroups";
/// <summary>
///
/// </summary>
public const string RetrieveGroupsByUserIdDataKey = "GroupHelper-RetrieveGroupsByUserId"; public const string RetrieveGroupsByUserIdDataKey = "GroupHelper-RetrieveGroupsByUserId";
/// <summary>
///
/// </summary>
public const string RetrieveGroupsByRoleIdDataKey = "GroupHelper-RetrieveGroupsByRoleId"; public const string RetrieveGroupsByRoleIdDataKey = "GroupHelper-RetrieveGroupsByRoleId";
/// <summary>
///
/// </summary>
public const string RetrieveGroupsByUserNameDataKey = "GroupHelper-RetrieveGroupsByUserName"; public const string RetrieveGroupsByUserNameDataKey = "GroupHelper-RetrieveGroupsByUserName";
/// <summary> /// <summary>

View File

@ -15,6 +15,9 @@ namespace Bootstrap.DataAccess
/// 查询所有日志信息 /// 查询所有日志信息
/// </summary> /// </summary>
/// <param name="op"></param> /// <param name="op"></param>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="opType"></param>
/// <returns></returns> /// <returns></returns>
public static Page<Log> RetrievePages(PaginationOption op, DateTime? startTime, DateTime? endTime, string opType) => DbContextManager.Create<Log>().RetrievePages(op, startTime, endTime, opType); public static Page<Log> RetrievePages(PaginationOption op, DateTime? startTime, DateTime? endTime, string opType) => DbContextManager.Create<Log>().RetrievePages(op, startTime, endTime, opType);

View File

@ -14,7 +14,7 @@ namespace Bootstrap.DataAccess
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="userName"></param> /// <param name="user"></param>
/// <returns></returns> /// <returns></returns>
public static bool Log(LoginUser user) public static bool Log(LoginUser user)
{ {

View File

@ -14,29 +14,34 @@ namespace Bootstrap.DataAccess
/// ///
/// </summary> /// </summary>
public const string RetrieveMessageDataKey = "MessageHelper-RetrieveMessages"; public const string RetrieveMessageDataKey = "MessageHelper-RetrieveMessages";
/// <summary> /// <summary>
/// 收件箱 /// 收件箱
/// </summary> /// </summary>
/// <param name="userName"></param> /// <param name="userName"></param>
public static IEnumerable<Message> Inbox(string userName) => DbContextManager.Create<Message>().Inbox(userName); public static IEnumerable<Message> Inbox(string userName) => DbContextManager.Create<Message>().Inbox(userName);
/// <summary> /// <summary>
/// 发件箱 /// 发件箱
/// </summary> /// </summary>
/// <param name="userName"></param> /// <param name="userName"></param>
/// <returns></returns> /// <returns></returns>
public static IEnumerable<Message> SendMail(string userName) => DbContextManager.Create<Message>().SendMail(userName); public static IEnumerable<Message> SendMail(string userName) => DbContextManager.Create<Message>().SendMail(userName);
/// <summary> /// <summary>
/// 垃圾箱 /// 垃圾箱
/// </summary> /// </summary>
/// <param name="userName"></param> /// <param name="userName"></param>
/// <returns></returns> /// <returns></returns>
public static IEnumerable<Message> Trash(string userName) => DbContextManager.Create<Message>().Trash(userName); public static IEnumerable<Message> Trash(string userName) => DbContextManager.Create<Message>().Trash(userName);
/// <summary> /// <summary>
/// 标旗 /// 标旗
/// </summary> /// </summary>
/// <param name="userName"></param> /// <param name="userName"></param>
/// <returns></returns> /// <returns></returns>
public static IEnumerable<Message> Mark(string userName) => DbContextManager.Create<Message>().Mark(userName); public static IEnumerable<Message> Mark(string userName) => DbContextManager.Create<Message>().Mark(userName);
/// <summary> /// <summary>
/// 获取Header处显示的消息列表 /// 获取Header处显示的消息列表
/// </summary> /// </summary>
@ -44,6 +49,11 @@ namespace Bootstrap.DataAccess
/// <returns></returns> /// <returns></returns>
public static IEnumerable<Message> Retrieves(string userName) => CacheManager.GetOrAdd(RetrieveMessageDataKey, key => DbContextManager.Create<Message>().RetrieveHeaders(userName).OrderByDescending(n => n.SendTime)); public static IEnumerable<Message> Retrieves(string userName) => CacheManager.GetOrAdd(RetrieveMessageDataKey, key => DbContextManager.Create<Message>().RetrieveHeaders(userName).OrderByDescending(n => n.SendTime));
/// <summary>
///
/// </summary>
/// <param name="msg"></param>
/// <returns></returns>
public static bool Save(Message msg) public static bool Save(Message msg)
{ {
if (string.IsNullOrEmpty(msg.Id)) msg.Id = null; if (string.IsNullOrEmpty(msg.Id)) msg.Id = null;

View File

@ -11,11 +11,29 @@ namespace Bootstrap.DataAccess
/// </summary> /// </summary>
public static class RoleHelper public static class RoleHelper
{ {
/// <summary>
///
/// </summary>
public const string RetrieveRolesDataKey = "RoleHelper-RetrieveRoles"; public const string RetrieveRolesDataKey = "RoleHelper-RetrieveRoles";
/// <summary>
///
/// </summary>
public const string RetrieveRolesByUserIdDataKey = "RoleHelper-RetrieveRolesByUserId"; public const string RetrieveRolesByUserIdDataKey = "RoleHelper-RetrieveRolesByUserId";
/// <summary>
///
/// </summary>
public const string RetrieveRolesByMenuIdDataKey = "RoleHelper-RetrieveRolesByMenuId"; public const string RetrieveRolesByMenuIdDataKey = "RoleHelper-RetrieveRolesByMenuId";
/// <summary>
///
/// </summary>
public const string RetrieveRolesByGroupIdDataKey = "RoleHelper-RetrieveRolesByGroupId"; public const string RetrieveRolesByGroupIdDataKey = "RoleHelper-RetrieveRolesByGroupId";
/// <summary>
///
/// </summary>
public const string RetrieveRolesByUserNameDataKey = "RoleHelper-RetrieveRolesByUserName"; public const string RetrieveRolesByUserNameDataKey = "RoleHelper-RetrieveRolesByUserName";
/// <summary>
///
/// </summary>
public const string RetrieveRolesByUrlDataKey = "RoleHelper-RetrieveRolesByUrl"; public const string RetrieveRolesByUrlDataKey = "RoleHelper-RetrieveRolesByUrl";
/// <summary> /// <summary>

View File

@ -8,6 +8,9 @@ using System.Collections.Generic;
namespace Bootstrap.DataAccess namespace Bootstrap.DataAccess
{ {
/// <summary>
///
/// </summary>
public static class TraceHelper public static class TraceHelper
{ {

View File

@ -13,10 +13,25 @@ namespace Bootstrap.DataAccess
/// </summary> /// </summary>
public static class UserHelper public static class UserHelper
{ {
/// <summary>
///
/// </summary>
public const string RetrieveUsersDataKey = "UserHelper-RetrieveUsers"; public const string RetrieveUsersDataKey = "UserHelper-RetrieveUsers";
/// <summary>
///
/// </summary>
public const string RetrieveUsersByRoleIdDataKey = "UserHelper-RetrieveUsersByRoleId"; public const string RetrieveUsersByRoleIdDataKey = "UserHelper-RetrieveUsersByRoleId";
/// <summary>
///
/// </summary>
public const string RetrieveUsersByGroupIdDataKey = "UserHelper-RetrieveUsersByGroupId"; public const string RetrieveUsersByGroupIdDataKey = "UserHelper-RetrieveUsersByGroupId";
/// <summary>
///
/// </summary>
public const string RetrieveNewUsersDataKey = "UserHelper-RetrieveNewUsers"; public const string RetrieveNewUsersDataKey = "UserHelper-RetrieveNewUsers";
/// <summary>
///
/// </summary>
public const string RetrieveUsersByNameDataKey = "BootstrapUser-RetrieveUsersByName"; public const string RetrieveUsersByNameDataKey = "BootstrapUser-RetrieveUsersByName";
private static bool UserChecker(User user) private static bool UserChecker(User user)