doc: 格式化文档

This commit is contained in:
Argo-Tianyi 2021-12-30 13:31:40 +08:00
parent eea8838963
commit 39aa8bfd1d
28 changed files with 1150 additions and 1176 deletions

View File

@ -1,13 +1,13 @@
using BootstrapAdmin.DataAccess.Models;
using Microsoft.EntityFrameworkCore;
namespace BootstrapAdmin.DataAccess.EFCore
namespace BootstrapAdmin.DataAccess.EFCore;
/// <summary>
///
/// </summary>
public class BootstrapAdminContext : DbContext
{
/// <summary>
///
/// </summary>
public class BootstrapAdminContext : DbContext
{
/// <summary>
/// 构造函数
/// </summary>
@ -46,5 +46,4 @@ namespace BootstrapAdmin.DataAccess.EFCore
modelBuilder.Entity<User>().Ignore(u => u.CofirmPassword);
modelBuilder.Entity<User>().Ignore(u => u.IsReset);
}
}
}

View File

@ -4,13 +4,13 @@ using BootstrapAdmin.Web.Core;
using BootstrapBlazor.Components;
using Microsoft.EntityFrameworkCore;
namespace Microsoft.Extensions.DependencyInjection
namespace Microsoft.Extensions.DependencyInjection;
/// <summary>
///
/// </summary>
public static class ServicesExtensions
{
/// <summary>
///
/// </summary>
public static class ServicesExtensions
{
/// <summary>
///
/// </summary>
@ -49,5 +49,4 @@ namespace Microsoft.Extensions.DependencyInjection
services.AddSingleton<IDict, DictService>();
return services;
}
}
}

View File

@ -5,13 +5,13 @@
using BootstrapBlazor.Components;
using Microsoft.EntityFrameworkCore;
namespace BootstrapAdmin.DataAccess.EFCore.Services
namespace BootstrapAdmin.DataAccess.EFCore.Services;
/// <summary>
/// EFCore ORM 的 IDataService 接口实现
/// </summary>
class DefaultDataService<TModel> : DataServiceBase<TModel> where TModel : class, new()
{
/// <summary>
/// EFCore ORM 的 IDataService 接口实现
/// </summary>
class DefaultDataService<TModel> : DataServiceBase<TModel> where TModel : class, new()
{
private IDbContextFactory<BootstrapAdminContext> DbFactory { get; }
/// <summary>
@ -91,5 +91,4 @@ namespace BootstrapAdmin.DataAccess.EFCore.Services
}
return Task.FromResult(ret);
}
}
}

View File

