feat 消息推送api
This commit is contained in:
@@ -15,4 +15,51 @@ public class Startup : DefaultStartup
|
||||
{
|
||||
IdentityModelEventSource.ShowPII = true;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
base.ConfigureServices(services);
|
||||
|
||||
services.AddHttpClient("jinko.oa", (_, _) => { })
|
||||
.ConfigurePrimaryHttpMessageHandler(() =>
|
||||
{
|
||||
var handler = new HttpClientHandler
|
||||
{
|
||||
ClientCertificateOptions = ClientCertificateOption.Manual,
|
||||
ServerCertificateCustomValidationCallback = (_, _, _, _) => true
|
||||
};
|
||||
|
||||
return handler;
|
||||
});
|
||||
|
||||
services.AddHttpClient("jinko.httpclient", (sp, httpClient) =>
|
||||
{
|
||||
// "BaseUrl": "https://oapi.dingtalk.com",
|
||||
// "AgentId": "2768073678",
|
||||
// "AppId": "dingumelppews6rah7x9",
|
||||
// "AppSecret": "nsWfJTVjYesHVzrLiP-t1TQqMQvC1L_kZNfXfnIyzcXK4pCTfKprkjZcxAbsDR_l",
|
||||
|
||||
httpClient.BaseAddress = new Uri("https://oapi.dingtalk.com");
|
||||
httpClient.Timeout = TimeSpan.FromSeconds(30);
|
||||
})
|
||||
// .SetHandlerLifetime(TimeSpan.FromMinutes(5))
|
||||
// .addd((res) =>
|
||||
// {
|
||||
// return HttpPolicyExtensions
|
||||
// .HandleTransientHttpError()
|
||||
// .OrResult(msg => msg.StatusCode != HttpStatusCode.OK)
|
||||
// .WaitAndRetryAsync(6, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)));
|
||||
// })
|
||||
.ConfigurePrimaryHttpMessageHandler(() =>
|
||||
{
|
||||
var handler = new HttpClientHandler
|
||||
{
|
||||
ClientCertificateOptions = ClientCertificateOption.Manual,
|
||||
ServerCertificateCustomValidationCallback = (_, _, _, _) => true
|
||||
};
|
||||
|
||||
return handler;
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user