调整了一下项目框架与前端JS代码

This commit is contained in:
yubaolee
2015-09-20 21:59:36 +08:00
parent 2dea364b2b
commit 43f8130e7e
224 changed files with 17851 additions and 3449 deletions

View File

@@ -1,49 +0,0 @@
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain.Model;
namespace OpenAuth.Repository.Mapping
{
public class ButtonMap : EntityTypeConfiguration<Button>
{
public ButtonMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Id)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.FullName)
.HasMaxLength(50);
this.Property(t => t.Img)
.HasMaxLength(50);
this.Property(t => t.Event)
.HasMaxLength(200);
this.Property(t => t.Control_ID)
.HasMaxLength(50);
this.Property(t => t.Category)
.HasMaxLength(50);
this.Property(t => t.Description)
.HasMaxLength(200);
// Table & Column Mappings
this.ToTable("Button");
this.Property(t => t.Id).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");
}
}
}

View File

@@ -1,39 +0,0 @@
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain.Model;
namespace OpenAuth.Repository.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");
// Relationships
this.HasRequired(t => t.Role)
.WithMany(t => t.DataPermissions)
.HasForeignKey(d => d.RoleId);
}
}
}

View File

@@ -1,51 +0,0 @@
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain.Model;
namespace OpenAuth.Repository.Mapping
{
public class DepartmentMap : EntityTypeConfiguration<Department>
{
public DepartmentMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Id)
.IsRequired()
.HasMaxLength(50);
this.HasMany(d => d.Users)
.WithMany(u => u.Departments)
.Map(
m =>
{
m.MapLeftKey("DepartmentId");
m.MapRightKey("UserId");
m.ToTable("UserDepartment");
});
this.HasMany(d => d.Roles)
.WithRequired(r => r.Department);
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.Id).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");
}
}
}

View File

@@ -1,75 +0,0 @@
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
using OpenAuth.Domain.Model;
namespace OpenAuth.Repository.Mapping
{
public class MenuMap : EntityTypeConfiguration<Menu>
{
public MenuMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Id)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.ParentId)
.HasMaxLength(50);
this.Property(t => t.FullName)
.HasMaxLength(50);
this.Property(t => t.Description)
.HasMaxLength(200);
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);
//<2F>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>İ<EFBFBD>ť
this.HasMany(t => t.Buttons)
.WithMany(b => b.Menus)
.Map(m =>
{
m.MapLeftKey("MenuId");
m.MapRightKey("ButtonId");
m.ToTable("MenuButton");
});
//TODO:<3A>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľ<EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䣬EF<45><46>ѯʱ<D1AF><CAB1><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>Role_RoleId<49><64>
this.HasMany(t => t.Roles)
.WithMany(b => b.RoleMenus)
.Map(m =>
{
m.MapLeftKey("MenuId");
m.MapRightKey("RoleId");
m.ToTable("RoleMenu");
});
// Table & Column Mappings
this.ToTable("Menu");
this.Property(t => t.Id).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");
}
}
}

View File

@@ -1,70 +0,0 @@
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
using OpenAuth.Domain.Model;
namespace OpenAuth.Repository.Mapping
{
public class RoleMap : EntityTypeConfiguration<Role>
{
public RoleMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Id)
.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(200);
this.Property(t => t.DepartmentId)
.HasMaxLength(50);
//<2F><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>
this.HasMany(d => d.Users)
.WithMany(u => u.Roles)
.Map(
m =>
{
m.MapLeftKey("RoleId");
m.MapRightKey("UserId");
m.ToTable("UserRole");
});
//<2F><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD>IJ˵<C4B2>
this.HasMany(m => m.RoleMenus)
.WithMany(r => r.Roles)
.Map(m =>
{
m.MapLeftKey("RoleId");
m.MapRightKey("MenuId");
m.ToTable("RoleMenu");
});
// Table & Column Mappings
this.ToTable("Role");
this.Property(t => t.Id).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");
}
}
}

View File

@@ -1,67 +0,0 @@
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
using OpenAuth.Domain.Model;
namespace OpenAuth.Repository.Mapping
{
public class UserMap : EntityTypeConfiguration<User>
{
public UserMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Id)
.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);
this.HasMany(u => u.Departments)
.WithMany(d => d.Users)
.Map(m =>
{
m.MapLeftKey("UserId");
m.MapRightKey("DepartmentId");
m.ToTable("UserDepartment");
});
this.HasMany(u => u.Roles)
.WithMany(r => r.Users)
.Map(m =>
{
m.MapLeftKey("UserId");
m.MapRightKey("RoleId");
m.ToTable("UserRole");
});
//Ĭ<>Ͻ<EFBFBD>ɫ
this.HasOptional(u => u.DefaultRole)
.WithMany()
.HasForeignKey(u =>u.RoleId);
// Table & Column Mappings
this.ToTable("User");
this.Property(t => t.Id).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");
}
}
}