@ -2,10 +2,10 @@
using BootstrapAdmin.Web.Core;
using BootstrapBlazor.Components;
namespace BootstrapAdmin.DataAccess.EFCore.Services
namespace BootstrapAdmin.DataAccess.EFCore.Services;
class DictService : IDict
{
class DictService : IDict
{
public Dictionary<string, string> GetApps()
{
throw new NotImplementedException();
@ -50,5 +50,4 @@ namespace BootstrapAdmin.DataAccess.EFCore.Services
{
throw new NotImplementedException();
}
}
}

View File

@ -2,13 +2,13 @@
using BootstrapAdmin.DataAccess.Models;
using Microsoft.EntityFrameworkCore;
namespace BootstrapAdmin.DataAccess.EFCore.Services
namespace BootstrapAdmin.DataAccess.EFCore.Services;
/// <summary>
///
/// </summary>
class NavigationsService : INavigation
{
/// <summary>
///
/// </summary>
class NavigationsService : INavigation
{
private IDbContextFactory<BootstrapAdminContext> DbFactory { get; set; }
/// <summary>
@ -38,5 +38,4 @@ namespace BootstrapAdmin.DataAccess.EFCore.Services
{
throw new NotImplementedException();
}
}
}

View File

@ -1,12 +1,12 @@
using System.ComponentModel;
namespace BootstrapAdmin.DataAccess.Models
namespace BootstrapAdmin.DataAccess.Models;
/// <summary>
/// 后台数据库脚本执行日志实体类
/// </summary>
public class DBLog
{
/// <summary>
/// 后台数据库脚本执行日志实体类
/// </summary>
public class DBLog
{
/// <summary>
/// 获得/设置 主键ID
/// </summary>
@ -29,5 +29,4 @@ namespace BootstrapAdmin.DataAccess.Models
/// </summary>
[DisplayName("执行时间")]
public DateTime LogTime { get; set; }
}
}

View File

@ -2,13 +2,13 @@
using System.ComponentModel.DataAnnotations;
namespace BootstrapAdmin.DataAccess.Models
namespace BootstrapAdmin.DataAccess.Models;
/// <summary>
/// 字典配置项
/// </summary>
public class Dict
{
/// <summary>
/// 字典配置项
/// </summary>
public class Dict
{
/// <summary>
/// 获得/设置 字典主键 数据库自增列
/// </summary>
@ -40,5 +40,4 @@ namespace BootstrapAdmin.DataAccess.Models
/// </summary>
[Display(Name = "字典类型")]
public EnumDictDefine Define { get; set; } = EnumDictDefine.Customer;
}
}

View File

@ -1,12 +1,12 @@
using System.ComponentModel;
namespace BootstrapAdmin.DataAccess.Models
namespace BootstrapAdmin.DataAccess.Models;
/// <summary>
/// 字典定义值 0 表示系统使用1 表示用户自定义 默认为 1
/// </summary>
public enum EnumDictDefine
{
/// <summary>
/// 字典定义值 0 表示系统使用1 表示用户自定义 默认为 1
/// </summary>
public enum EnumDictDefine
{
/// <summary>
/// 系统使用
/// </summary>
@ -18,5 +18,4 @@ namespace BootstrapAdmin.DataAccess.Models
/// </summary>
[Description("自定义")]
Customer
}
}

View File

@ -1,12 +1,12 @@
using System.ComponentModel;
namespace BootstrapAdmin.DataAccess.Models
namespace BootstrapAdmin.DataAccess.Models;
/// <summary>
/// 菜单分类 0 表示系统菜单 1 表示用户自定义菜单
/// </summary>
public enum EnumNavigationCategory
{
/// <summary>
/// 菜单分类 0 表示系统菜单 1 表示用户自定义菜单
/// </summary>
public enum EnumNavigationCategory
{
/// <summary>
/// 系统使用
/// </summary>
@ -18,5 +18,4 @@ namespace BootstrapAdmin.DataAccess.Models
/// </summary>
[Description("自定义")]
Customer
}
}

View File

@ -1,12 +1,12 @@
using System.ComponentModel;
namespace BootstrapAdmin.DataAccess.Models
namespace BootstrapAdmin.DataAccess.Models;
/// <summary>
/// 资源类型枚举 0 表示菜单 1 表示资源 2 表示按钮
/// </summary>
public enum EnumResource
{
/// <summary>
/// 资源类型枚举 0 表示菜单 1 表示资源 2 表示按钮
/// </summary>
public enum EnumResource
{
/// <summary>
///
/// </summary>
@ -22,5 +22,4 @@ namespace BootstrapAdmin.DataAccess.Models
/// </summary>
[Description("代码块")]
Block
}
}

View File

@ -1,12 +1,12 @@
using System.ComponentModel.DataAnnotations;
namespace BootstrapAdmin.DataAccess.Models
namespace BootstrapAdmin.DataAccess.Models;
/// <summary>
/// Group 实体类
/// </summary>
public class Group
{
/// <summary>
/// Group 实体类
/// </summary>
public class Group
{
/// <summary>
/// 获得/设置 主键 ID
/// </summary>
@ -33,5 +33,4 @@ namespace BootstrapAdmin.DataAccess.Models
public string? Description { get; set; }
public override string ToString() => $"{GroupName} ({GroupCode})";
}
}

View File

@ -1,12 +1,12 @@
using System.ComponentModel;
namespace Bootstrap.DataAccess
namespace Bootstrap.DataAccess;
/// <summary>
/// 登录用户信息实体类
/// </summary>
public class LoginLog
{
/// <summary>
/// 登录用户信息实体类
/// </summary>
public class LoginLog
{
/// <summary>
/// 获得/设置 Id
/// </summary>
@ -59,5 +59,4 @@ namespace Bootstrap.DataAccess
/// </summary>
[DisplayName("登录名称")]
public string UserAgent { get; set; } = "";
}
}

View File

@ -2,13 +2,13 @@
using System.ComponentModel.DataAnnotations;
namespace BootstrapAdmin.DataAccess.Models
namespace BootstrapAdmin.DataAccess.Models;
/// <summary>
/// Bootstrap Admin 后台管理菜单相关操作实体类
/// </summary>
public class Navigation
{
/// <summary>
/// Bootstrap Admin 后台管理菜单相关操作实体类
/// </summary>
public class Navigation
{
/// <summary>
/// 获得/设置 菜单主键ID
/// </summary>
@ -73,5 +73,4 @@ namespace BootstrapAdmin.DataAccess.Models
///
/// </summary>
public bool HasChildren { get; set; }
}
}

View File

@ -1,13 +1,13 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace BootstrapAdmin.DataAccess.Models
namespace BootstrapAdmin.DataAccess.Models;
/// <summary>
/// Role 实体类
/// </summary>
public class Role
{
/// <summary>
/// Role 实体类
/// </summary>
public class Role
{
/// <summary>
/// 获得/设置 角色主键ID
/// </summary>
@ -26,5 +26,4 @@ namespace BootstrapAdmin.DataAccess.Models
[DisplayName("角色描述")]
[NotNull]
public string? Description { get; set; }
}
}

View File

@ -1,12 +1,12 @@
using System.ComponentModel.DataAnnotations;
namespace BootstrapAdmin.DataAccess.Models
namespace BootstrapAdmin.DataAccess.Models;
/// <summary>
///
/// </summary>
public class User
{
/// <summary>
///
/// </summary>
public class User
{
/// <summary>
/// 获得/设置 系统登录用户名
/// </summary>
@ -112,13 +112,13 @@ namespace BootstrapAdmin.DataAccess.Models
/// </summary>
/// <returns></returns>
public override string ToString() => $"{DisplayName} ({UserName})";
}
}
/// <summary>
/// 用户状态枚举类型
/// </summary>
public enum UserStates
{
/// <summary>
/// 用户状态枚举类型
/// </summary>
public enum UserStates
{
/// <summary>
/// 更改密码
/// </summary>
@ -148,5 +148,4 @@ namespace BootstrapAdmin.DataAccess.Models
/// 保存默认应用
/// </summary>
SaveApp
}
}

View File

@ -1,13 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<PackageReference Include="BootstrapBlazor" Version="6.1.1" />
<!--<PackageReference Include="BootstrapBlazor" Version="6.1.1" />-->
<PackageReference Include="Longbow.Security.Cryptography" Version="5.2.0" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.0" />
<PackageReference Include="PetaPoco.Extensions" Version="5.2.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\BootstrapBlazor\src\BootstrapBlazor\BootstrapBlazor.csproj" />
<ProjectReference Include="..\BootstrapAdmin.Web.Core\BootstrapAdmin.Web.Core.csproj" />
</ItemGroup>

View File

@ -2,10 +2,10 @@
using PetaPoco;
using System.Reflection;
namespace BootstrapAdmin.DataAccess.PetaPoco
namespace BootstrapAdmin.DataAccess.PetaPoco;
class BootstrapAdminConventionMapper : ConventionMapper
{
class BootstrapAdminConventionMapper : ConventionMapper
{
/// <summary>
///
/// </summary>
@ -70,5 +70,4 @@ namespace BootstrapAdmin.DataAccess.PetaPoco
public override Func<object?, object?> GetToDbConverter(PropertyInfo targetProperty) => targetProperty.PropertyType.IsEnum
? new StringToEnumConverter(targetProperty.PropertyType).ConvertToDb
: base.GetToDbConverter(targetProperty);
}
}

View File

@ -1,10 +1,10 @@
namespace BootstrapAdmin.DataAccess.PetaPoco.Coverters
namespace BootstrapAdmin.DataAccess.PetaPoco.Coverters;
/// <summary>
/// 字符串转枚举转换器
/// </summary>
public class StringToEnumConverter
{
/// <summary>
/// 字符串转枚举转换器
/// </summary>
public class StringToEnumConverter
{
private Type TargetType { get; set; }
/// <summary>
@ -55,5 +55,4 @@
}
return ret;
}
}
}

