Skip to content

Commit

Permalink
Merge pull request #154 from zgcwkj/YiShaAdmin-Net6
Browse files Browse the repository at this point in the history
🎁 升级代码
  • Loading branch information
liukuo362573 committed Jun 20, 2023
2 parents 6ff7e01 + de19fba commit 5d07b10
Show file tree
Hide file tree
Showing 84 changed files with 1,142 additions and 1,069 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Expand Up @@ -348,9 +348,9 @@ healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
Publish
YiSha.Web/YiSha.Admin.Web/DataProtection
YiSha.Web/YiSha.Admin.WebApi/DataProtection
YiSha.Web/YiSha.Admin.Web/Resource
YiSha.Web/YiSha.Admin.Web/DataProtection
YiSha.Web/YiSha.Admin.WebApi/Resource
YiSha.Web/YiSha.Admin.WebApi/DataProtection

.idea/
2 changes: 1 addition & 1 deletion Document/DatabaseScript/mysql_data.sql
Expand Up @@ -3889,7 +3889,7 @@ INSERT INTO `SysMenu` (`Id`, `BaseIsDelete`, `BaseCreateTime`, `BaseModifyTime`,
(16508640061130131, 0, '2019-01-05 07:42:31', '2019-02-08 10:30:52', 0, 0, 0, 16508640061130129, '文章新增', '', '', '', 2, 3, 1, 'organization:news:add', ''),
(16508640061130132, 0, '2019-01-05 07:42:49', '2019-02-08 10:31:01', 0, 0, 0, 16508640061130129, '文章修改', '', '', '', 3, 3, 1, 'organization:news:edit', ''),
(16508640061130133, 0, '2019-01-05 07:43:19', '2019-02-08 10:31:08', 0, 0, 0, 16508640061130129, '文章删除', '', '', '', 4, 3, 1, 'organization:news:delete', ''),
(16508640061130134, 0, '2019-01-07 13:05:40', '2019-07-28 19:20:06', 0, 16508640061130151, 0, 16508640061130070, '系统api', '', 'https://www.yishasoft.com/api/api-doc', '', 13, 2, 1, 'system:api:view', ''),
(16508640061130134, 0, '2019-01-07 13:05:40', '2019-07-28 19:20:06', 0, 16508640061130151, 0, 16508640061130070, '开发文档', '', 'http://www.toolhelper.cn/doc/', '', 13, 2, 1, 'system:api:view', ''),
(16508640061130135, 0, '2019-01-09 17:05:00', '2019-01-09 17:05:00', 0, 0, 0, 16508640061130076, 'Api日志', '', 'SystemManage/LogApi/LogApiIndex', '', 3, 2, 1, 'system:logapi:view', ''),
(16508640061130136, 0, '2019-01-09 17:06:11', '2019-01-09 17:06:31', 0, 0, 0, 16508640061130135, 'Api日志查询', '', '', '', 1, 3, 1, 'system:logapi:search', ''),
(16508640061130137, 0, '2019-01-09 17:07:24', '2019-01-09 17:07:24', 0, 0, 0, 16508640061130135, 'Api日志删除', '', '', '', 2, 3, 1, 'system:logapi:delete', ''),
Expand Down
2 changes: 1 addition & 1 deletion Document/DatabaseScript/sqlserver_data.sql
Expand Up @@ -3879,7 +3879,7 @@ INSERT [dbo].[SysMenu] ([Id], [BaseIsDelete], [BaseCreateTime], [BaseModifyTime]
INSERT [dbo].[SysMenu] ([Id], [BaseIsDelete], [BaseCreateTime], [BaseModifyTime], [BaseCreatorId], [BaseModifierId], [BaseVersion], [ParentId], [MenuName], [MenuIcon], [MenuUrl], [MenuTarget], [MenuSort], [MenuType], [MenuStatus], [Authorize], [Remark]) VALUES (16508640061130131, 0, CAST(0x0000A9CC007F08B4 AS DateTime), CAST(0x0000A9EE00AD45D0 AS DateTime), 0, 0, 0, 16508640061130129, N'文章新增', N'', N'', N'', 2, 3, 1, N'organization:news:add', N'')
INSERT [dbo].[SysMenu] ([Id], [BaseIsDelete], [BaseCreateTime], [BaseModifyTime], [BaseCreatorId], [BaseModifierId], [BaseVersion], [ParentId], [MenuName], [MenuIcon], [MenuUrl], [MenuTarget], [MenuSort], [MenuType], [MenuStatus], [Authorize], [Remark]) VALUES (16508640061130132, 0, CAST(0x0000A9CC007F1DCC AS DateTime), CAST(0x0000A9EE00AD505C AS DateTime), 0, 0, 0, 16508640061130129, N'文章修改', N'', N'', N'', 3, 3, 1, N'organization:news:edit', N'')
INSERT [dbo].[SysMenu] ([Id], [BaseIsDelete], [BaseCreateTime], [BaseModifyTime], [BaseCreatorId], [BaseModifierId], [BaseVersion], [ParentId], [MenuName], [MenuIcon], [MenuUrl], [MenuTarget], [MenuSort], [MenuType], [MenuStatus], [Authorize], [Remark]) VALUES (16508640061130133, 0, CAST(0x0000A9CC007F40F4 AS DateTime), CAST(0x0000A9EE00AD5890 AS DateTime), 0, 0, 0, 16508640061130129, N'文章删除', N'', N'', N'', 4, 3, 1, N'organization:news:delete', N'')
INSERT [dbo].[SysMenu] ([Id], [BaseIsDelete], [BaseCreateTime], [BaseModifyTime], [BaseCreatorId], [BaseModifierId], [BaseVersion], [ParentId], [MenuName], [MenuIcon], [MenuUrl], [MenuTarget], [MenuSort], [MenuType], [MenuStatus], [Authorize], [Remark]) VALUES (16508640061130134, 0, CAST(0x0000A9CE00D7CA30 AS DateTime), CAST(0x0000AA98013EA188 AS DateTime), 0, 16508640061130151, 0, 16508640061130070, N'系统api', N'', N'https://www.yishasoft.com/api/api-doc', N'', 13, 2, 1, N'system:api:view', N'')
INSERT [dbo].[SysMenu] ([Id], [BaseIsDelete], [BaseCreateTime], [BaseModifyTime], [BaseCreatorId], [BaseModifierId], [BaseVersion], [ParentId], [MenuName], [MenuIcon], [MenuUrl], [MenuTarget], [MenuSort], [MenuType], [MenuStatus], [Authorize], [Remark]) VALUES (16508640061130134, 0, CAST(0x0000A9CE00D7CA30 AS DateTime), CAST(0x0000AA98013EA188 AS DateTime), 0, 16508640061130151, 0, 16508640061130070, N'开发文档', N'', N'http://www.toolhelper.cn/doc/', N'', 13, 2, 1, N'system:api:view', N'')
INSERT [dbo].[SysMenu] ([Id], [BaseIsDelete], [BaseCreateTime], [BaseModifyTime], [BaseCreatorId], [BaseModifierId], [BaseVersion], [ParentId], [MenuName], [MenuIcon], [MenuUrl], [MenuTarget], [MenuSort], [MenuType], [MenuStatus], [Authorize], [Remark]) VALUES (16508640061130135, 0, CAST(0x0000A9D001198650 AS DateTime), CAST(0x0000A9D001198650 AS DateTime), 0, 0, 0, 16508640061130076, N'Api日志', N'', N'SystemManage/LogApi/LogApiIndex', N'', 3, 2, 1, N'system:logapi:view', N'')
INSERT [dbo].[SysMenu] ([Id], [BaseIsDelete], [BaseCreateTime], [BaseModifyTime], [BaseCreatorId], [BaseModifierId], [BaseVersion], [ParentId], [MenuName], [MenuIcon], [MenuUrl], [MenuTarget], [MenuSort], [MenuType], [MenuStatus], [Authorize], [Remark]) VALUES (16508640061130136, 0, CAST(0x0000A9D00119D984 AS DateTime), CAST(0x0000A9D00119F0F4 AS DateTime), 0, 0, 0, 16508640061130135, N'Api日志查询', N'', N'', N'', 1, 3, 1, N'system:logapi:search', N'')
INSERT [dbo].[SysMenu] ([Id], [BaseIsDelete], [BaseCreateTime], [BaseModifyTime], [BaseCreatorId], [BaseModifierId], [BaseVersion], [ParentId], [MenuName], [MenuIcon], [MenuUrl], [MenuTarget], [MenuSort], [MenuType], [MenuStatus], [Authorize], [Remark]) VALUES (16508640061130137, 0, CAST(0x0000A9D0011A2F10 AS DateTime), CAST(0x0000A9D0011A2F10 AS DateTime), 0, 0, 0, 16508640061130135, N'Api日志删除', N'', N'', N'', 2, 3, 1, N'system:logapi:delete', N'')
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
19 changes: 6 additions & 13 deletions README.md
@@ -1,13 +1,7 @@
## YiShaAdmin

YiShaAdmin 基于.NET Core Web开发,借鉴了很多开源项目的优点,让你开发Web管理系统和移动端Api更简单,所以我也把她开源了。
她可以用于所有的Web应用程序,例如网站管理后台、CMS、CRM、ERP、OA这类的系统和移动端Api。<br />

| YiShaAdmin 版本 | .NET Core 版本 | 是否支持 | 链接 | Developer |
|:-----|:-----|:-----|:-----|:-----|
| 6.0 | 6.0 | 支持(开发中,不建议商用) | [YiShaAdmin-Net6.0](https://github.com/liukuo362573/YiShaAdmin/tree/YiShaAdmin-Net6) | [zgcwkj](https://github.com/zgcwkj) |
| 3.1 | 3.1 | 支持 | [YiShaAdmin-Net3.1](https://github.com/liukuo362573/YiShaAdmin/tree/master) | |
| 2.2 | 2.2 | 支持 | [YiShaAdmin-Net2.2](https://github.com/liukuo362573/YiShaAdmin/releases/tag/v2.2)| |


## 内置功能

Expand All @@ -26,7 +20,6 @@
- 代码生成:快速生成对单表的增删改查
- 服务器信息:查看服务器的基本信息


## 开发文档

文档地址:[https://www.toolhelper.cn/doc](http://www.toolhelper.cn/doc)
Expand All @@ -37,10 +30,10 @@

## 演示图

![登录页面](https://raw.githubusercontent.com/liukuo362573/YiShaAdmin/master/YiSha.Web/YiSha.Admin.Web/wwwroot/image/demo_1.jpg)
![登录进去首页](https://raw.githubusercontent.com/liukuo362573/YiShaAdmin/master/YiSha.Web/YiSha.Admin.Web/wwwroot/image/demo_2.png)
![用户列表](https://raw.githubusercontent.com/liukuo362573/YiShaAdmin/master/YiSha.Web/YiSha.Admin.Web/wwwroot/image/demo_3.png)
![用户列表修改](https://raw.githubusercontent.com/liukuo362573/YiShaAdmin/master/YiSha.Web/YiSha.Admin.Web/wwwroot/image/demo_4.png)
![登录页面](Document/demo_1.jpg)
![登录进去首页](Document/demo_2.png)
![用户列表](Document/demo_3.png)
![用户列表修改](Document/demo_4.png)

## 如何参与开源项目

Expand All @@ -54,4 +47,4 @@

## License

[MIT](https://github.com/liukuo362573/yishaadmin/blob/master/LICENSE)
[MIT](LICENSE)
@@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Quartz" Version="3.0.7" />
<PackageReference Include="Quartz" Version="3.6.2" />
</ItemGroup>

<ItemGroup>
Expand Down
@@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
Expand Down
50 changes: 24 additions & 26 deletions YiSha.Business/YiSha.Business/SystemManage/MenuBLL.cs
@@ -1,18 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YiSha.Entity;
using YiSha.Service;
using YiSha.Service.SystemManage;
using YiSha.Business.Cache;
using YiSha.Entity.SystemManage;
using YiSha.Model.Result;
using YiSha.Model;
using YiSha.Util.Model;
using YiSha.Business.Cache;
using YiSha.Model.Param.SystemManage;
using YiSha.Model.Result;
using YiSha.Service.SystemManage;
using YiSha.Util.Extension;
using YiSha.Util.Model;

namespace YiSha.Business.SystemManage
{
Expand All @@ -23,11 +15,12 @@ public class MenuBLL
private MenuCache menuCache = new MenuCache();

#region 获取数据
public async Task<TData<List<MenuEntity>>> GetList(MenuListParam param)

public async Task<TData<List<MenuEntity>>> GetList(MenuListParam? param = default)
{
var obj = new TData<List<MenuEntity>>();

List<MenuEntity> list = await menuCache.GetList();
var list = await menuCache.GetList();
list = ListFilter(param, list);

obj.Data = list;
Expand All @@ -40,10 +33,10 @@ public async Task<TData<List<ZtreeInfo>>> GetZtreeList(MenuListParam param)
var obj = new TData<List<ZtreeInfo>>();
obj.Data = new List<ZtreeInfo>();

List<MenuEntity> list = await menuCache.GetList();
var list = await menuCache.GetList();
list = ListFilter(param, list);

foreach (MenuEntity menu in list)
foreach (var menu in list)
{
obj.Data.Add(new ZtreeInfo
{
Expand All @@ -59,14 +52,14 @@ public async Task<TData<List<ZtreeInfo>>> GetZtreeList(MenuListParam param)

public async Task<TData<MenuEntity>> GetEntity(long id)
{
TData<MenuEntity> obj = new TData<MenuEntity>();
var obj = new TData<MenuEntity>();
obj.Data = await menuService.GetEntity(id);
if (obj.Data != null)
{
long parentId = obj.Data.ParentId.Value;
var parentId = obj.Data.ParentId.Value;
if (parentId > 0)
{
MenuEntity parentMenu = await menuService.GetEntity(parentId);
var parentMenu = await menuService.GetEntity(parentId);
if (parentMenu != null)
{
obj.Data.ParentName = parentMenu.MenuName;
Expand All @@ -83,17 +76,19 @@ public async Task<TData<MenuEntity>> GetEntity(long id)

public async Task<TData<int>> GetMaxSort(long parentId)
{
TData<int> obj = new TData<int>();
var obj = new TData<int>();
obj.Data = await menuService.GetMaxSort(parentId);
obj.Tag = 1;
return obj;
}
#endregion

#endregion 获取数据

#region 提交数据

public async Task<TData<string>> SaveForm(MenuEntity entity)
{
TData<string> obj = new TData<string>();
var obj = new TData<string>();
if (!entity.Id.IsNullOrZero() && entity.Id == entity.ParentId)
{
obj.Message = "不能选择自己作为上级菜单!";
Expand All @@ -115,17 +110,19 @@ public async Task<TData<string>> SaveForm(MenuEntity entity)

public async Task<TData> DeleteForm(string ids)
{
TData obj = new TData();
var obj = new TData();
await menuService.DeleteForm(ids);

menuCache.Remove();
obj.Tag = 1;
return obj;
}
#endregion

#endregion 提交数据

#region 私有方法
private List<MenuEntity> ListFilter(MenuListParam param, List<MenuEntity> list)

private List<MenuEntity> ListFilter(MenuListParam? param, List<MenuEntity> list)
{
if (param != null)
{
Expand All @@ -140,6 +137,7 @@ private List<MenuEntity> ListFilter(MenuListParam param, List<MenuEntity> list)
}
return list;
}
#endregion

#endregion 私有方法
}
}
4 changes: 3 additions & 1 deletion YiSha.Business/YiSha.Business/YiSha.Business.csproj
@@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion YiSha.Business/YiSha.Service/YiSha.Service.csproj
@@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions YiSha.Cache/YiSha.Cache.Factory/YiSha.Cache.Factory.csproj
Expand Up @@ -2,6 +2,8 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
Expand Down
@@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

</Project>
6 changes: 4 additions & 2 deletions YiSha.Cache/YiSha.MemoryCache/YiSha.MemoryCache.csproj
@@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="3.1.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 5 additions & 3 deletions YiSha.Cache/YiSha.RedisCache/YiSha.RedisCache.csproj
@@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="StackExchange.Redis" Version="2.0.600" />
<PackageReference Include="StackExchange.Redis" Version="2.6.116" />
</ItemGroup>

<ItemGroup>
Expand Down
15 changes: 3 additions & 12 deletions YiSha.Data/YiSha.Data.EF/YiSha.Data.EF.csproj
@@ -1,20 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Database\OracleDatabase.cs" />
<Compile Remove="DbContext\OracleDbContext.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.5" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.1" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\YiSha.Util\YiSha.Util\YiSha.Util.csproj" />
<ProjectReference Include="..\YiSha.Data\YiSha.Data.csproj" />
Expand Down
@@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
Expand Down
12 changes: 8 additions & 4 deletions YiSha.Data/YiSha.Data/DbHelper.cs
Expand Up @@ -101,7 +101,8 @@ public async Task<IDataReader> ExecuteReadeAsync(CommandType cmdType, string str
dbContext,
Guid.NewGuid(),
connection.ConnectionId,
startTime);
startTime,
CommandSource.Unknown);

var reader = interceptionResult.HasResult
? interceptionResult.Result
Expand All @@ -117,7 +118,8 @@ public async Task<IDataReader> ExecuteReadeAsync(CommandType cmdType, string str
connection.ConnectionId,
reader,
startTime,
stopwatch.Elapsed);
stopwatch.Elapsed,
CommandSource.Unknown);
}
return reader;
}
Expand Down Expand Up @@ -169,7 +171,8 @@ public async Task<object> ExecuteScalarAsync(CommandType cmdType, string strSql,
dbContext,
Guid.NewGuid(),
connection.ConnectionId,
startTime);
startTime,
CommandSource.Unknown);

var obj = interceptionResult.HasResult
? interceptionResult.Result
Expand All @@ -185,7 +188,8 @@ public async Task<object> ExecuteScalarAsync(CommandType cmdType, string strSql,
connection.ConnectionId,
obj,
startTime,
stopwatch.Elapsed);
stopwatch.Elapsed,
CommandSource.Unknown);
}
return obj;
}
Expand Down
14 changes: 8 additions & 6 deletions YiSha.Data/YiSha.Data/YiSha.Data.csproj
@@ -1,14 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.5" />
<PackageReference Include="MySqlConnector" Version="1.3.8" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.18" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.18" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.100" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 5d07b10

Please sign in to comment.