diff --git a/WebFirst/database/sqlite.db b/WebFirst/database/sqlite.db index d3374e00..a242e04b 100644 Binary files a/WebFirst/database/sqlite.db and b/WebFirst/database/sqlite.db differ diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Config/SwaggerDoc.xml b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Config/SwaggerDoc.xml index de809849..94301420 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Config/SwaggerDoc.xml +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Config/SwaggerDoc.xml @@ -4,6 +4,11 @@ Yi.Framework.ApiMicroservice + + + 账户控制器 + + Json To Sql 类比模式,通用模型 @@ -63,6 +68,11 @@ + + + 测试控制器 + + 仓储上下文对象测试 diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/AccountController.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/AccountController.cs index 365c5339..85f12094 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/AccountController.cs +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/AccountController.cs @@ -17,6 +17,9 @@ using Yi.Framework.WebCore.AuthorizationPolicy; namespace Yi.Framework.ApiMicroservice.Controllers { + /// + /// 账户控制器 + /// [ApiController] [Route("api/[controller]/[action]")] public class AccountController :ControllerBase diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/MenuController.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/MenuController.cs new file mode 100644 index 00000000..0de84e65 --- /dev/null +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/MenuController.cs @@ -0,0 +1,28 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Yi.Framework.Common.Models; +using Yi.Framework.Interface; +using Yi.Framework.Model.Models; +using Yi.Framework.Repository; +using Yi.Framework.WebCore; +using Yi.Framework.WebCore.AttributeExtend; +using Yi.Framework.WebCore.AuthorizationPolicy; + +namespace Yi.Framework.ApiMicroservice.Controllers +{ + [ApiController] + [Route("api/[controller]/[action]")] + public class MenuController : BaseCrudController + { + private IMenuService _iMenuService; + public MenuController(ILogger logger, IMenuService iMenuService) : base(logger, iMenuService) + { + _iMenuService = iMenuService; + } + } +} diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/TestController.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/TestController.cs index bec2e480..f8ecd6b6 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/TestController.cs +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/TestController.cs @@ -19,6 +19,9 @@ using Yi.Framework.WebCore.AuthorizationPolicy; namespace Yi.Framework.ApiMicroservice.Controllers { + /// + /// 测试控制器 + /// [ApiController] [Route("api/[controller]/[action]")] public class TestController : ControllerBase diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Program.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Program.cs index a2623cf8..63e6ac9d 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Program.cs +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Program.cs @@ -130,7 +130,7 @@ ServiceLocator.Instance = app.Services; #region //ץȡע #endregion -//app.UseErrorHandlingService(); +app.UseErrorHandlingService(); #region //̬ļע #endregion diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db index 906d4870..19b0cca7 100644 Binary files a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db and b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db differ diff --git a/Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IUserRoleService.cs b/Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IMenuService.cs similarity index 61% rename from Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IUserRoleService.cs rename to Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IMenuService.cs index a299d0af..413a0ade 100644 --- a/Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IUserRoleService.cs +++ b/Yi.Framework.Net6/Yi.Framework.Interface/IServiceTemplate/IMenuService.cs @@ -3,7 +3,7 @@ using Yi.Framework.Repository; namespace Yi.Framework.Interface { - public partial interface IUserRoleService:IBaseService + public partial interface IMenuService:IBaseService { } } diff --git a/Yi.Framework.Net6/Yi.Framework.Model/MenuEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/MenuEntity.cs new file mode 100644 index 00000000..96e7dfee --- /dev/null +++ b/Yi.Framework.Net6/Yi.Framework.Model/MenuEntity.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace Yi.Framework.Model.Models +{ + /// + /// 菜单表 + /// + public partial class MenuEntity + { + [SqlSugar.SugarColumn(IsIgnore = true)] + public List Childs { get; set; } + } +} diff --git a/Yi.Framework.Net6/Yi.Framework.Model/Models/MenuEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/Models/MenuEntity.cs new file mode 100644 index 00000000..ddc0db69 --- /dev/null +++ b/Yi.Framework.Net6/Yi.Framework.Model/Models/MenuEntity.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace Yi.Framework.Model.Models +{ + /// + /// 菜单表 + /// + [SugarTable("Menu")] + public partial class MenuEntity:IBaseModelEntity + { + public MenuEntity() + { + this.IsDeleted = false; + this.CreateTime = DateTime.Now; + } + /// + /// 1 + /// + [SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )] + public long Id { get; set; } + /// + /// + /// + [SugarColumn(ColumnName="MenuName" )] + public string MenuName { get; set; } + /// + /// + /// + [SugarColumn(ColumnName="MenuType" )] + public int? MenuType { get; set; } + /// + /// + /// + [SugarColumn(ColumnName="MenuCode" )] + public string PermissionCode { get; set; } + /// + /// + /// + [SugarColumn(ColumnName="ParentId" )] + public long? ParentId { 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; } + } +} diff --git a/Yi.Framework.Net6/Yi.Framework.Model/Models/RoleEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/Models/RoleEntity.cs index e1b490db..346f7b23 100644 --- a/Yi.Framework.Net6/Yi.Framework.Model/Models/RoleEntity.cs +++ b/Yi.Framework.Net6/Yi.Framework.Model/Models/RoleEntity.cs @@ -5,7 +5,7 @@ using SqlSugar; namespace Yi.Framework.Model.Models { /// - /// + /// 角色表 /// [SugarTable("Role")] public partial class RoleEntity:IBaseModelEntity diff --git a/Yi.Framework.Net6/Yi.Framework.Model/Models/RoleMenuEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/Models/RoleMenuEntity.cs new file mode 100644 index 00000000..a7b4d03d --- /dev/null +++ b/Yi.Framework.Net6/Yi.Framework.Model/Models/RoleMenuEntity.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace Yi.Framework.Model.Models +{ + /// + /// 角色菜单关系表 + /// + [SugarTable("RoleMenu")] + public partial class RoleMenuEntity:IBaseModelEntity + { + public RoleMenuEntity() + { + this.IsDeleted = false; + this.CreateTime = DateTime.Now; + } + /// + /// 1 + /// + [SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )] + public long Id { get; set; } + /// + /// + /// + [SugarColumn(ColumnName="RoleId" )] + public long? RoleId { get; set; } + /// + /// + /// + [SugarColumn(ColumnName="MenuId" )] + public long? MenuId { 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; } + } +} diff --git a/Yi.Framework.Net6/Yi.Framework.Model/Models/TenantEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/Models/TenantEntity.cs new file mode 100644 index 00000000..c052ec3d --- /dev/null +++ b/Yi.Framework.Net6/Yi.Framework.Model/Models/TenantEntity.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace Yi.Framework.Model.Models +{ + /// + /// 租户表 + /// + [SugarTable("Tenant")] + public partial class TenantEntity:IBaseModelEntity + { + public TenantEntity() + { + this.IsDeleted = false; + this.CreateTime = DateTime.Now; + } + /// + /// 1 + /// + [SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )] + public long Id { get; set; } + /// + /// + /// + [SugarColumn(ColumnName="TenantName" )] + public string TenantName { 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; } + } +} diff --git a/Yi.Framework.Net6/Yi.Framework.Model/Models/UserEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/Models/UserEntity.cs index 2936acb4..074ad70d 100644 --- a/Yi.Framework.Net6/Yi.Framework.Model/Models/UserEntity.cs +++ b/Yi.Framework.Net6/Yi.Framework.Model/Models/UserEntity.cs @@ -5,7 +5,7 @@ using SqlSugar; namespace Yi.Framework.Model.Models { /// - /// + /// 用户表 /// [SugarTable("User")] public partial class UserEntity:IBaseModelEntity diff --git a/Yi.Framework.Net6/Yi.Framework.Model/Models/UserRoleEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/Models/UserRoleEntity.cs index e686a840..a974bd17 100644 --- a/Yi.Framework.Net6/Yi.Framework.Model/Models/UserRoleEntity.cs +++ b/Yi.Framework.Net6/Yi.Framework.Model/Models/UserRoleEntity.cs @@ -5,7 +5,7 @@ using SqlSugar; namespace Yi.Framework.Model.Models { /// - /// + /// 用户角色关系表 /// [SugarTable("UserRole")] public partial class UserRoleEntity:IBaseModelEntity diff --git a/Yi.Framework.Net6/Yi.Framework.Service/ServiceTemplate/UserRoleService.cs b/Yi.Framework.Net6/Yi.Framework.Service/ServiceTemplate/MenuService.cs similarity index 50% rename from Yi.Framework.Net6/Yi.Framework.Service/ServiceTemplate/UserRoleService.cs rename to Yi.Framework.Net6/Yi.Framework.Service/ServiceTemplate/MenuService.cs index d48f838e..cee44d82 100644 --- a/Yi.Framework.Net6/Yi.Framework.Service/ServiceTemplate/UserRoleService.cs +++ b/Yi.Framework.Net6/Yi.Framework.Service/ServiceTemplate/MenuService.cs @@ -5,9 +5,9 @@ using Yi.Framework.Repository; namespace Yi.Framework.Service { - public partial class UserRoleService : BaseService, IUserRoleService + public partial class MenuService : BaseService, IMenuService { - public UserRoleService(IRepository repository) : base(repository) + public MenuService(IRepository repository) : base(repository) { } }