View File

@ -7,13 +7,13 @@ using PetaPoco;
using System.Linq.Expressions;
using System.Reflection;
namespace BootstrapAdmin.Web.Extensions
namespace BootstrapAdmin.Web.Extensions;
/// <summary>
///
/// </summary>
public static class DatabaseExtensions
{
/// <summary>
///
/// </summary>
public static class DatabaseExtensions
{
/// <summary>
///
/// </summary>
@ -178,5 +178,4 @@ namespace BootstrapAdmin.Web.Extensions
ExpressionType.LessThanOrEqual => "<=",
_ => ""
};
}
}

View File

@ -14,13 +14,13 @@ using System.Collections.Specialized;
using System.Data.Common;
using System.Text;
namespace Microsoft.Extensions.DependencyInjection
namespace Microsoft.Extensions.DependencyInjection;
/// <summary>
///
/// </summary>
public static class ServicesExtensions
{
/// <summary>
///
/// </summary>
public static class ServicesExtensions
{
/// <summary>
///
/// </summary>
@ -75,5 +75,4 @@ namespace Microsoft.Extensions.DependencyInjection
services.AddSingleton<IApp, AppService>();
return services;
}
}
}

View File

@ -1,13 +1,12 @@
using PetaPoco;
namespace BootstrapAdmin.DataAccess.PetaPoco.Services
namespace BootstrapAdmin.DataAccess.PetaPoco.Services;
abstract class BaseDatabase
{
abstract class BaseDatabase
{
/// <summary>
///
/// </summary>
[NotNull]
protected IDatabase? Database { get; set; }
}
}

