fix 超时设置
This commit is contained in:
15
Src/Dlhis.Basic.Api/ClientHandler/LongRunClientHandler.cs
Normal file
15
Src/Dlhis.Basic.Api/ClientHandler/LongRunClientHandler.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Kurisu.RemoteCall.Abstractions;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Dlhis.Basic.Api.ClientHandler;
|
||||
|
||||
public class LongRunClientHandler : IHttpRemoteCallPolicyHandler
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public IHttpClientBuilder ConfigureHttpClient(IHttpClientBuilder builder)
|
||||
{
|
||||
builder.ConfigureHttpClient(x => { x.Timeout = TimeSpan.FromHours(1); });
|
||||
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using Kurisu.RemoteCall.Attributes;
|
||||
|
||||
namespace Dlhis.Basic.Api;
|
||||
|
||||
[RequestResultHandler]
|
||||
[EnableRemoteClient(Name = "basic-service", BaseUrl = "${InternalRequest:BasicRequestUrl}")]
|
||||
public interface IGainfoApi
|
||||
{
|
||||
/// <summary>
|
||||
/// 外包自动离职处理
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Post("/api/gainfoOutsource/autoResign")]
|
||||
Task OutsourceAutoResignAsync();
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using Dlhis.Basic.Api.ClientHandler;
|
||||
using Dlhis.Basic.Api.ContentHandlers;
|
||||
using Dlhis.Basic.Api.Response;
|
||||
using Kurisu.RemoteCall.Attributes;
|
||||
@@ -5,7 +6,7 @@ using Kurisu.RemoteCall.Attributes;
|
||||
namespace Dlhis.Basic.Api;
|
||||
|
||||
[RequestResultHandler]
|
||||
[EnableRemoteClient(Name = "basic-service", BaseUrl = "${InternalRequest:BasicRequestUrl}")]
|
||||
[EnableRemoteClient(Name = "longRun-service", BaseUrl = "${InternalRequest:BasicRequestUrl}", PolicyHandler = typeof(LongRunClientHandler))]
|
||||
public interface ISyncApi
|
||||
{
|
||||
[Post("/api/sync/gainfo/werk")]
|
||||
@@ -27,4 +28,11 @@ public interface ISyncApi
|
||||
[Post("/api/sync/businessTrips")]
|
||||
[RequestContentHandler(typeof(CodeContentHandler))]
|
||||
Task HandlerBusinessTripsAsync(string code);
|
||||
|
||||
/// <summary>
|
||||
/// 外包自动离职处理
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Post("/api/gainfoOutsource/autoResign")]
|
||||
Task OutsourceAutoResignAsync();
|
||||
}
|
||||
Reference in New Issue
Block a user