mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-03-17 06:56:37 +08:00
模型类
This commit is contained in:
18
Yi.Framework/Yi.Framework.Model/Models/baseModel.cs
Normal file
18
Yi.Framework/Yi.Framework.Model/Models/baseModel.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Model.Models
|
||||
{
|
||||
public class baseModel<T>
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
|
||||
public T id { get; set; }
|
||||
public int is_delete { get; set; }
|
||||
}
|
||||
}
|
||||
14
Yi.Framework/Yi.Framework.Model/Models/loopModel.cs
Normal file
14
Yi.Framework/Yi.Framework.Model/Models/loopModel.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Model.Models
|
||||
{
|
||||
public class loopModel:baseModel<int>
|
||||
{
|
||||
public int? is_top { get; set; }
|
||||
public int? sort { get; set; }
|
||||
}
|
||||
}
|
||||
20
Yi.Framework/Yi.Framework.Model/Models/menu.cs
Normal file
20
Yi.Framework/Yi.Framework.Model/Models/menu.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Model.Models
|
||||
{
|
||||
public class menu :loopModel
|
||||
{
|
||||
public string icon { get; set; }
|
||||
public string router { get; set; }
|
||||
public string menu_name { get; set; }
|
||||
|
||||
|
||||
|
||||
public menu children { get; set; }
|
||||
public mould mould { get; set; }
|
||||
}
|
||||
}
|
||||
14
Yi.Framework/Yi.Framework.Model/Models/mould.cs
Normal file
14
Yi.Framework/Yi.Framework.Model/Models/mould.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Model.Models
|
||||
{
|
||||
public class mould:baseModel<int>
|
||||
{
|
||||
public string mould_name { get; set; }
|
||||
public string url { get; set; }
|
||||
}
|
||||
}
|
||||
17
Yi.Framework/Yi.Framework.Model/Models/role.cs
Normal file
17
Yi.Framework/Yi.Framework.Model/Models/role.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Model.Models
|
||||
{
|
||||
public class role:baseModel
|
||||
{
|
||||
public string role_name { get; set; }
|
||||
public string introduce { get; set; }
|
||||
|
||||
|
||||
public ICollection<menu> menus { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,18 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Model.Models
|
||||
{
|
||||
public class user
|
||||
public class user:baseModel<int>
|
||||
{
|
||||
[Key]
|
||||
public int id { get; set; }
|
||||
public string name { get; set; }
|
||||
public int age { get; set; }
|
||||
public string username { get; set; }
|
||||
public string password { get; set; }
|
||||
public string icon { get; set; }
|
||||
public string nick { get; set; }
|
||||
public string email { get; set; }
|
||||
public string ip { get; set; }
|
||||
public int? age { get; set; }
|
||||
public string introduction { get; set; }
|
||||
|
||||
public ICollection<role> roles { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user