fix: 调整服务生命周期声明为单例

This commit is contained in:
云龙 王 2024-10-22 14:34:46 +08:00
parent 4f5f8b4cfa
commit c9a2e8d824
2 changed files with 4 additions and 2 deletions

View File

@ -5,6 +5,7 @@ using SJZY.Expand.ABP.Core.Logger;
using SJZY.Track.Application.Contract.Services; using SJZY.Track.Application.Contract.Services;
using SJZY.Track.Application.Track2InterfaceRelay; using SJZY.Track.Application.Track2InterfaceRelay;
using SJZY.Track.Domain.Aggregates.OrderAggregate; using SJZY.Track.Domain.Aggregates.OrderAggregate;
using Volo.Abp.DependencyInjection;
namespace SJZY.Track.Application.Services.TimerTaskss; namespace SJZY.Track.Application.Services.TimerTaskss;
@ -12,7 +13,7 @@ namespace SJZY.Track.Application.Services.TimerTaskss;
/// 轨迹运输时效预警定时任务 /// 轨迹运输时效预警定时任务
/// </summary> /// </summary>
[ApiExplorerSettings(GroupName = "定时任务")] [ApiExplorerSettings(GroupName = "定时任务")]
public class TrackWarningTask : ApplicationService public class TrackWarningTask : ApplicationService, ISingletonDependency
{ {
private readonly IOptionsSnapshot<Track2InterfaceRelayOptions> _options; private readonly IOptionsSnapshot<Track2InterfaceRelayOptions> _options;
private readonly IOrderRepository _orderRepository; private readonly IOrderRepository _orderRepository;

View File

@ -8,6 +8,7 @@ using SJZY.Track.Application.Localization;
using SJZY.Track.Domain.Aggregates.TrackPushAggregate; using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
using SJZY.Track.Domain.Dtos.Common; using SJZY.Track.Domain.Dtos.Common;
using SJZY.Track.Domain.Dtos.TrackPush; using SJZY.Track.Domain.Dtos.TrackPush;
using Volo.Abp.DependencyInjection;
namespace SJZY.Track.Application.Services.TrackPush; namespace SJZY.Track.Application.Services.TrackPush;
@ -16,7 +17,7 @@ namespace SJZY.Track.Application.Services.TrackPush;
/// </summary> /// </summary>
[ApiExplorerSettings(GroupName = "轨迹推送")] [ApiExplorerSettings(GroupName = "轨迹推送")]
[Route("/Track/PushConfig")] [Route("/Track/PushConfig")]
public class TrackPushService : ApplicationService public class TrackPushService : ApplicationService, ISingletonDependency
{ {
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer; private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
private readonly ITrackPushCacheService _trackPushCacheService; private readonly ITrackPushCacheService _trackPushCacheService;