diff --git a/WebFirst/database/sqlite.db b/WebFirst/database/sqlite.db index 0f0c339e..d3374e00 100644 Binary files a/WebFirst/database/sqlite.db and b/WebFirst/database/sqlite.db differ diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/BaseController/BaseCrudController.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/BaseController/BaseCrudController.cs index acc74cd8..5c28c68f 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/BaseController/BaseCrudController.cs +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/BaseController/BaseCrudController.cs @@ -15,7 +15,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers /// /// [ApiController] - public class BaseCrudController : ControllerBase where T : BaseModelEntity,new() + public class BaseCrudController : ControllerBase where T : class, IBaseModelEntity,new() { private readonly ILogger _logger; private IBaseService _baseService; diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db new file mode 100644 index 00000000..906d4870 Binary files /dev/null and b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db differ diff --git a/Yi.Framework.Net6/Yi.Framework.Interface/IBaseService.cs b/Yi.Framework.Net6/Yi.Framework.Interface/IBaseService.cs index 3f26d296..93411ba5 100644 --- a/Yi.Framework.Net6/Yi.Framework.Interface/IBaseService.cs +++ b/Yi.Framework.Net6/Yi.Framework.Interface/IBaseService.cs @@ -8,7 +8,7 @@ using Yi.Framework.Repository; namespace Yi.Framework.Interface { - public interface IBaseService where T:BaseModelEntity,new() + public interface IBaseService where T: class, IBaseModelEntity,new() { public IRepository _repository { get; set; } } diff --git a/Yi.Framework.Net6/Yi.Framework.Model/LogEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/LogEntity.cs index 11a4db0d..18aba3fb 100644 --- a/Yi.Framework.Net6/Yi.Framework.Model/LogEntity.cs +++ b/Yi.Framework.Net6/Yi.Framework.Model/LogEntity.cs @@ -9,9 +9,10 @@ namespace Yi.Framework.Model.Models /// [SplitTable(SplitType.Year)] [SugarTable("SplitLog_{year}{month}{day}")] - public partial class LogEntity + public partial class LogEntity { [SplitField] //分表字段 在插入的时候会根据这个字段插入哪个表,在更新删除的时候用这个字段找出相关表 public DateTime? LogCreateTime { get; set; } + } } diff --git a/Yi.Framework.Net6/Yi.Framework.Model/Models/LogEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/Models/LogEntity.cs new file mode 100644 index 00000000..db54343a --- /dev/null +++ b/Yi.Framework.Net6/Yi.Framework.Model/Models/LogEntity.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace Yi.Framework.Model.Models +{ + /// + /// 日志表 + /// + public partial class LogEntity:IBaseModelEntity + { + public LogEntity() + { + this.IsDeleted = false; + this.CreateTime = DateTime.Now; + } + /// + /// 1 + /// + [SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )] + public long Id { get; set; } + + /// + /// 创建者 + /// + [SugarColumn(ColumnName="CreateUser" )] + public long? CreateUser { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName="CreateTime" )] + public DateTime? CreateTime { get; set; } + /// + /// 修改者 + /// + [SugarColumn(ColumnName="ModifyUser" )] + public long? ModifyUser { get; set; } + /// + /// 修改时间 + /// + [SugarColumn(ColumnName="ModifyTime" )] + public DateTime? ModifyTime { get; set; } + /// + /// 是否删除 + /// + [SugarColumn(ColumnName="IsDeleted" )] + public bool? IsDeleted { get; set; } + /// + /// 租户Id + /// + [SugarColumn(ColumnName="TenantId" )] + public long? TenantId { get; set; } + /// + /// 消息 + /// + [SugarColumn(ColumnName="Message" )] + public string Message { get; set; } + } +} diff --git a/Yi.Framework.Net6/Yi.Framework.Model/Models/RoleEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/Models/RoleEntity.cs index ccf630b6..e1b490db 100644 --- a/Yi.Framework.Net6/Yi.Framework.Model/Models/RoleEntity.cs +++ b/Yi.Framework.Net6/Yi.Framework.Model/Models/RoleEntity.cs @@ -10,7 +10,7 @@ namespace Yi.Framework.Model.Models [SugarTable("Role")] public partial class RoleEntity:IBaseModelEntity { - public BaseModelEntity() + public RoleEntity() { this.IsDeleted = false; this.CreateTime = DateTime.Now; diff --git a/Yi.Framework.Net6/Yi.Framework.Model/Models/UserEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/Models/UserEntity.cs index df8da635..2936acb4 100644 --- a/Yi.Framework.Net6/Yi.Framework.Model/Models/UserEntity.cs +++ b/Yi.Framework.Net6/Yi.Framework.Model/Models/UserEntity.cs @@ -10,7 +10,7 @@ namespace Yi.Framework.Model.Models [SugarTable("User")] public partial class UserEntity:IBaseModelEntity { - public BaseModelEntity() + public UserEntity() { this.IsDeleted = false; this.CreateTime = DateTime.Now; diff --git a/Yi.Framework.Net6/Yi.Framework.Model/Models/UserRoleEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/Models/UserRoleEntity.cs index 60afb037..e686a840 100644 --- a/Yi.Framework.Net6/Yi.Framework.Model/Models/UserRoleEntity.cs +++ b/Yi.Framework.Net6/Yi.Framework.Model/Models/UserRoleEntity.cs @@ -10,7 +10,7 @@ namespace Yi.Framework.Model.Models [SugarTable("UserRole")] public partial class UserRoleEntity:IBaseModelEntity { - public BaseModelEntity() + public UserRoleEntity() { this.IsDeleted = false; this.CreateTime = DateTime.Now; diff --git a/Yi.Framework.Net6/Yi.Framework.Model/UserEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/UserEntity.cs index b2d8eb37..0a80c087 100644 --- a/Yi.Framework.Net6/Yi.Framework.Model/UserEntity.cs +++ b/Yi.Framework.Net6/Yi.Framework.Model/UserEntity.cs @@ -4,7 +4,7 @@ using System.Linq; using SqlSugar; namespace Yi.Framework.Model.Models { - public partial class UserEntity:BaseModelEntity + public partial class UserEntity { /// /// 看好啦!ORM精髓,导航属性 diff --git a/Yi.Framework.Net6/Yi.Framework.Repository/DataContext.cs b/Yi.Framework.Net6/Yi.Framework.Repository/DataContext.cs index fdfec61e..d738ad77 100644 --- a/Yi.Framework.Net6/Yi.Framework.Repository/DataContext.cs +++ b/Yi.Framework.Net6/Yi.Framework.Repository/DataContext.cs @@ -4,7 +4,7 @@ using Yi.Framework.Model.Models; namespace Yi.Framework.Repository { - public class DataContext : SimpleClient where T : class, BaseModelEntity, new() + public class DataContext : SimpleClient where T : class, IBaseModelEntity, new() { public DataContext(ISqlSugarClient context) : base(context) { diff --git a/Yi.Framework.Net6/Yi.Framework.Repository/IRepository.cs b/Yi.Framework.Net6/Yi.Framework.Repository/IRepository.cs index 0883bb9c..6b281189 100644 --- a/Yi.Framework.Net6/Yi.Framework.Repository/IRepository.cs +++ b/Yi.Framework.Net6/Yi.Framework.Repository/IRepository.cs @@ -11,7 +11,7 @@ using Yi.Framework.Model.Query; namespace Yi.Framework.Repository { - public interface IRepository : ISimpleClient where T : BaseModelEntity,new() + public interface IRepository : ISimpleClient where T : class, IBaseModelEntity, new() { public ISqlSugarClient _Db { get; set; } public Task UseTranAsync(Func func); diff --git a/Yi.Framework.Net6/Yi.Framework.Repository/Repository.cs b/Yi.Framework.Net6/Yi.Framework.Repository/Repository.cs index 4b21db78..3017074f 100644 --- a/Yi.Framework.Net6/Yi.Framework.Repository/Repository.cs +++ b/Yi.Framework.Net6/Yi.Framework.Repository/Repository.cs @@ -12,7 +12,7 @@ namespace Yi.Framework.Repository /// 仓储模式 /// /// - public class Repository : DataContext, IRepository where T : BaseModelEntity,new() + public class Repository : DataContext, IRepository where T : class, IBaseModelEntity, new() { public ISqlSugarClient _Db { get; set; } /// diff --git a/Yi.Framework.Net6/Yi.Framework.Service/BaseService.cs b/Yi.Framework.Net6/Yi.Framework.Service/BaseService.cs index 43fff21c..603bab64 100644 --- a/Yi.Framework.Net6/Yi.Framework.Service/BaseService.cs +++ b/Yi.Framework.Net6/Yi.Framework.Service/BaseService.cs @@ -9,7 +9,7 @@ using Yi.Framework.Repository; namespace Yi.Framework.Service { - public class BaseService:IBaseService where T:BaseModelEntity,new() + public class BaseService:IBaseService where T:class, IBaseModelEntity,new() { public IRepository _repository { get; set; } public BaseService(IRepository iRepository)