style: 增加xml注释
This commit is contained in:
parent
a25ae6e265
commit
50f23827d8
|
@ -3,13 +3,25 @@ using Microsoft.AspNetCore.Hosting;
|
|||
|
||||
namespace Bootstrap.Client
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
CreateWebHostBuilder(args).Build().Run();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
/// <returns></returns>
|
||||
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
|
||||
WebHost.CreateDefaultBuilder(args)
|
||||
.UseStartup<Startup>();
|
||||
|
|
|
@ -14,16 +14,30 @@ using System;
|
|||
|
||||
namespace Bootstrap.Client
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class Startup
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="configuration"></param>
|
||||
public Startup(IConfiguration configuration)
|
||||
{
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public IConfiguration Configuration { get; }
|
||||
|
||||
// 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)
|
||||
{
|
||||
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.
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="app"></param>
|
||||
/// <param name="env"></param>
|
||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
|
||||
{
|
||||
if (env.IsDevelopment())
|
||||
|
|
|
@ -5,6 +5,9 @@ using System.Linq;
|
|||
|
||||
namespace Bootstrap.DataAccess.MongoDB
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class App : DataAccess.App
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -86,8 +86,6 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
/// <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)));
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -27,6 +27,9 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
///
|
||||
/// </summary>
|
||||
/// <param name="po"></param>
|
||||
/// <param name="startTime"></param>
|
||||
/// <param name="endTime"></param>
|
||||
/// <param name="ip"></param>
|
||||
/// <returns></returns>
|
||||
public override Page<DataAccess.LoginUser> RetrieveByPages(PaginationOption po, DateTime? startTime, DateTime? endTime, string ip)
|
||||
{
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
namespace Bootstrap.DataAccess.MongoDB
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class RejectUser
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -9,16 +12,34 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
/// </summary>
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string UserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string DisplayName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public DateTime RegisterTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string RejectedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public DateTime RejectedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string RejectedReason { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public override IEnumerable<DataAccess.Role> Retrieves()
|
||||
{
|
||||
|
|
|
@ -58,6 +58,12 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
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)
|
||||
{
|
||||
var update = Builders<User>.Update.Set(u => u.App, app);
|
||||
|
|
|
@ -6,6 +6,9 @@ using System.Linq;
|
|||
|
||||
namespace Bootstrap.DataAccess
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class App
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace Bootstrap.DataAccess
|
|||
///
|
||||
/// </summary>
|
||||
/// <param name="connectionName"></param>
|
||||
/// <param name="keepAlive"></param>
|
||||
/// <returns></returns>
|
||||
public static IDatabase Create(string connectionName = null, bool keepAlive = false)
|
||||
{
|
||||
|
|
|
@ -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
|
|||
/// <summary>
|
||||
/// 查询所有群组信息
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public virtual IEnumerable<Group> Retrieves() => DbManager.Create().Fetch<Group>();
|
||||
|
||||
/// <summary>
|
||||
/// 删除群组信息
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <param name="value"></param>
|
||||
public virtual bool Delete(IEnumerable<string> value)
|
||||
{
|
||||
bool ret = false;
|
||||
|
|
|
@ -4,8 +4,14 @@ using System.Collections.Generic;
|
|||
|
||||
namespace Bootstrap.DataAccess
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class AppHelper
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const string RetrieveAppsByRoleIdDataKey = "AppHelper-RetrieveAppsByRoleId";
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using Longbow.Cache;
|
||||
using Longbow.Cache;
|
||||
using Longbow.Data;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
@ -9,9 +9,21 @@ namespace Bootstrap.DataAccess
|
|||
/// </summary>
|
||||
public static class GroupHelper
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const string RetrieveGroupsDataKey = "GroupHelper-RetrieveGroups";
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const string RetrieveGroupsByUserIdDataKey = "GroupHelper-RetrieveGroupsByUserId";
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const string RetrieveGroupsByRoleIdDataKey = "GroupHelper-RetrieveGroupsByRoleId";
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const string RetrieveGroupsByUserNameDataKey = "GroupHelper-RetrieveGroupsByUserName";
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -15,6 +15,9 @@ namespace Bootstrap.DataAccess
|
|||
/// 查询所有日志信息
|
||||
/// </summary>
|
||||
/// <param name="op"></param>
|
||||
/// <param name="startTime"></param>
|
||||
/// <param name="endTime"></param>
|
||||
/// <param name="opType"></param>
|
||||
/// <returns></returns>
|
||||
public static Page<Log> RetrievePages(PaginationOption op, DateTime? startTime, DateTime? endTime, string opType) => DbContextManager.Create<Log>().RetrievePages(op, startTime, endTime, opType);
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Bootstrap.DataAccess
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="user"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Log(LoginUser user)
|
||||
{
|
||||
|
|
|
@ -14,29 +14,34 @@ namespace Bootstrap.DataAccess
|
|||
///
|
||||
/// </summary>
|
||||
public const string RetrieveMessageDataKey = "MessageHelper-RetrieveMessages";
|
||||
|
||||
/// <summary>
|
||||
/// 收件箱
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
public static IEnumerable<Message> Inbox(string userName) => DbContextManager.Create<Message>().Inbox(userName);
|
||||
|
||||
/// <summary>
|
||||
/// 发件箱
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<Message> SendMail(string userName) => DbContextManager.Create<Message>().SendMail(userName);
|
||||
|
||||
/// <summary>
|
||||
/// 垃圾箱
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<Message> Trash(string userName) => DbContextManager.Create<Message>().Trash(userName);
|
||||
|
||||
/// <summary>
|
||||
/// 标旗
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<Message> Mark(string userName) => DbContextManager.Create<Message>().Mark(userName);
|
||||
|
||||
/// <summary>
|
||||
/// 获取Header处显示的消息列表
|
||||
/// </summary>
|
||||
|
@ -44,6 +49,11 @@ namespace Bootstrap.DataAccess
|
|||
/// <returns></returns>
|
||||
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)
|
||||
{
|
||||
if (string.IsNullOrEmpty(msg.Id)) msg.Id = null;
|
||||
|
|
|
@ -11,11 +11,29 @@ namespace Bootstrap.DataAccess
|
|||
/// </summary>
|
||||
public static class RoleHelper
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const string RetrieveRolesDataKey = "RoleHelper-RetrieveRoles";
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const string RetrieveRolesByUserIdDataKey = "RoleHelper-RetrieveRolesByUserId";
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const string RetrieveRolesByMenuIdDataKey = "RoleHelper-RetrieveRolesByMenuId";
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const string RetrieveRolesByGroupIdDataKey = "RoleHelper-RetrieveRolesByGroupId";
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const string RetrieveRolesByUserNameDataKey = "RoleHelper-RetrieveRolesByUserName";
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const string RetrieveRolesByUrlDataKey = "RoleHelper-RetrieveRolesByUrl";
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -8,6 +8,9 @@ using System.Collections.Generic;
|
|||
|
||||
namespace Bootstrap.DataAccess
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class TraceHelper
|
||||
{
|
||||
|
||||
|
|
|
@ -13,10 +13,25 @@ namespace Bootstrap.DataAccess
|
|||
/// </summary>
|
||||
public static class UserHelper
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const string RetrieveUsersDataKey = "UserHelper-RetrieveUsers";
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const string RetrieveUsersByRoleIdDataKey = "UserHelper-RetrieveUsersByRoleId";
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const string RetrieveUsersByGroupIdDataKey = "UserHelper-RetrieveUsersByGroupId";
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const string RetrieveNewUsersDataKey = "UserHelper-RetrieveNewUsers";
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const string RetrieveUsersByNameDataKey = "BootstrapUser-RetrieveUsersByName";
|
||||
|
||||
private static bool UserChecker(User user)
|
||||
|
|
Loading…
Reference in New Issue