mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-19 01:58:01 +08:00
调整了一下项目框架与前端JS代码
This commit is contained in:
49
OpenAuth.Repository/Models/Mapping/ButtonMap.cs
Normal file
49
OpenAuth.Repository/Models/Mapping/ButtonMap.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System.Data.Entity.ModelConfiguration;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class ButtonMap : EntityTypeConfiguration<Button>
|
||||
{
|
||||
public ButtonMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.ButtonId);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.ButtonId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.FullName)
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.Img)
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.Event)
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.Control_ID)
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.Category)
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.Description)
|
||||
.HasMaxLength(50);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("Button");
|
||||
this.Property(t => t.ButtonId).HasColumnName("ButtonId");
|
||||
this.Property(t => t.FullName).HasColumnName("FullName");
|
||||
this.Property(t => t.Img).HasColumnName("Img");
|
||||
this.Property(t => t.Event).HasColumnName("Event");
|
||||
this.Property(t => t.Control_ID).HasColumnName("Control_ID");
|
||||
this.Property(t => t.Category).HasColumnName("Category");
|
||||
this.Property(t => t.Description).HasColumnName("Description");
|
||||
this.Property(t => t.Enabled).HasColumnName("Enabled");
|
||||
this.Property(t => t.SortCode).HasColumnName("SortCode");
|
||||
}
|
||||
}
|
||||
}
|
33
OpenAuth.Repository/Models/Mapping/DataPermissionMap.cs
Normal file
33
OpenAuth.Repository/Models/Mapping/DataPermissionMap.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Data.Entity.ModelConfiguration;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class DataPermissionMap : EntityTypeConfiguration<DataPermission>
|
||||
{
|
||||
public DataPermissionMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.Id);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.Id)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.RoleId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.ResourceId)
|
||||
.HasMaxLength(50);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("DataPermission");
|
||||
this.Property(t => t.Id).HasColumnName("Id");
|
||||
this.Property(t => t.RoleId).HasColumnName("RoleId");
|
||||
this.Property(t => t.ResourceId).HasColumnName("ResourceId");
|
||||
this.Property(t => t.ObjectId).HasColumnName("ObjectId");
|
||||
}
|
||||
}
|
||||
}
|
38
OpenAuth.Repository/Models/Mapping/DepartmentMap.cs
Normal file
38
OpenAuth.Repository/Models/Mapping/DepartmentMap.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.Data.Entity.ModelConfiguration;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class DepartmentMap : EntityTypeConfiguration<Department>
|
||||
{
|
||||
public DepartmentMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.DepartmentId);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.DepartmentId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.ParentId)
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.FullName)
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.Description)
|
||||
.HasMaxLength(50);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("Department");
|
||||
this.Property(t => t.DepartmentId).HasColumnName("DepartmentId");
|
||||
this.Property(t => t.ParentId).HasColumnName("ParentId");
|
||||
this.Property(t => t.FullName).HasColumnName("FullName");
|
||||
this.Property(t => t.Description).HasColumnName("Description");
|
||||
this.Property(t => t.Enabled).HasColumnName("Enabled");
|
||||
this.Property(t => t.SortCode).HasColumnName("SortCode");
|
||||
this.Property(t => t.DeleteMark).HasColumnName("DeleteMark");
|
||||
}
|
||||
}
|
||||
}
|
33
OpenAuth.Repository/Models/Mapping/MenuButtonMap.cs
Normal file
33
OpenAuth.Repository/Models/Mapping/MenuButtonMap.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Data.Entity.ModelConfiguration;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class MenuButtonMap : EntityTypeConfiguration<MenuButton>
|
||||
{
|
||||
public MenuButtonMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.MenuButtonId);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.MenuButtonId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.MenuId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.ButtonId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("MenuButton");
|
||||
this.Property(t => t.MenuButtonId).HasColumnName("MenuButtonId");
|
||||
this.Property(t => t.MenuId).HasColumnName("MenuId");
|
||||
this.Property(t => t.ButtonId).HasColumnName("ButtonId");
|
||||
}
|
||||
}
|
||||
}
|
55
OpenAuth.Repository/Models/Mapping/MenuMap.cs
Normal file
55
OpenAuth.Repository/Models/Mapping/MenuMap.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using System.Data.Entity.ModelConfiguration;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class MenuMap : EntityTypeConfiguration<Menu>
|
||||
{
|
||||
public MenuMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.MenuId);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.MenuId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.ParentId)
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.FullName)
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.Description)
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.Img)
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.NavigateUrl)
|
||||
.HasMaxLength(200);
|
||||
|
||||
this.Property(t => t.FormName)
|
||||
.HasMaxLength(200);
|
||||
|
||||
this.Property(t => t.Target)
|
||||
.HasMaxLength(50);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("Menu");
|
||||
this.Property(t => t.MenuId).HasColumnName("MenuId");
|
||||
this.Property(t => t.ParentId).HasColumnName("ParentId");
|
||||
this.Property(t => t.FullName).HasColumnName("FullName");
|
||||
this.Property(t => t.Description).HasColumnName("Description");
|
||||
this.Property(t => t.Img).HasColumnName("Img");
|
||||
this.Property(t => t.Category).HasColumnName("Category");
|
||||
this.Property(t => t.NavigateUrl).HasColumnName("NavigateUrl");
|
||||
this.Property(t => t.FormName).HasColumnName("FormName");
|
||||
this.Property(t => t.Target).HasColumnName("Target");
|
||||
this.Property(t => t.IsUnfold).HasColumnName("IsUnfold");
|
||||
this.Property(t => t.Enabled).HasColumnName("Enabled");
|
||||
this.Property(t => t.SortCode).HasColumnName("SortCode");
|
||||
}
|
||||
}
|
||||
}
|
46
OpenAuth.Repository/Models/Mapping/RoleMap.cs
Normal file
46
OpenAuth.Repository/Models/Mapping/RoleMap.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System.Data.Entity.ModelConfiguration;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class RoleMap : EntityTypeConfiguration<Role>
|
||||
{
|
||||
public RoleMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.RoleId);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.RoleId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.ParentId)
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.FullName)
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.Category)
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.Description)
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.DepartmentId)
|
||||
.HasMaxLength(50);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("Role");
|
||||
this.Property(t => t.RoleId).HasColumnName("RoleId");
|
||||
this.Property(t => t.ParentId).HasColumnName("ParentId");
|
||||
this.Property(t => t.FullName).HasColumnName("FullName");
|
||||
this.Property(t => t.Category).HasColumnName("Category");
|
||||
this.Property(t => t.Description).HasColumnName("Description");
|
||||
this.Property(t => t.Enabled).HasColumnName("Enabled");
|
||||
this.Property(t => t.SortCode).HasColumnName("SortCode");
|
||||
this.Property(t => t.DeleteMark).HasColumnName("DeleteMark");
|
||||
this.Property(t => t.DepartmentId).HasColumnName("DepartmentId");
|
||||
}
|
||||
}
|
||||
}
|
38
OpenAuth.Repository/Models/Mapping/RoleMenuButtonMap.cs
Normal file
38
OpenAuth.Repository/Models/Mapping/RoleMenuButtonMap.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.Data.Entity.ModelConfiguration;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class RoleMenuButtonMap : EntityTypeConfiguration<RoleMenuButton>
|
||||
{
|
||||
public RoleMenuButtonMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.RoleMenuButtonId);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.RoleMenuButtonId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.RoleId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.MenuId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.ButtonId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("RoleMenuButton");
|
||||
this.Property(t => t.RoleMenuButtonId).HasColumnName("RoleMenuButtonId");
|
||||
this.Property(t => t.RoleId).HasColumnName("RoleId");
|
||||
this.Property(t => t.MenuId).HasColumnName("MenuId");
|
||||
this.Property(t => t.ButtonId).HasColumnName("ButtonId");
|
||||
}
|
||||
}
|
||||
}
|
33
OpenAuth.Repository/Models/Mapping/RoleMenuMap.cs
Normal file
33
OpenAuth.Repository/Models/Mapping/RoleMenuMap.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Data.Entity.ModelConfiguration;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class RoleMenuMap : EntityTypeConfiguration<RoleMenu>
|
||||
{
|
||||
public RoleMenuMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.RoleMenuId);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.RoleMenuId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.RoleId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.MenuId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("RoleMenu");
|
||||
this.Property(t => t.RoleMenuId).HasColumnName("RoleMenuId");
|
||||
this.Property(t => t.RoleId).HasColumnName("RoleId");
|
||||
this.Property(t => t.MenuId).HasColumnName("MenuId");
|
||||
}
|
||||
}
|
||||
}
|
33
OpenAuth.Repository/Models/Mapping/UserDepartmentMap.cs
Normal file
33
OpenAuth.Repository/Models/Mapping/UserDepartmentMap.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Data.Entity.ModelConfiguration;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class UserDepartmentMap : EntityTypeConfiguration<UserDepartment>
|
||||
{
|
||||
public UserDepartmentMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.UserDepartmentId);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.UserDepartmentId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.DepartmentId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.UserId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("UserDepartment");
|
||||
this.Property(t => t.UserDepartmentId).HasColumnName("UserDepartmentId");
|
||||
this.Property(t => t.DepartmentId).HasColumnName("DepartmentId");
|
||||
this.Property(t => t.UserId).HasColumnName("UserId");
|
||||
}
|
||||
}
|
||||
}
|
41
OpenAuth.Repository/Models/Mapping/UserMap.cs
Normal file
41
OpenAuth.Repository/Models/Mapping/UserMap.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System.Data.Entity.ModelConfiguration;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class UserMap : EntityTypeConfiguration<User>
|
||||
{
|
||||
public UserMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.UserId);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.UserId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.Account)
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.Password)
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.RealName)
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.RoleId)
|
||||
.HasMaxLength(50);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("User");
|
||||
this.Property(t => t.UserId).HasColumnName("UserId");
|
||||
this.Property(t => t.Account).HasColumnName("Account");
|
||||
this.Property(t => t.Password).HasColumnName("Password");
|
||||
this.Property(t => t.RealName).HasColumnName("RealName");
|
||||
this.Property(t => t.RoleId).HasColumnName("RoleId");
|
||||
this.Property(t => t.Enabled).HasColumnName("Enabled");
|
||||
this.Property(t => t.DeleteMark).HasColumnName("DeleteMark");
|
||||
}
|
||||
}
|
||||
}
|
33
OpenAuth.Repository/Models/Mapping/UserRoleMap.cs
Normal file
33
OpenAuth.Repository/Models/Mapping/UserRoleMap.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Data.Entity.ModelConfiguration;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class UserRoleMap : EntityTypeConfiguration<UserRole>
|
||||
{
|
||||
public UserRoleMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.UserRoleId);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.UserRoleId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.UserId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.RoleId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("UserRole");
|
||||
this.Property(t => t.UserRoleId).HasColumnName("UserRoleId");
|
||||
this.Property(t => t.UserId).HasColumnName("UserId");
|
||||
this.Property(t => t.RoleId).HasColumnName("RoleId");
|
||||
}
|
||||
}
|
||||
}
|
27
OpenAuth.Repository/Models/Mapping/sysdiagramMap.cs
Normal file
27
OpenAuth.Repository/Models/Mapping/sysdiagramMap.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Data.Entity.ModelConfiguration;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class sysdiagramMap : EntityTypeConfiguration<sysdiagram>
|
||||
{
|
||||
public sysdiagramMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.diagram_id);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.name)
|
||||
.IsRequired()
|
||||
.HasMaxLength(128);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("sysdiagrams");
|
||||
this.Property(t => t.name).HasColumnName("name");
|
||||
this.Property(t => t.principal_id).HasColumnName("principal_id");
|
||||
this.Property(t => t.diagram_id).HasColumnName("diagram_id");
|
||||
this.Property(t => t.version).HasColumnName("version");
|
||||
this.Property(t => t.definition).HasColumnName("definition");
|
||||
}
|
||||
}
|
||||
}
|
48
OpenAuth.Repository/Models/OpenAuthDBContext.cs
Normal file
48
OpenAuth.Repository/Models/OpenAuthDBContext.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System.Data.Entity;
|
||||
using OpenAuth.Domain;
|
||||
using OpenAuth.Repository.Models.Mapping;
|
||||
|
||||
namespace OpenAuth.Repository.Models
|
||||
{
|
||||
public partial class OpenAuthDBContext : DbContext
|
||||
{
|
||||
static OpenAuthDBContext()
|
||||
{
|
||||
Database.SetInitializer<OpenAuthDBContext>(null);
|
||||
}
|
||||
|
||||
public OpenAuthDBContext()
|
||||
: base("Name=OpenAuthDBContext")
|
||||
{
|
||||
}
|
||||
|
||||
public DbSet<Button> Buttons { get; set; }
|
||||
public DbSet<DataPermission> DataPermissions { get; set; }
|
||||
public DbSet<Department> Departments { get; set; }
|
||||
public DbSet<Menu> Menus { get; set; }
|
||||
public DbSet<MenuButton> MenuButtons { get; set; }
|
||||
public DbSet<Role> Roles { get; set; }
|
||||
public DbSet<RoleMenu> RoleMenus { get; set; }
|
||||
public DbSet<RoleMenuButton> RoleMenuButtons { get; set; }
|
||||
public DbSet<sysdiagram> sysdiagrams { get; set; }
|
||||
public DbSet<User> Users { get; set; }
|
||||
public DbSet<UserDepartment> UserDepartments { get; set; }
|
||||
public DbSet<UserRole> UserRoles { get; set; }
|
||||
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Configurations.Add(new ButtonMap());
|
||||
modelBuilder.Configurations.Add(new DataPermissionMap());
|
||||
modelBuilder.Configurations.Add(new DepartmentMap());
|
||||
modelBuilder.Configurations.Add(new MenuMap());
|
||||
modelBuilder.Configurations.Add(new MenuButtonMap());
|
||||
modelBuilder.Configurations.Add(new RoleMap());
|
||||
modelBuilder.Configurations.Add(new RoleMenuMap());
|
||||
modelBuilder.Configurations.Add(new RoleMenuButtonMap());
|
||||
modelBuilder.Configurations.Add(new sysdiagramMap());
|
||||
modelBuilder.Configurations.Add(new UserMap());
|
||||
modelBuilder.Configurations.Add(new UserDepartmentMap());
|
||||
modelBuilder.Configurations.Add(new UserRoleMap());
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user