View File

@ -7,13 +7,13 @@ using BootstrapBlazor.Components;
using PetaPoco;
using PetaPoco.Extensions;
namespace BootstrapBlazor.DataAcces.PetaPoco.Services
namespace BootstrapBlazor.DataAcces.PetaPoco.Services;
/// <summary>
/// PetaPoco ORM 的 IDataService 接口实现
/// </summary>
class DefaultDataService<TModel> : DataServiceBase<TModel> where TModel : class, new()
{
/// <summary>
/// PetaPoco ORM 的 IDataService 接口实现
/// </summary>
class DefaultDataService<TModel> : DataServiceBase<TModel> where TModel : class, new()
{
private IDatabase Database { get; }
/// <summary>
@ -82,5 +82,4 @@ namespace BootstrapBlazor.DataAcces.PetaPoco.Services
}
return ret;
}
}
}

View File

@ -5,10 +5,10 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BootstrapAdmin.DataAccess.PetaPoco.Services
namespace BootstrapAdmin.DataAccess.PetaPoco.Services;
class LoginService : ILogin
{
class LoginService : ILogin
{
/// <summary>
///
/// </summary>
@ -20,5 +20,4 @@ namespace BootstrapAdmin.DataAccess.PetaPoco.Services
{
return Task.FromResult(true);
}
}
}

View File

@ -2,13 +2,13 @@
using BootstrapAdmin.Web.Core;
using PetaPoco;
namespace BootstrapAdmin.DataAccess.PetaPoco.Services
namespace BootstrapAdmin.DataAccess.PetaPoco.Services;
/// <summary>
///
/// </summary>
class NavigationService : BaseDatabase, INavigation
{
/// <summary>
///
/// </summary>
class NavigationService : BaseDatabase, INavigation
{
/// <summary>
///
/// </summary>
@ -57,5 +57,4 @@ namespace BootstrapAdmin.DataAccess.PetaPoco.Services
}
return ret;
}
}
}

View File

@ -1,13 +1,13 @@
using Bootstrap.Security.Blazor;
using BootstrapAdmin.Web.Core;
namespace BootstrapAdmin.Web.Services
namespace BootstrapAdmin.Web.Services;
/// <summary>
///
/// </summary>
public class AdminService : IBootstrapAdminService
{
/// <summary>
///
/// </summary>
public class AdminService : IBootstrapAdminService
{
private IUser User { get; set; }
private INavigation Navigations { get; set; }
@ -53,5 +53,4 @@ namespace BootstrapAdmin.Web.Services
}
return Task.FromResult(ret);
}
}
}

View File

@ -1,10 +1,10 @@
namespace BootstrapAdmin.Web.Core
namespace BootstrapAdmin.Web.Core;
/// <summary>
/// Dict 字典表接口
/// </summary>
public interface IDict
{
/// <summary>
/// Dict 字典表接口
/// </summary>
public interface IDict
{
/// <summary>
/// 获得 配置所有的 App 集合
/// </summary>
@ -60,5 +60,4 @@
/// </summary>
/// <returns></returns>
string GetWebFooter();
}
}

View File

@ -1,10 +1,10 @@
namespace BootstrapAdmin.Web.Core
namespace BootstrapAdmin.Web.Core;
/// <summary>
///
/// </summary>
public interface ILogin
{
/// <summary>
///
/// </summary>
public interface ILogin
{
/// <summary>
///
/// </summary>
@ -12,5 +12,4 @@
/// <param name="result"></param>
/// <returns></returns>
Task<bool> Log(string userName, bool result);
}
}

View File

@ -1,12 +1,12 @@
using BootstrapAdmin.DataAccess.Models;
namespace BootstrapAdmin.Web.Core
namespace BootstrapAdmin.Web.Core;
/// <summary>
///
/// </summary>
public interface INavigation
{
/// <summary>
///
/// </summary>
public interface INavigation
{
/// <summary>
///
/// </summary>
@ -26,5 +26,4 @@ namespace BootstrapAdmin.Web.Core
/// <param name="roleId"></param>
/// <returns></returns>
bool SaveMenusByRoleId(string? roleId, List<string> menuIds);
}
}