Files
jinko.yikatong/Src/Dlhis.Middle/Apis/ICommonApi.cs
2024-11-14 16:24:21 +08:00

28 lines
1013 B
C#

using Dlhis.Middle.Apis.Handlers;
using Dlhis.Middle.Request;
using Dlhis.Middle.Response;
using Kurisu.AspNetCore.UnifyResultAndValidation;
using Kurisu.RemoteCall.Attributes;
namespace Dlhis.Middle.Apis;
[EnableRemoteClient(Name = "face-service", BaseUrl = "${BaseUrl}", PolicyHandler = typeof(ClientHandler))]
public interface ICommonApi
{
[Post("/api/user/oauth2/clientgrant")]
public Task<DefaultApiResult<TokenResponse>> AuthAsync(object request);
[Auth(TokenHandler = typeof(FaceBearerTokenHandler))]
[Get("/api/common/SysData/download")]
public Task<DefaultApiResult<List<T>>> DownloadAsync<T>(string factory, string tableName);
}
//HealthzClientHandler
[EnableRemoteClient(Name = "face-service", BaseUrl = "${BaseUrl}", PolicyHandler = typeof(HealthzClientHandler))]
public interface IHealthzApi
{
[Auth(TokenHandler = typeof(FaceBearerTokenHandler))]
[Post("/api/common/middles/healthz")]
public Task<DefaultApiResult> CheckHealthAsync(HealthCheckRequest request);
}