mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-04-30 04:45:56 +08:00
添加资源表/数据字典/分类
This commit is contained in:
parent
5650569fbe
commit
999046f887
77
OpenAuth.Domain/Category.cs
Normal file
77
OpenAuth.Domain/Category.cs
Normal file
@ -0,0 +1,77 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
|
||||
namespace OpenAuth.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// 分类列表
|
||||
/// </summary>
|
||||
public partial class Category
|
||||
{
|
||||
/// <summary>
|
||||
/// 分类ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 节点语义ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string CascadeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组织名称
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 父节点流水号
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int ParentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 资源分类标识
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序号
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int SortNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 资源分类标识
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string RootKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 资源分类
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string RootName { get; set; }
|
||||
|
||||
|
||||
public Category()
|
||||
{
|
||||
this.Id= 0;
|
||||
this.CascadeId= string.Empty;
|
||||
this.Name= string.Empty;
|
||||
this.ParentId= 0;
|
||||
this.Status= 0;
|
||||
this.SortNo= 0;
|
||||
this.RootKey= string.Empty;
|
||||
this.RootName= string.Empty;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
70
OpenAuth.Domain/DicDetail.cs
Normal file
70
OpenAuth.Domain/DicDetail.cs
Normal file
@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
|
||||
namespace OpenAuth.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据字典详情
|
||||
/// </summary>
|
||||
public partial class DicDetail
|
||||
{
|
||||
/// <summary>
|
||||
/// ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Text { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int DicId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序号
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int SortNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 资源分类标识
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Description { get; set; }
|
||||
|
||||
|
||||
public DicDetail()
|
||||
{
|
||||
this.Id= 0;
|
||||
this.Value= string.Empty;
|
||||
this.Text= string.Empty;
|
||||
this.DicId= 0;
|
||||
this.SortNo= 0;
|
||||
this.Status= 0;
|
||||
this.Description= string.Empty;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
63
OpenAuth.Domain/DicIndex.cs
Normal file
63
OpenAuth.Domain/DicIndex.cs
Normal file
@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
|
||||
namespace OpenAuth.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据字典
|
||||
/// </summary>
|
||||
public partial class DicIndex
|
||||
{
|
||||
/// <summary>
|
||||
/// ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组织名称
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序号
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int SortNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 资源分类标识
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int CategoryId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Description { get; set; }
|
||||
|
||||
|
||||
public DicIndex()
|
||||
{
|
||||
this.Id= 0;
|
||||
this.Name= string.Empty;
|
||||
this.Key= string.Empty;
|
||||
this.SortNo= 0;
|
||||
this.CategoryId= 0;
|
||||
this.Description= string.Empty;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -6,12 +6,12 @@ using System.Linq;
|
||||
namespace OpenAuth.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// 模块
|
||||
/// </summary>
|
||||
public partial class Module
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// 模块ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Id { get; set; }
|
||||
@ -65,7 +65,7 @@ namespace OpenAuth.Domain
|
||||
public string IconName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// 资源分类标识
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Status { get; set; }
|
||||
|
@ -6,12 +6,12 @@ using System.Linq;
|
||||
namespace OpenAuth.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// 模块元素
|
||||
/// </summary>
|
||||
public partial class ModuleElement
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Id { get; set; }
|
||||
@ -29,7 +29,7 @@ namespace OpenAuth.Domain
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 元素的类型(如:button/a)
|
||||
/// 组织类型
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Type { get; set; }
|
||||
@ -70,7 +70,11 @@ namespace OpenAuth.Domain
|
||||
/// <returns></returns>
|
||||
public string Remark { get; set; }
|
||||
|
||||
public int Sort { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Sort { get; set; }
|
||||
|
||||
|
||||
public ModuleElement()
|
||||
@ -78,15 +82,15 @@ namespace OpenAuth.Domain
|
||||
this.Id= 0;
|
||||
this.DomId= string.Empty;
|
||||
this.Name= string.Empty;
|
||||
this.Type = string.Empty;
|
||||
this.ModuleId= 0;
|
||||
this.Type= string.Empty;
|
||||
this.ModuleId= 0;
|
||||
this.Attr= string.Empty;
|
||||
this.Script= string.Empty;
|
||||
this.Icon= string.Empty;
|
||||
this.Class= string.Empty;
|
||||
this.Remark= string.Empty;
|
||||
this.Sort = 0;
|
||||
}
|
||||
this.Sort= 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -42,7 +42,10 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Category.cs" />
|
||||
<Compile Include="Core\User.cs" />
|
||||
<Compile Include="DicDetail.cs" />
|
||||
<Compile Include="DicIndex.cs" />
|
||||
<Compile Include="Interface\IModuleRepository.cs" />
|
||||
<Compile Include="Interface\IOrgRepository.cs" />
|
||||
<Compile Include="Interface\IRepository.cs" />
|
||||
@ -52,8 +55,10 @@
|
||||
<Compile Include="Module.cs" />
|
||||
<Compile Include="ModuleElement.cs" />
|
||||
<Compile Include="Org.cs" />
|
||||
<Compile Include="Param.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Relevance.cs" />
|
||||
<Compile Include="Resource.cs" />
|
||||
<Compile Include="Role.cs" />
|
||||
<Compile Include="User.cs" />
|
||||
<Compile Include="UserCfg.cs" />
|
||||
|
@ -6,12 +6,12 @@ using System.Linq;
|
||||
namespace OpenAuth.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// 组织
|
||||
/// </summary>
|
||||
public partial class Org
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Id { get; set; }
|
||||
@ -65,7 +65,7 @@ namespace OpenAuth.Domain
|
||||
public string IconName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// 资源分类标识
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Status { get; set; }
|
||||
|
70
OpenAuth.Domain/Param.cs
Normal file
70
OpenAuth.Domain/Param.cs
Normal file
@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
|
||||
namespace OpenAuth.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// 键值
|
||||
/// </summary>
|
||||
public partial class Param
|
||||
{
|
||||
/// <summary>
|
||||
/// ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 资源分类标识
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int CategoryId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序号
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int SortNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 资源分类标识
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Description { get; set; }
|
||||
|
||||
|
||||
public Param()
|
||||
{
|
||||
this.Id= 0;
|
||||
this.Value= string.Empty;
|
||||
this.Key= string.Empty;
|
||||
this.CategoryId= 0;
|
||||
this.SortNo= 0;
|
||||
this.Status= 0;
|
||||
this.Description= string.Empty;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -6,12 +6,12 @@ using System.Linq;
|
||||
namespace OpenAuth.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// 多对多映射
|
||||
/// </summary>
|
||||
public partial class Relevance
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Id { get; set; }
|
||||
@ -41,7 +41,7 @@ namespace OpenAuth.Domain
|
||||
public string Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// 资源分类标识
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Status { get; set; }
|
||||
|
84
OpenAuth.Domain/Resource.cs
Normal file
84
OpenAuth.Domain/Resource.cs
Normal file
@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
|
||||
namespace OpenAuth.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// 资源表ID
|
||||
/// </summary>
|
||||
public partial class Resource
|
||||
{
|
||||
/// <summary>
|
||||
/// 资源表ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 节点语义ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string CascadeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组织名称
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 父节点流水号
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int ParentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 资源分类标识
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序号
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int SortNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 资源分类标识
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int CategoryId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Description { get; set; }
|
||||
|
||||
|
||||
public Resource()
|
||||
{
|
||||
this.Id= 0;
|
||||
this.CascadeId= string.Empty;
|
||||
this.Key= string.Empty;
|
||||
this.Name= string.Empty;
|
||||
this.ParentId= 0;
|
||||
this.Status= 0;
|
||||
this.SortNo= 0;
|
||||
this.CategoryId= 0;
|
||||
this.Description= string.Empty;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -6,12 +6,12 @@ using System.Linq;
|
||||
namespace OpenAuth.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// 角色
|
||||
/// </summary>
|
||||
public partial class Role
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// 资源表ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Id { get; set; }
|
||||
@ -23,7 +23,7 @@ namespace OpenAuth.Domain
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// 资源分类标识
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Status { get; set; }
|
||||
|
@ -6,12 +6,12 @@ using System.Linq;
|
||||
namespace OpenAuth.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// 用户
|
||||
/// </summary>
|
||||
public partial class User
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// 资源表ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Id { get; set; }
|
||||
@ -41,7 +41,7 @@ namespace OpenAuth.Domain
|
||||
public int Sex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// 资源分类标识
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Status { get; set; }
|
||||
|
@ -6,12 +6,12 @@ using System.Linq;
|
||||
namespace OpenAuth.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// 用户配置
|
||||
/// </summary>
|
||||
public partial class UserCfg
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// 资源表ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Id { get; set; }
|
||||
|
@ -6,12 +6,12 @@ using System.Linq;
|
||||
namespace OpenAuth.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// 用户扩展信息
|
||||
/// </summary>
|
||||
public partial class UserExt
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// 资源表ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Id { get; set; }
|
||||
|
43
OpenAuth.Repository/Models/Mapping/CategoryMap.cs
Normal file
43
OpenAuth.Repository/Models/Mapping/CategoryMap.cs
Normal file
@ -0,0 +1,43 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity.ModelConfiguration;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class CategoryMap : EntityTypeConfiguration<Category>
|
||||
{
|
||||
public CategoryMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.Id);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.CascadeId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(255);
|
||||
|
||||
this.Property(t => t.Name)
|
||||
.IsRequired()
|
||||
.HasMaxLength(255);
|
||||
|
||||
this.Property(t => t.RootKey)
|
||||
.IsRequired()
|
||||
.HasMaxLength(100);
|
||||
|
||||
this.Property(t => t.RootName)
|
||||
.IsRequired()
|
||||
.HasMaxLength(200);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("Category");
|
||||
this.Property(t => t.Id).HasColumnName("Id");
|
||||
this.Property(t => t.CascadeId).HasColumnName("CascadeId");
|
||||
this.Property(t => t.Name).HasColumnName("Name");
|
||||
this.Property(t => t.ParentId).HasColumnName("ParentId");
|
||||
this.Property(t => t.Status).HasColumnName("Status");
|
||||
this.Property(t => t.SortNo).HasColumnName("SortNo");
|
||||
this.Property(t => t.RootKey).HasColumnName("RootKey");
|
||||
this.Property(t => t.RootName).HasColumnName("RootName");
|
||||
}
|
||||
}
|
||||
}
|
38
OpenAuth.Repository/Models/Mapping/DicDetailMap.cs
Normal file
38
OpenAuth.Repository/Models/Mapping/DicDetailMap.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity.ModelConfiguration;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class DicDetailMap : EntityTypeConfiguration<DicDetail>
|
||||
{
|
||||
public DicDetailMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.Id);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.Value)
|
||||
.IsRequired()
|
||||
.HasMaxLength(100);
|
||||
|
||||
this.Property(t => t.Text)
|
||||
.IsRequired()
|
||||
.HasMaxLength(100);
|
||||
|
||||
this.Property(t => t.Description)
|
||||
.IsRequired()
|
||||
.HasMaxLength(100);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("DicDetail");
|
||||
this.Property(t => t.Id).HasColumnName("Id");
|
||||
this.Property(t => t.Value).HasColumnName("Value");
|
||||
this.Property(t => t.Text).HasColumnName("Text");
|
||||
this.Property(t => t.DicId).HasColumnName("DicId");
|
||||
this.Property(t => t.SortNo).HasColumnName("SortNo");
|
||||
this.Property(t => t.Status).HasColumnName("Status");
|
||||
this.Property(t => t.Description).HasColumnName("Description");
|
||||
}
|
||||
}
|
||||
}
|
37
OpenAuth.Repository/Models/Mapping/DicIndexMap.cs
Normal file
37
OpenAuth.Repository/Models/Mapping/DicIndexMap.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity.ModelConfiguration;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class DicIndexMap : EntityTypeConfiguration<DicIndex>
|
||||
{
|
||||
public DicIndexMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.Id);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.Name)
|
||||
.IsRequired()
|
||||
.HasMaxLength(255);
|
||||
|
||||
this.Property(t => t.Key)
|
||||
.IsRequired()
|
||||
.HasMaxLength(100);
|
||||
|
||||
this.Property(t => t.Description)
|
||||
.IsRequired()
|
||||
.HasMaxLength(200);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("DicIndex");
|
||||
this.Property(t => t.Id).HasColumnName("Id");
|
||||
this.Property(t => t.Name).HasColumnName("Name");
|
||||
this.Property(t => t.Key).HasColumnName("Key");
|
||||
this.Property(t => t.SortNo).HasColumnName("SortNo");
|
||||
this.Property(t => t.CategoryId).HasColumnName("CategoryId");
|
||||
this.Property(t => t.Description).HasColumnName("Description");
|
||||
}
|
||||
}
|
||||
}
|
@ -20,6 +20,10 @@ namespace OpenAuth.Repository.Models.Mapping
|
||||
.IsRequired()
|
||||
.HasMaxLength(255);
|
||||
|
||||
this.Property(t => t.Type)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
this.Property(t => t.Attr)
|
||||
.IsRequired()
|
||||
.HasMaxLength(500);
|
||||
|
38
OpenAuth.Repository/Models/Mapping/ParamMap.cs
Normal file
38
OpenAuth.Repository/Models/Mapping/ParamMap.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity.ModelConfiguration;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class ParamMap : EntityTypeConfiguration<Param>
|
||||
{
|
||||
public ParamMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.Id);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.Value)
|
||||
.IsRequired()
|
||||
.HasMaxLength(100);
|
||||
|
||||
this.Property(t => t.Key)
|
||||
.IsRequired()
|
||||
.HasMaxLength(100);
|
||||
|
||||
this.Property(t => t.Description)
|
||||
.IsRequired()
|
||||
.HasMaxLength(100);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("Param");
|
||||
this.Property(t => t.Id).HasColumnName("Id");
|
||||
this.Property(t => t.Value).HasColumnName("Value");
|
||||
this.Property(t => t.Key).HasColumnName("Key");
|
||||
this.Property(t => t.CategoryId).HasColumnName("CategoryId");
|
||||
this.Property(t => t.SortNo).HasColumnName("SortNo");
|
||||
this.Property(t => t.Status).HasColumnName("Status");
|
||||
this.Property(t => t.Description).HasColumnName("Description");
|
||||
}
|
||||
}
|
||||
}
|
44
OpenAuth.Repository/Models/Mapping/ResourceMap.cs
Normal file
44
OpenAuth.Repository/Models/Mapping/ResourceMap.cs
Normal file
@ -0,0 +1,44 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity.ModelConfiguration;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class ResourceMap : EntityTypeConfiguration<Resource>
|
||||
{
|
||||
public ResourceMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.Id);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.CascadeId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(255);
|
||||
|
||||
this.Property(t => t.Key)
|
||||
.IsRequired()
|
||||
.HasMaxLength(200);
|
||||
|
||||
this.Property(t => t.Name)
|
||||
.IsRequired()
|
||||
.HasMaxLength(255);
|
||||
|
||||
this.Property(t => t.Description)
|
||||
.IsRequired()
|
||||
.HasMaxLength(500);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("Resource");
|
||||
this.Property(t => t.Id).HasColumnName("Id");
|
||||
this.Property(t => t.CascadeId).HasColumnName("CascadeId");
|
||||
this.Property(t => t.Key).HasColumnName("Key");
|
||||
this.Property(t => t.Name).HasColumnName("Name");
|
||||
this.Property(t => t.ParentId).HasColumnName("ParentId");
|
||||
this.Property(t => t.Status).HasColumnName("Status");
|
||||
this.Property(t => t.SortNo).HasColumnName("SortNo");
|
||||
this.Property(t => t.CategoryId).HasColumnName("CategoryId");
|
||||
this.Property(t => t.Description).HasColumnName("Description");
|
||||
}
|
||||
}
|
||||
}
|
@ -17,10 +17,15 @@ namespace OpenAuth.Repository.Models
|
||||
{
|
||||
}
|
||||
|
||||
public DbSet<Category> Categories { get; set; }
|
||||
public DbSet<DicDetail> DicDetails { get; set; }
|
||||
public DbSet<DicIndex> DicIndexes { get; set; }
|
||||
public DbSet<Module> Modules { get; set; }
|
||||
public DbSet<ModuleElement> ModuleElements { get; set; }
|
||||
public DbSet<Org> Orgs { get; set; }
|
||||
public DbSet<Param> Params { get; set; }
|
||||
public DbSet<Relevance> Relevances { get; set; }
|
||||
public DbSet<Resource> Resources { get; set; }
|
||||
public DbSet<Role> Roles { get; set; }
|
||||
public DbSet<User> Users { get; set; }
|
||||
public DbSet<UserCfg> UserCfgs { get; set; }
|
||||
@ -28,10 +33,15 @@ namespace OpenAuth.Repository.Models
|
||||
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Configurations.Add(new CategoryMap());
|
||||
modelBuilder.Configurations.Add(new DicDetailMap());
|
||||
modelBuilder.Configurations.Add(new DicIndexMap());
|
||||
modelBuilder.Configurations.Add(new ModuleMap());
|
||||
modelBuilder.Configurations.Add(new ModuleElementMap());
|
||||
modelBuilder.Configurations.Add(new OrgMap());
|
||||
modelBuilder.Configurations.Add(new ParamMap());
|
||||
modelBuilder.Configurations.Add(new RelevanceMap());
|
||||
modelBuilder.Configurations.Add(new ResourceMap());
|
||||
modelBuilder.Configurations.Add(new RoleMap());
|
||||
modelBuilder.Configurations.Add(new UserMap());
|
||||
modelBuilder.Configurations.Add(new UserCfgMap());
|
||||
|
@ -54,10 +54,15 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BaseRepository.cs" />
|
||||
<Compile Include="Models\Mapping\CategoryMap.cs" />
|
||||
<Compile Include="Models\Mapping\DicDetailMap.cs" />
|
||||
<Compile Include="Models\Mapping\DicIndexMap.cs" />
|
||||
<Compile Include="Models\Mapping\ModuleElementMap.cs" />
|
||||
<Compile Include="Models\Mapping\ModuleMap.cs" />
|
||||
<Compile Include="Models\Mapping\OrgMap.cs" />
|
||||
<Compile Include="Models\Mapping\ParamMap.cs" />
|
||||
<Compile Include="Models\Mapping\RelevanceMap.cs" />
|
||||
<Compile Include="Models\Mapping\ResourceMap.cs" />
|
||||
<Compile Include="Models\Mapping\RoleMap.cs" />
|
||||
<Compile Include="Models\Mapping\UserCfgMap.cs" />
|
||||
<Compile Include="Models\Mapping\UserExtMap.cs" />
|
||||
|
1224
数据库设计关系图/PDM_OA.pdb
1224
数据库设计关系图/PDM_OA.pdb
File diff suppressed because it is too large
Load Diff
1226
数据库设计关系图/PDM_OA.pdm
1226
数据库设计关系图/PDM_OA.pdm
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user