忽略dll文件git
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace ScheduledTaskClient
|
||||
{
|
||||
public static class IServiceCollectionExtension
|
||||
{
|
||||
public static void AddMsgCenterClient(this IServiceCollection service, string baseUrl="http://scheduledtask")
|
||||
{
|
||||
ScheduledTaskHttpClient._BaseUrl = baseUrl;
|
||||
|
||||
service.AddSingleton<ScheduledTaskHttpClient>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace ScheduledTaskClient
|
||||
{
|
||||
/// <summary>
|
||||
/// 计划消息
|
||||
/// </summary>
|
||||
public class ScheduledMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// 消息名称
|
||||
/// </summary>
|
||||
public string MessageName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 计划类型
|
||||
/// </summary>
|
||||
public ScheduledType ScheduledType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 延迟计划延迟时间
|
||||
/// </summary>
|
||||
public TimeSpan Delaye { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 定期计划cron表达式
|
||||
/// </summary>
|
||||
public string Cron { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 消息内容
|
||||
/// </summary>
|
||||
public string Content { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Etor.Infrastructure\Etor.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,50 +0,0 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Etor.Infrastructure.Common;
|
||||
using Etor.Infrastructure.Extension;
|
||||
using Etor.Infrastructure.Serializer;
|
||||
using Etor.Infrastructure.WebApi;
|
||||
|
||||
namespace ScheduledTaskClient
|
||||
{
|
||||
public class ScheduledTaskHttpClient
|
||||
{
|
||||
private IHttpClientFactory _httpClientFactory;
|
||||
|
||||
internal static string _BaseUrl = "";
|
||||
|
||||
public ScheduledTaskHttpClient(IHttpClientFactory httpClientFactory)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
}
|
||||
|
||||
public string BaseUrl => _BaseUrl;
|
||||
|
||||
private HttpClient CreateHttpClient()
|
||||
{
|
||||
return _httpClientFactory.CreateClient();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置计划消息
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ApiResult> SetScheduledMmessage(ScheduledMessage message)
|
||||
{
|
||||
try
|
||||
{
|
||||
var res = await CreateHttpClient()
|
||||
.PostAsJsonGetString("/api/scheduledtask/v1/message/Set", message);
|
||||
|
||||
return res.FromJsonTo<ApiResult>();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.Error("设置计划消息失败", $"{e}\n消息内容:\n{message.ToJson(true)}");
|
||||
return new ApiResult(ResultCode.C_UNKNOWN_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
namespace ScheduledTaskClient
|
||||
{
|
||||
/// <summary>
|
||||
/// 计划类型
|
||||
/// </summary>
|
||||
public enum ScheduledType
|
||||
{
|
||||
/// <summary>
|
||||
/// 延迟
|
||||
/// </summary>
|
||||
Delayed = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 定期
|
||||
/// </summary>
|
||||
Recurring = 2
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user