review
This commit is contained in:
parent
a9eaa5e41f
commit
7148bfdc6b
@ -18,13 +18,13 @@ namespace SJZY.Track.Application.CAP.EventHandlers;
|
|||||||
public class TrackDeleteEventHandler : ITransientDependency, ICapSubscribe
|
public class TrackDeleteEventHandler : ITransientDependency, ICapSubscribe
|
||||||
{
|
{
|
||||||
private readonly ICapPublisher _capPublisher;
|
private readonly ICapPublisher _capPublisher;
|
||||||
private readonly IOrderRepository _orderRepository;
|
|
||||||
private readonly ITrackStatusRepository _trackStatusRepository;
|
|
||||||
private readonly ITrackContentRepository _trackContentRepository;
|
|
||||||
private readonly IProvideQueries _provideQueries;
|
|
||||||
private readonly ITrackDetailsEsRepository _trackDetailsEsRepository;
|
|
||||||
private readonly RabbitClientBus _rabbitClientBus;
|
|
||||||
private readonly IOrderOperationRecordEsRepository _orderOperationRecordEsRepository;
|
private readonly IOrderOperationRecordEsRepository _orderOperationRecordEsRepository;
|
||||||
|
private readonly IOrderRepository _orderRepository;
|
||||||
|
private readonly IProvideQueries _provideQueries;
|
||||||
|
private readonly RabbitClientBus _rabbitClientBus;
|
||||||
|
private readonly ITrackContentRepository _trackContentRepository;
|
||||||
|
private readonly ITrackDetailsEsRepository _trackDetailsEsRepository;
|
||||||
|
private readonly ITrackStatusRepository _trackStatusRepository;
|
||||||
|
|
||||||
public TrackDeleteEventHandler(IProvideQueries provideQueries,
|
public TrackDeleteEventHandler(IProvideQueries provideQueries,
|
||||||
IOrderRepository orderRepository, ICapPublisher capPublisher,
|
IOrderRepository orderRepository, ICapPublisher capPublisher,
|
||||||
@ -128,6 +128,7 @@ public class TrackDeleteEventHandler : ITransientDependency, ICapSubscribe
|
|||||||
|
|
||||||
private async Task PublicTrackTopicAsync(TrackDeleteEvent eto, List<TrackDetailsIndex> trackList)
|
private async Task PublicTrackTopicAsync(TrackDeleteEvent eto, List<TrackDetailsIndex> trackList)
|
||||||
{
|
{
|
||||||
|
// // todo: review 这里查库太多了
|
||||||
if (trackList == null)
|
if (trackList == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -167,7 +168,8 @@ public class TrackDeleteEventHandler : ITransientDependency, ICapSubscribe
|
|||||||
Option = 2
|
Option = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
_rabbitClientBus.Publish(GlobalConst.TrackChangeExchange, $"TrackChange.{content.SubSystemCode}", Encoding.UTF8.GetBytes(data.ToJson()));
|
_rabbitClientBus.Publish(GlobalConst.TrackChangeExchange, $"TrackChange.{content.SubSystemCode}",
|
||||||
|
Encoding.UTF8.GetBytes(data.ToJson()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,12 +15,12 @@ namespace SJZY.Track.Application.CAP.EventHandlers;
|
|||||||
|
|
||||||
public class TrackUpsertEventHandler : ITransientDependency, ICapSubscribe
|
public class TrackUpsertEventHandler : ITransientDependency, ICapSubscribe
|
||||||
{
|
{
|
||||||
|
private readonly BroadcastingService _broadcastingService;
|
||||||
private readonly ICapPublisher _capPublisher;
|
private readonly ICapPublisher _capPublisher;
|
||||||
|
private readonly IOrderOperationRecordEsRepository _orderOperationRecordEsRepository;
|
||||||
private readonly IOrderRepository _orderRepository;
|
private readonly IOrderRepository _orderRepository;
|
||||||
private readonly IProvideQueries _provideQueries;
|
private readonly IProvideQueries _provideQueries;
|
||||||
private readonly ITrackDetailsEsRepository _trackDetailsEsRepository;
|
private readonly ITrackDetailsEsRepository _trackDetailsEsRepository;
|
||||||
private readonly BroadcastingService _broadcastingService;
|
|
||||||
private readonly IOrderOperationRecordEsRepository _orderOperationRecordEsRepository;
|
|
||||||
|
|
||||||
public TrackUpsertEventHandler(
|
public TrackUpsertEventHandler(
|
||||||
IOrderRepository orderRepository,
|
IOrderRepository orderRepository,
|
||||||
@ -50,6 +50,7 @@ public class TrackUpsertEventHandler : ITransientDependency, ICapSubscribe
|
|||||||
|
|
||||||
// 处理广播事件
|
// 处理广播事件
|
||||||
if (content is { IsToMq: true })
|
if (content is { IsToMq: true })
|
||||||
|
// todo: review BroadcastingService抽一层接口,面向抽象编程
|
||||||
await _broadcastingService.TrackChangePublicTopicAsync(@event, content);
|
await _broadcastingService.TrackChangePublicTopicAsync(@event, content);
|
||||||
|
|
||||||
if (canNextOrderIds.Count == 0) return;
|
if (canNextOrderIds.Count == 0) return;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user