Skip to content

Commit

Permalink
9.0版本更新:
Browse files Browse the repository at this point in the history
新增 ZhonTai.Admin.Contracts权限管理契约库
新增 ZhonTai.Admin.Core权限管理核心库
新增 服务接口支持远程调用
新增 TokenInfo令牌信息,登录返回令牌信息功能重做
强化 程序集帮助类AssemblyHelper
修复 权限管理测试库支持9.0版本
移除 SingleInstanceAttribute 单例注入属性
  • Loading branch information
zhontai committed Jan 17, 2025
1 parent 58587ad commit e331a87
Show file tree
Hide file tree
Showing 475 changed files with 10,657 additions and 643 deletions.
14 changes: 14 additions & 0 deletions src/ZhonTai.sln
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "03.gateways", "03.gateways"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZhonTai.Gateway.Yarp", "gateways\ZhonTai.Gateway.Yarp\ZhonTai.Gateway.Yarp.csproj", "{979BE067-16EE-458F-B414-271749B0C038}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZhonTai.Admin.Core", "modules\admin\ZhonTai.Admin.Core\ZhonTai.Admin.Core.csproj", "{794CBF41-AF02-4B03-B1FE-C362C501F824}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZhonTai.Admin.Contracts", "modules\admin\ZhonTai.Admin.Contracts\ZhonTai.Admin.Contracts.csproj", "{547FC35E-7642-43AF-BCFA-72EED6FC483A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -78,6 +82,14 @@ Global
{979BE067-16EE-458F-B414-271749B0C038}.Debug|Any CPU.Build.0 = Debug|Any CPU
{979BE067-16EE-458F-B414-271749B0C038}.Release|Any CPU.ActiveCfg = Release|Any CPU
{979BE067-16EE-458F-B414-271749B0C038}.Release|Any CPU.Build.0 = Release|Any CPU
{794CBF41-AF02-4B03-B1FE-C362C501F824}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{794CBF41-AF02-4B03-B1FE-C362C501F824}.Debug|Any CPU.Build.0 = Debug|Any CPU
{794CBF41-AF02-4B03-B1FE-C362C501F824}.Release|Any CPU.ActiveCfg = Release|Any CPU
{794CBF41-AF02-4B03-B1FE-C362C501F824}.Release|Any CPU.Build.0 = Release|Any CPU
{547FC35E-7642-43AF-BCFA-72EED6FC483A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{547FC35E-7642-43AF-BCFA-72EED6FC483A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{547FC35E-7642-43AF-BCFA-72EED6FC483A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{547FC35E-7642-43AF-BCFA-72EED6FC483A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -93,6 +105,8 @@ Global
{0602EECF-035B-42C2-B534-E29BC24DE646} = {626D43B7-A210-4754-BB59-357F917D5E86}
{8EB07596-339B-420A-BB32-1FB69D7E7BA5} = {0602EECF-035B-42C2-B534-E29BC24DE646}
{979BE067-16EE-458F-B414-271749B0C038} = {908FBE9E-EF24-4680-9C2F-259EC54D6AC6}
{794CBF41-AF02-4B03-B1FE-C362C501F824} = {65CF5483-DF86-41D7-B367-7C2E28C1672D}
{547FC35E-7642-43AF-BCFA-72EED6FC483A} = {65CF5483-DF86-41D7-B367-7C2E28C1672D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AB40D0C5-E3EA-4A9B-86C2-38F0BB33FC04}
Expand Down
11 changes: 11 additions & 0 deletions src/ZhonTai.sln.EasyRun.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@
"Arguments": null,
"EnvVariables": null,
"Replicas": 1
},
{
"ServiceType": 0,
"Name": "ZhonTai.Admin.Tests",
"TyeName": null,
"ProjectFile": "modules\\admin\\ZhonTai.Admin.Tests\\ZhonTai.Admin.Tests.csproj",
"DefaultSelected": false,
"Bindings": null,
"Arguments": null,
"EnvVariables": null,
"Replicas": 1
}
]
}
Expand Down
24 changes: 24 additions & 0 deletions src/gateways/ZhonTai.Gateway.Yarp/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@
//"Methods": [ "POST", "GET", "DELETE", "PUT" ],
"Hosts": []
}
},
"app": {
"ClusterId": "app",
"Match": {
"Path": "/api/app/{**catch-all}",
//"Methods": [ "POST", "GET", "DELETE", "PUT" ],
"Hosts": []
}
},
"app-doc": {
"ClusterId": "app",
"Match": {
"Path": "/doc/app/{**catch-all}",
//"Methods": [ "POST", "GET", "DELETE", "PUT" ],
"Hosts": []
}
}
},
"Clusters": {
Expand All @@ -34,6 +50,14 @@
}
},
"LoadBalancingPolicy": "RoundRobin"
},
"app": {
"Destinations": {
"destination1": {
"Address": "http://localhost:18020"
}
},
"LoadBalancingPolicy": "RoundRobin"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

namespace ZhonTai.Admin.Domain.Api.Dto;
namespace ZhonTai.Admin.Services.Api.Dto;

public class ApiGetPageDto
public class ApiGetPageInput
{
/// <summary>
/// 接口名称
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using ZhonTai.Admin.Core.Dto;
using System.Collections.Generic;
using System.Threading.Tasks;
using ZhonTai.Admin.Services.Api.Dto;
using ZhonTai.Admin.Domain.Api.Dto;
using System.Collections.Generic;
using ZhonTai.Admin.Core.Dto;
using ZhonTai.Admin.Domain.Api;
using ZhonTai.Admin.Services.Api.Dto;

namespace ZhonTai.Admin.Services.Api;

Expand All @@ -16,7 +15,7 @@ public interface IApiService

Task<List<ApiGetListOutput>> GetListAsync(string key);

Task<PageOutput<ApiEntity>> GetPageAsync(PageInput<ApiGetPageDto> input);
Task<PageOutput<ApiEntity>> GetPageAsync(PageInput<ApiGetPageInput> input);

Task<long> AddAsync(ApiAddInput input);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Refit;
using System.Threading.Tasks;
using ZhonTai.Admin.Core.Attributes;
using ZhonTai.Admin.Core.Auth;
using ZhonTai.Admin.Core.Consts;
using ZhonTai.Admin.Services.Auth.Dto;

namespace ZhonTai.Admin.Services.Auth;

/// <summary>
/// 认证授权客户端接口
/// </summary>
[HttpClientContract(AdminConsts.AreaName)]
public interface IAuthClientService
{
[Post("/api/admin/auth/login")]
Task<TokenInfo> LoginAsync(AuthLoginInput input);
}

/// <summary>
/// 认证授权接口
/// </summary>
public interface IAuthService: IAuthClientService
{
string GetToken(AuthLoginOutput user);

TokenInfo GetTokenInfo(AuthLoginOutput user);

Task<AuthGetUserInfoOutput> GetUserInfoAsync();

Task<AuthGetPasswordEncryptKeyOutput> GetPasswordEncryptKeyAsync();

Task<TokenInfo> Refresh([BindRequired] string token);

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

namespace ZhonTai.Admin.Domain.DictType.Dto;
namespace ZhonTai.Admin.Services.DictType.Dto;

public partial class DictTypeGetPageDto
public partial class DictTypeGetPageInput
{
/// <summary>
/// 字典名称
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using ZhonTai.Admin.Core.Dto;
using System.Threading.Tasks;
using ZhonTai.Admin.Services.DictType.Dto;
using ZhonTai.Admin.Domain.DictType.Dto;

namespace ZhonTai.Admin.Services.DictType;

Expand All @@ -12,7 +11,7 @@ public partial interface IDictTypeService
{
Task<DictTypeGetOutput> GetAsync(long id);

Task<PageOutput<DictTypeGetPageOutput>> GetPageAsync(PageInput<DictTypeGetPageDto> input);
Task<PageOutput<DictTypeGetPageOutput>> GetPageAsync(PageInput<DictTypeGetPageInput> input);

Task<long> AddAsync(DictTypeAddInput input);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace ZhonTai.Admin.Domain.Role.Dto;
namespace ZhonTai.Admin.Services.Role.Dto;

public partial class RoleGetListInput
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace ZhonTai.Admin.Domain.Role.Dto;
namespace ZhonTai.Admin.Services.Role.Dto;

public partial class RoleGetPageDto
public partial class RoleGetPageInput
{
/// <summary>
/// 名称
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace ZhonTai.Admin.Domain.Role.Dto;
namespace ZhonTai.Admin.Services.Role.Dto;

public partial class RoleGetRoleUserListInput
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using ZhonTai.Admin.Core.Dto;
using ZhonTai.Admin.Domain.Role.Dto;
using ZhonTai.Admin.Services.Role.Dto;

namespace ZhonTai.Admin.Services.Role;
Expand All @@ -15,7 +14,7 @@ public interface IRoleService

Task<List<RoleGetListOutput>> GetListAsync(RoleGetListInput input);

Task<PageOutput<RoleGetPageOutput>> GetPageAsync(PageInput<RoleGetPageDto> input);
Task<PageOutput<RoleGetPageOutput>> GetPageAsync(PageInput<RoleGetPageInput> input);

Task<long> AddAsync(RoleAddInput input);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

namespace ZhonTai.Admin.Domain.Tenant.Dto;
namespace ZhonTai.Admin.Services.Tenant.Dto;

public class TenantGetPageDto
public class TenantGetPageInput
{
/// <summary>
/// 企业名称
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Threading.Tasks;
using ZhonTai.Admin.Core.Dto;
using ZhonTai.Admin.Domain.Tenant.Dto;
using ZhonTai.Admin.Services.Tenant.Dto;

namespace ZhonTai.Admin.Services.Tenant;
Expand All @@ -12,7 +11,7 @@ public interface ITenantService
{
Task<TenantGetOutput> GetAsync(long id);

Task<PageOutput<TenantListOutput>> GetPageAsync(PageInput<TenantGetPageDto> input);
Task<PageOutput<TenantListOutput>> GetPageAsync(PageInput<TenantGetPageInput> input);

Task<long> AddAsync(TenantAddInput input);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public interface IUserService

Task<AuthLoginOutput> GetLoginUserAsync(long id);

Task<DataPermissionDto> GetDataPermissionAsync(string? apiPath);
Task<DataPermissionOutput> GetDataPermissionAsync(string? apiPath);

Task<long> AddAsync(UserAddInput input);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../../../platform/Directory.Build.props" />
<PropertyGroup>
<Description>中台Admin权限管理契约库</Description>
<OpenApiGenerateDocuments>false</OpenApiGenerateDocuments>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;1591;8632;RF001;</NoWarn>
</PropertyGroup>

<ItemGroup>
<None Include="../../../../logo.png" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ZhonTai.Admin.Core\ZhonTai.Admin.Core.csproj" />
</ItemGroup>
</Project>
Loading

0 comments on commit e331a87

Please sign in to comment.