You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
979 B
32 lines
979 B
using Binance.TradeRobot.Common.DI;
|
|
using Binance.TradeRobot.Common.Http;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace Binance.TradeRobot.Business
|
|
{
|
|
[BatchRegistration(ServiceLifetime.Singleton, RegistrationType.Self)]
|
|
public class DingBusiness
|
|
{
|
|
private RestApiService restApiService;
|
|
public DingBusiness(RestApiService restApiService)
|
|
{
|
|
this.restApiService = restApiService;
|
|
}
|
|
|
|
public void Send(string content)
|
|
{
|
|
try
|
|
{
|
|
restApiService.SendRequest("https://oapi.dingtalk.com/robot/send", "?access_token=be2f574475269e83584fa3ef1a93ef68e28c15402afa1d193aa82a1a51164850", new
|
|
{
|
|
msgtype = "text",
|
|
text = new
|
|
{
|
|
content
|
|
}
|
|
}, null, System.Net.Http.HttpMethod.Post);
|
|
}
|
|
catch { }
|
|
}
|
|
}
|
|
}
|
|
|