发通知
This commit is contained in:
parent
22ebcda424
commit
4a2b87ba36
@ -9,16 +9,17 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BSI.Stack.Rabbit" Version="2.0.9" />
|
||||
<PackageReference Include="SJZY.FSCenter.Client" Version="1.5.7"/>
|
||||
<PackageReference Include="SJZY.InterfaceRelay.Application.Contracts" Version="7.2.3"/>
|
||||
<PackageReference Include="Volo.Abp.Http.Client" Version="7.0.2" />
|
||||
<PackageReference Include="Volo.Abp.FluentValidation" Version="7.0.2" />
|
||||
<PackageReference Include="SJZY.UserCenter.HttpApi" Version="3.0.9-alpha"/>
|
||||
<PackageReference Include="SJZY.Expand.CAP" Version="7.8.0" />
|
||||
<PackageReference Include="DotNetCore.CAP" Version="8.1.2"/>
|
||||
<PackageReference Include="DotNetCore.CAP.Dashboard" Version="8.1.2"/>
|
||||
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="8.1.2"/>
|
||||
<PackageReference Include="DotNetCore.CAP.MySql" Version="8.1.2"/>
|
||||
<PackageReference Include="DotNetCore.CAP.InMemoryStorage" Version="8.1.2"/>
|
||||
<PackageReference Include="DotNetCore.CAP" Version="8.2.0"/>
|
||||
<PackageReference Include="DotNetCore.CAP.Dashboard" Version="8.2.0"/>
|
||||
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="8.2.0"/>
|
||||
<PackageReference Include="DotNetCore.CAP.MySql" Version="8.2.0"/>
|
||||
<PackageReference Include="DotNetCore.CAP.InMemoryStorage" Version="8.2.0"/>
|
||||
<PackageReference Include="Savorboard.CAP.InMemoryMessageQueue" Version="7.0.0"/>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@ -2,13 +2,20 @@ using System.Text;
|
||||
using FreeRedis;
|
||||
using SJZY.Expand.ABP.Core;
|
||||
using SJZY.Expand.ABP.Core.Logger;
|
||||
using SJZY.FSCenter.Application.Dtos.Message;
|
||||
using SJZY.FSCenter.Client.Client.Message;
|
||||
using SJZY.FSCenter.Repository.Enum;
|
||||
using SJZY.Track.Application.Contract.Dtos.Forewarning;
|
||||
using SJZY.Track.Application.Contract.Services;
|
||||
using SJZY.Track.Domain.Aggregates.ForewarningAggregate;
|
||||
using SJZY.Track.Domain.Dtos.Forewarning;
|
||||
using SJZY.Track.Domain.Queries;
|
||||
using SJZY.Track.Share.Enums;
|
||||
using SJZY.UserCenter.HttpApi.Services.Message;
|
||||
using SJZY.UserCenter.SharedModel.Dtos.Message;
|
||||
using SJZY.UserCenter.SharedModel.Enums;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
using Volo.Abp.Http.Client.DynamicProxying;
|
||||
|
||||
namespace SJZY.Track.Application.Services.ForewarningServices;
|
||||
|
||||
@ -18,15 +25,20 @@ namespace SJZY.Track.Application.Services.ForewarningServices;
|
||||
public class ForewarningNotifyService : IForewarningNotifyService, ITransientDependency
|
||||
{
|
||||
private readonly IForewarningCacheService _cacheService;
|
||||
private readonly IMessageClient _messageClient;
|
||||
private readonly IHttpClientProxy<IRequestSendMessageService> _requestSendMessageService;
|
||||
private readonly IWarningQueries _warningQueries;
|
||||
private readonly IWarningRecordEsRepository _warningRecordEsRepository;
|
||||
|
||||
public ForewarningNotifyService(IForewarningCacheService cacheService, IWarningQueries warningQueries,
|
||||
IWarningRecordEsRepository warningRecordEsRepository)
|
||||
IWarningRecordEsRepository warningRecordEsRepository,
|
||||
IHttpClientProxy<IRequestSendMessageService> requestSendMessageService, IMessageClient messageClient)
|
||||
{
|
||||
_cacheService = cacheService;
|
||||
_warningQueries = warningQueries;
|
||||
_warningRecordEsRepository = warningRecordEsRepository;
|
||||
_requestSendMessageService = requestSendMessageService;
|
||||
_messageClient = messageClient;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -162,11 +174,41 @@ public class ForewarningNotifyService : IForewarningNotifyService, ITransientDep
|
||||
if (!string.IsNullOrEmpty(siteInternalContent))
|
||||
{
|
||||
// todo:发送站内通知
|
||||
_ = _requestSendMessageService.Service.SendMessageByEmptyTemplateAsync(
|
||||
new SendMessageByEmptyTemplateInput
|
||||
{
|
||||
IsNeedToHandle = null,
|
||||
BizId = null,
|
||||
MsgSource = null,
|
||||
SystemId = 0,
|
||||
TemplateCode = null,
|
||||
Channels = null,
|
||||
MsgTitle = null,
|
||||
MsgContent = null,
|
||||
PcURl = null,
|
||||
MobileURl = null,
|
||||
FileUrl = null,
|
||||
fileName = null,
|
||||
receivers = null,
|
||||
SiteLetterComponentStyle = (ComponentStyle) 0
|
||||
});
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(feiShuContent))
|
||||
{
|
||||
// todo:发送飞书通知
|
||||
// 发送飞书通知
|
||||
_ = _messageClient.SendMessageAsync(new SendMessageInput
|
||||
{
|
||||
AppId = null,
|
||||
AppSecret = null,
|
||||
ReceiveIdType = IdTypeEnums.user_id,
|
||||
MsgType = MsgTypeEnums.文本,
|
||||
ReceiveIds = new List<string>
|
||||
{
|
||||
userRule.Key.ToString()
|
||||
},
|
||||
Content = feiShuContent
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ using Savorboard.CAP.InMemoryMessageQueue;
|
||||
using SJZY.Expand.ABP.Core.Localization;
|
||||
using SJZY.Expand.ABP.Core.Logger;
|
||||
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||
using SJZY.FSCenter.Client;
|
||||
using SJZY.InterfaceRelay.Application.Contracts;
|
||||
using SJZY.Track.Application.CAP;
|
||||
using SJZY.Track.Application.Contract;
|
||||
@ -34,7 +35,8 @@ namespace SJZY.Track.Application;
|
||||
typeof(SjzyUserCenterHttpApiModule),
|
||||
typeof(SJZYInterfaceRelayApplicationContractsModule),
|
||||
typeof(SjzyTrackDomainModule),
|
||||
typeof(SjzyTrackApplicationContractModule)
|
||||
typeof(SjzyTrackApplicationContractModule),
|
||||
typeof(FSCenterModule)
|
||||
)]
|
||||
public class SjzyTrackApplicationModule : AbpModule
|
||||
{
|
||||
@ -149,6 +151,9 @@ public class SjzyTrackApplicationModule : AbpModule
|
||||
}
|
||||
};
|
||||
}, typeof(SjzyTrackApplicationModule).Assembly);
|
||||
|
||||
// 飞书
|
||||
context.Services.Configure<SystemKeyOption>(option => { option.SystemKey = "aaa"; });
|
||||
}
|
||||
|
||||
public override void PreConfigureServices(ServiceConfigurationContext context)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user