联调前端用户管理及角色管理

This commit is contained in:
橙子
2022-04-26 18:29:18 +08:00
parent 512e640c13
commit 7e427605ab
30 changed files with 239 additions and 81 deletions

View File

@@ -10,6 +10,6 @@ namespace Yi.Framework.Model.Models
public partial class MenuEntity
{
[SqlSugar.SugarColumn(IsIgnore = true)]
public List<MenuEntity> Childs { get; set; }
public List<MenuEntity> Children { get; set; }
}
}

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using SqlSugar;
namespace Yi.Framework.Model.Models
{
@@ -15,10 +16,8 @@ namespace Yi.Framework.Model.Models
this.IsDeleted = false;
this.CreateTime = DateTime.Now;
}
/// <summary>
/// 1
///</summary>
[SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
[JsonConverter(typeof(ValueToStringConverter))]
[SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
public long Id { get; set; }
/// <summary>
///

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using SqlSugar;
namespace Yi.Framework.Model.Models
{
@@ -15,10 +16,8 @@ namespace Yi.Framework.Model.Models
this.IsDeleted = false;
this.CreateTime = DateTime.Now;
}
/// <summary>
/// 1
///</summary>
[SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
[JsonConverter(typeof(ValueToStringConverter))]
[SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
public long Id { get; set; }
/// <summary>
///

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using SqlSugar;
namespace Yi.Framework.Model.Models
{
@@ -15,10 +16,8 @@ namespace Yi.Framework.Model.Models
this.IsDeleted = false;
this.CreateTime = DateTime.Now;
}
/// <summary>
/// 1
///</summary>
[SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
[JsonConverter(typeof(ValueToStringConverter))]
[SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
public long Id { get; set; }
/// <summary>
///

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using SqlSugar;
namespace Yi.Framework.Model.Models
{
@@ -15,10 +16,8 @@ namespace Yi.Framework.Model.Models
this.IsDeleted = false;
this.CreateTime = DateTime.Now;
}
/// <summary>
/// 1
///</summary>
[SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
[JsonConverter(typeof(ValueToStringConverter))]
[SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
public long Id { get; set; }
/// <summary>
///

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using SqlSugar;
namespace Yi.Framework.Model.Models
{
@@ -15,10 +16,10 @@ namespace Yi.Framework.Model.Models
this.IsDeleted = false;
this.CreateTime = DateTime.Now;
}
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
[Newtonsoft.Json.JsonConverter(typeof(ValueToStringConverter))]
[SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
public long Id { get; set; }
/// <summary>
///
@@ -75,5 +76,35 @@ namespace Yi.Framework.Model.Models
///</summary>
[SugarColumn(ColumnName="Salt" )]
public string Salt { get; set; }
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="Icon" )]
public long? Icon { get; set; }
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="Nick" )]
public string Nick { get; set; }
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="Email" )]
public string Email { get; set; }
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="Ip" )]
public string Ip { get; set; }
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="Address" )]
public string Address { get; set; }
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="Phone" )]
public string Phone { get; set; }
}
}

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using SqlSugar;
namespace Yi.Framework.Model.Models
{
@@ -15,10 +16,8 @@ namespace Yi.Framework.Model.Models
this.IsDeleted = false;
this.CreateTime = DateTime.Now;
}
/// <summary>
/// 1
///</summary>
[SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
[JsonConverter(typeof(ValueToStringConverter))]
[SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
public long Id { get; set; }
/// <summary>
///

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using SqlSugar;
namespace Yi.Framework.Model.Models
{
public partial class RoleEntity
{
//[Navigate(typeof(UserRoleEntity), nameof(UserRoleEntity.RoleId), nameof(UserRoleEntity.UserId))]
//public List<UserEntity> Users { get; set; }
}
}

View File

@@ -10,6 +10,21 @@ namespace Yi.Framework.Model.Models
/// 看好啦ORM精髓导航属性
///</summary>
[Navigate(typeof(UserRoleEntity), nameof(UserRoleEntity.UserId), nameof(UserRoleEntity.RoleId))]
public List<RoleEntity> Roles { get; set; }
public List<RoleEntity> Roles { get; set; }
/// <summary>
/// 构建密码MD5盐值加密
/// </summary>
public void BuildPassword(string password = null)
{
//如果不传值那就把自己的password当作传进来的password
if (password == null)
{
password = this.Password;
}
this.Salt = Common.Helper.MD5Helper.GenerateSalt();
this.Password = Common.Helper.MD5Helper.SHA2Encode(password, this.Salt);
}
}
}