refactor 优化代码

This commit is contained in:
2024-11-26 15:26:12 +08:00
parent a32910f0d9
commit 623a5c4e49
88 changed files with 1820 additions and 941 deletions

View File

@@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Kurisu.RemoteCall" Version="0.4.2" />
<PackageReference Include="Kurisu.RemoteCall" Version="0.4.5" />
</ItemGroup>
</Project>

View File

@@ -7,6 +7,7 @@ namespace Dlhis.Sys.Api;
/// <summary>
/// 租户Api
/// </summary>
[RequestResultHandler]
[EnableRemoteClient(Name = "sys-service", BaseUrl = "${InternalRequest:SysRequestUrl}")]
public interface ITenantApi
{
@@ -16,19 +17,18 @@ public interface ITenantApi
/// <returns></returns>
[Auth]
[Get("/api/tenants/list")]
Task<DefaultApiResult<List<TenantResponse>>> GetTenantsAsync();
Task<List<TenantResponse>> GetTenantsAsync();
[Auth]
[Get("/api/tenants/tree")]
Task<DefaultApiResult<List<TenantTreeResponse>>> GetTenantTreeAsync();
Task<List<TenantTreeResponse>> GetTenantTreeAsync();
/// <summary>
/// 获取所有租户(内部使用)
/// </summary>
/// <returns></returns>
[Get("/api/tenants/list-internal")]
Task<DefaultApiResult<List<TenantResponse>>> GetTenantsInternalAsync();
Task<List<TenantResponse>> GetTenantsInternalAsync();
/// <summary>
@@ -38,7 +38,7 @@ public interface ITenantApi
/// <returns></returns>
[Auth]
[Get("/api/tenants/single")]
Task<DefaultApiResult<TenantResponse>> GetTenantByCodeAsync(string code);
Task<TenantResponse> GetTenantByCodeAsync(string code);
/// <summary>
/// 获取我的管理的基地/租户
@@ -46,5 +46,5 @@ public interface ITenantApi
/// <returns></returns>
[Auth]
[Get("/api/tenants/my")]
Task<DefaultApiResult<List<TenantResponse>>> GetMyTenantsAsync();
}
Task<List<TenantResponse>> GetMyTenantsAsync();
}

View File

@@ -1,6 +1,5 @@
using Dlhis.Sys.Api.Response;
using Kurisu.RemoteCall.Attributes;
using Kurisu.RemoteCall.Default;
namespace Dlhis.Sys.Api;
@@ -9,9 +8,9 @@ public interface IUserApi
{
[Auth]
[Get("/api/users")]
Task<DefaultApiResult<UserResponse>> GetUserByIdAsync(int id);
Task<UserResponse> GetUserByIdAsync(int id);
[Auth]
[Post("/api/users/by-ids")]
Task<DefaultApiResult<List<UserResponse>>> GetUserByIdsAsync(List<int> ids);
Task<List<UserResponse>> GetUserByIdsAsync(List<int> ids);
}