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
|
||||
{
|
||||
/// <summary>
|
||||
/// 按钮表
|
||||
/// 路由菜单表
|
||||
/// </summary>
|
||||
public class Permission : RootEntity
|
||||
{
|
||||
|
@ -18,21 +18,27 @@ namespace Blog.Core.Model.Models
|
|||
//this.RoleModulePermission = new List<RoleModulePermission>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///获取或设置是否禁用,逻辑上的删除,非物理删除
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = true)]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 菜单执行Action名
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50, IsNullable = true)]
|
||||
public string Code { get; set; }
|
||||
/// <summary>
|
||||
/// 菜单名
|
||||
/// 菜单显示名(如用户页、编辑(按钮)、删除(按钮))
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50, IsNullable = true)]
|
||||
public string Name { get; set; }
|
||||
/// <summary>
|
||||
/// 是否是按钮
|
||||
/// </summary>
|
||||
public bool IsButton { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 上一级菜单(0表示上一级无菜单)
|
||||
/// </summary>
|
||||
public int Pid { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
|
@ -82,6 +88,12 @@ namespace Blog.Core.Model.Models
|
|||
[SugarColumn(IsNullable = true)]
|
||||
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<RoleModulePermission> RoleModulePermission { get; set; }
|
||||
}
|
||||
|
|
|
@ -20,9 +20,11 @@ namespace Blog.Core.Model.Models
|
|||
// 注意!一定要手动先创建要给空的数据库
|
||||
// 会覆盖,可以设置为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
|
||||
|
|
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>
|
||||
</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">
|
||||
<summary>
|
||||
主键
|
||||
|
@ -373,12 +373,7 @@
|
|||
</member>
|
||||
<member name="T:Blog.Core.Model.Models.Permission">
|
||||
<summary>
|
||||
按钮表
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Blog.Core.Model.Models.Permission.IsDeleted">
|
||||
<summary>
|
||||
获取或设置是否禁用,逻辑上的删除,非物理删除
|
||||
路由菜单表
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Blog.Core.Model.Models.Permission.Code">
|
||||
|
@ -388,7 +383,17 @@
|
|||
</member>
|
||||
<member name="P:Blog.Core.Model.Models.Permission.Name">
|
||||
<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>
|
||||
</member>
|
||||
<member name="P:Blog.Core.Model.Models.Permission.OrderSort">
|
||||
|
@ -441,6 +446,11 @@
|
|||
修改时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Blog.Core.Model.Models.Permission.IsDeleted">
|
||||
<summary>
|
||||
获取或设置是否禁用,逻辑上的删除,非物理删除
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Blog.Core.Model.Models.Role">
|
||||
<summary>
|
||||
角色表
|
||||
|
@ -616,8 +626,8 @@
|
|||
登录账号
|
||||
</summary>
|
||||
</member>
|
||||
<!-- 对于成员“T:Blog.Core.Model.Models.Topic”忽略有格式错误的 XML 注释 -->
|
||||
<!-- 对于成员“T:Blog.Core.Model.Models.TopicDetail”忽略有格式错误的 XML 注释 -->
|
||||
<!-- Badly formed XML comment ignored for member "T:Blog.Core.Model.Models.Topic" -->
|
||||
<!-- Badly formed XML comment ignored for member "T:Blog.Core.Model.Models.TopicDetail" -->
|
||||
<member name="T:Blog.Core.Model.Models.UserRole">
|
||||
<summary>
|
||||
用户跟角色关联表
|
||||
|
|
Loading…
Reference in New Issue
Block a user