mirror of
https://github.com/anjoy8/Blog.Core.git
synced 2024-09-20 23:48:27 +08:00
vue.admin : add permission repository&service
This commit is contained in:
parent
f152067f89
commit
a575eedf8b
9
Blog.Core.IRepository/IModulePermissionRepository.cs
Normal file
9
Blog.Core.IRepository/IModulePermissionRepository.cs
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
namespace Blog.Core.IRepository
|
||||||
|
{
|
||||||
|
using Blog.Core.IRepository.Base;
|
||||||
|
using Blog.Core.Model.Models;
|
||||||
|
|
||||||
|
public partial interface IModulePermissionRepository : IBaseRepository<ModulePermission>//类名
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
10
Blog.Core.IRepository/IPermissionRepository.cs
Normal file
10
Blog.Core.IRepository/IPermissionRepository.cs
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
using Blog.Core.IRepository.Base;
|
||||||
|
using Blog.Core.Model.Models;
|
||||||
|
|
||||||
|
namespace Blog.Core.IRepository
|
||||||
|
{
|
||||||
|
public partial interface IPermissionRepository : IBaseRepository<Permission>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
9
Blog.Core.IServices/IModulePermissionServices.cs
Normal file
9
Blog.Core.IServices/IModulePermissionServices.cs
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
using Blog.Core.IServices.BASE;
|
||||||
|
using Blog.Core.Model.Models;
|
||||||
|
|
||||||
|
namespace Blog.Core.IServices
|
||||||
|
{
|
||||||
|
public partial interface IModulePermissionServices : IBaseServices<ModulePermission>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
8
Blog.Core.IServices/IPermissionServices.cs
Normal file
8
Blog.Core.IServices/IPermissionServices.cs
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
using Blog.Core.IServices.BASE;
|
||||||
|
using Blog.Core.Model.Models;
|
||||||
|
namespace Blog.Core.IServices
|
||||||
|
{
|
||||||
|
public partial interface IPermissionServices : IBaseServices<Permission>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
||||||
namespace Blog.Core.Model.Models
|
namespace Blog.Core.Model.Models
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 按钮表
|
/// 路由菜单表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Permission : RootEntity
|
public class Permission : RootEntity
|
||||||
{
|
{
|
||||||
|
@ -18,21 +18,27 @@ namespace Blog.Core.Model.Models
|
||||||
//this.RoleModulePermission = new List<RoleModulePermission>();
|
//this.RoleModulePermission = new List<RoleModulePermission>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///获取或设置是否禁用,逻辑上的删除,非物理删除
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(IsNullable = true)]
|
|
||||||
public bool? IsDeleted { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 菜单执行Action名
|
/// 菜单执行Action名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(Length = 50, IsNullable = true)]
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
public string Code { get; set; }
|
public string Code { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 菜单名
|
/// 菜单显示名(如用户页、编辑(按钮)、删除(按钮))
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(Length = 50, IsNullable = true)]
|
[SugarColumn(Length = 50, IsNullable = true)]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否是按钮
|
||||||
|
/// </summary>
|
||||||
|
public bool IsButton { get; set; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 上一级菜单(0表示上一级无菜单)
|
||||||
|
/// </summary>
|
||||||
|
public int Pid { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 排序
|
/// 排序
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -82,6 +88,12 @@ namespace Blog.Core.Model.Models
|
||||||
[SugarColumn(IsNullable = true)]
|
[SugarColumn(IsNullable = true)]
|
||||||
public DateTime? ModifyTime { get; set; }
|
public DateTime? ModifyTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///获取或设置是否禁用,逻辑上的删除,非物理删除
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public bool? IsDeleted { get; set; }
|
||||||
|
|
||||||
//public virtual ICollection<ModulePermission> ModulePermission { get; set; }
|
//public virtual ICollection<ModulePermission> ModulePermission { get; set; }
|
||||||
//public virtual ICollection<RoleModulePermission> RoleModulePermission { get; set; }
|
//public virtual ICollection<RoleModulePermission> RoleModulePermission { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,9 +20,11 @@ namespace Blog.Core.Model.Models
|
||||||
// 注意!一定要手动先创建要给空的数据库
|
// 注意!一定要手动先创建要给空的数据库
|
||||||
// 会覆盖,可以设置为true,来备份数据
|
// 会覆盖,可以设置为true,来备份数据
|
||||||
// 如果生成过了,第二次,就不用再执行一遍了,注释掉该方法即可
|
// 如果生成过了,第二次,就不用再执行一遍了,注释掉该方法即可
|
||||||
myContext.CreateTableByEntity(false, typeof(Advertisement), typeof(BlogArticle), typeof(Guestbook), typeof(Module), typeof(ModulePermission), typeof(OperateLog), typeof(PasswordLib), typeof(Permission), typeof(Role), typeof(RoleModulePermission), typeof(sysUserInfo), typeof(Topic), typeof(TopicDetail), typeof(UserRole));
|
//myContext.CreateTableByEntity(false, typeof(Advertisement), typeof(BlogArticle), typeof(Guestbook), typeof(Module), typeof(ModulePermission), typeof(OperateLog), typeof(PasswordLib), typeof(Permission), typeof(Role), typeof(RoleModulePermission), typeof(sysUserInfo), typeof(Topic), typeof(TopicDetail), typeof(UserRole));
|
||||||
|
|
||||||
//myContext.Db.CodeFirst.InitTables(typeof(sysUserInfo)); // 后期单独处理某些表
|
// 后期单独处理某些表
|
||||||
|
//myContext.Db.CodeFirst.InitTables(typeof(sysUserInfo));
|
||||||
|
//myContext.Db.CodeFirst.InitTables(typeof(Permission));
|
||||||
|
|
||||||
|
|
||||||
#region Advertisement
|
#region Advertisement
|
||||||
|
|
15
Blog.Core.Repository/ModulePermissionRepository.cs
Normal file
15
Blog.Core.Repository/ModulePermissionRepository.cs
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Blog.Core.IRepository;
|
||||||
|
using Blog.Core.Model.Models;
|
||||||
|
using Blog.Core.Repository.Base;
|
||||||
|
|
||||||
|
namespace Blog.Core.Repository
|
||||||
|
{
|
||||||
|
public class ModulePermissionRepository : BaseRepository<ModulePermission>, IModulePermissionRepository
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
15
Blog.Core.Repository/PermissionRepository.cs
Normal file
15
Blog.Core.Repository/PermissionRepository.cs
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Blog.Core.IRepository;
|
||||||
|
using Blog.Core.Model.Models;
|
||||||
|
using Blog.Core.Repository.Base;
|
||||||
|
|
||||||
|
namespace Blog.Core.Repository
|
||||||
|
{
|
||||||
|
public class PermissionRepository : BaseRepository<Permission>, IPermissionRepository
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
22
Blog.Core.Services/ModulePermissionServices.cs
Normal file
22
Blog.Core.Services/ModulePermissionServices.cs
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
using Blog.Core.Services.BASE;
|
||||||
|
using Blog.Core.Model.Models;
|
||||||
|
using Blog.Core.IRepository;
|
||||||
|
using Blog.Core.IServices;
|
||||||
|
|
||||||
|
namespace Blog.Core.Services
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ModulePermissionServices
|
||||||
|
/// </summary>
|
||||||
|
public class ModulePermissionServices : BaseServices<ModulePermission>, IModulePermissionServices
|
||||||
|
{
|
||||||
|
|
||||||
|
IModulePermissionRepository dal;
|
||||||
|
public ModulePermissionServices(IModulePermissionRepository dal)
|
||||||
|
{
|
||||||
|
this.dal = dal;
|
||||||
|
base.baseDal = dal;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
22
Blog.Core.Services/PermissionServices.cs
Normal file
22
Blog.Core.Services/PermissionServices.cs
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
using Blog.Core.Services.BASE;
|
||||||
|
using Blog.Core.Model.Models;
|
||||||
|
using Blog.Core.IRepository;
|
||||||
|
using Blog.Core.IServices;
|
||||||
|
|
||||||
|
namespace Blog.Core.Services
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// PermissionServices
|
||||||
|
/// </summary>
|
||||||
|
public class PermissionServices : BaseServices<Permission>, IPermissionServices
|
||||||
|
{
|
||||||
|
|
||||||
|
IPermissionRepository dal;
|
||||||
|
public PermissionServices(IPermissionRepository dal)
|
||||||
|
{
|
||||||
|
this.dal = dal;
|
||||||
|
base.baseDal = dal;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -69,7 +69,7 @@
|
||||||
创建时间
|
创建时间
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<!-- 对于成员“T:Blog.Core.Model.Models.BlogArticle”忽略有格式错误的 XML 注释 -->
|
<!-- Badly formed XML comment ignored for member "T:Blog.Core.Model.Models.BlogArticle" -->
|
||||||
<member name="P:Blog.Core.Model.Models.BlogArticle.bID">
|
<member name="P:Blog.Core.Model.Models.BlogArticle.bID">
|
||||||
<summary>
|
<summary>
|
||||||
主键
|
主键
|
||||||
|
@ -373,14 +373,9 @@
|
||||||
</member>
|
</member>
|
||||||
<member name="T:Blog.Core.Model.Models.Permission">
|
<member name="T:Blog.Core.Model.Models.Permission">
|
||||||
<summary>
|
<summary>
|
||||||
按钮表
|
路由菜单表
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Blog.Core.Model.Models.Permission.IsDeleted">
|
|
||||||
<summary>
|
|
||||||
获取或设置是否禁用,逻辑上的删除,非物理删除
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:Blog.Core.Model.Models.Permission.Code">
|
<member name="P:Blog.Core.Model.Models.Permission.Code">
|
||||||
<summary>
|
<summary>
|
||||||
菜单执行Action名
|
菜单执行Action名
|
||||||
|
@ -388,7 +383,17 @@
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Blog.Core.Model.Models.Permission.Name">
|
<member name="P:Blog.Core.Model.Models.Permission.Name">
|
||||||
<summary>
|
<summary>
|
||||||
菜单名
|
菜单显示名(如用户页、编辑(按钮)、删除(按钮))
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Blog.Core.Model.Models.Permission.IsButton">
|
||||||
|
<summary>
|
||||||
|
是否是按钮
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Blog.Core.Model.Models.Permission.Pid">
|
||||||
|
<summary>
|
||||||
|
上一级菜单(0表示上一级无菜单)
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Blog.Core.Model.Models.Permission.OrderSort">
|
<member name="P:Blog.Core.Model.Models.Permission.OrderSort">
|
||||||
|
@ -441,6 +446,11 @@
|
||||||
修改时间
|
修改时间
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:Blog.Core.Model.Models.Permission.IsDeleted">
|
||||||
|
<summary>
|
||||||
|
获取或设置是否禁用,逻辑上的删除,非物理删除
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:Blog.Core.Model.Models.Role">
|
<member name="T:Blog.Core.Model.Models.Role">
|
||||||
<summary>
|
<summary>
|
||||||
角色表
|
角色表
|
||||||
|
@ -616,8 +626,8 @@
|
||||||
登录账号
|
登录账号
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<!-- 对于成员“T:Blog.Core.Model.Models.Topic”忽略有格式错误的 XML 注释 -->
|
<!-- Badly formed XML comment ignored for member "T:Blog.Core.Model.Models.Topic" -->
|
||||||
<!-- 对于成员“T:Blog.Core.Model.Models.TopicDetail”忽略有格式错误的 XML 注释 -->
|
<!-- Badly formed XML comment ignored for member "T:Blog.Core.Model.Models.TopicDetail" -->
|
||||||
<member name="T:Blog.Core.Model.Models.UserRole">
|
<member name="T:Blog.Core.Model.Models.UserRole">
|
||||||
<summary>
|
<summary>
|
||||||
用户跟角色关联表
|
用户跟角色关联表
|
||||||
|
|
Loading…
Reference in New Issue
Block a user