Merge remote-tracking branch 'origin/S02-轨迹中台第二部分' into test

This commit is contained in:
dingenwen 2024-03-28 11:10:52 +08:00
commit 44ef1d1199
3 changed files with 7 additions and 6 deletions

View File

@ -19,7 +19,8 @@ public interface ITrackPullCacheService
/// <param name="subSystemId">子系统id</param>
/// <param name="serviceProviderId">服务商id</param>
/// <returns></returns>
Task<TrackPullParamWithContentConfigDto> GetPullParamWithContentConfigAsync(int subSystemId, int serviceProviderId);
Task<TrackPullParamWithContentConfigDto?>
GetPullParamWithContentConfigAsync(int subSystemId, int serviceProviderId);
/// <summary>
/// 设置拉取配置缓存
@ -28,6 +29,6 @@ public interface ITrackPullCacheService
/// <param name="subSystemId">子系统id</param>
/// <param name="serviceProviderId">服务商id</param>
/// <returns></returns>
Task<TrackPullParamWithContentConfigDto> SetPullConfigAsync(int? id = null, int? subSystemId = null,
Task<TrackPullParamWithContentConfigDto?> SetPullConfigAsync(int? id = null, int? subSystemId = null,
int? serviceProviderId = null);
}

View File

@ -35,10 +35,11 @@ public class TrackRefreshEventHandler : ITransientDependency, ICapSubscribe
{
var attach = Base64Helper.DeSerialize<TrackRefreshAttach>(@event.Attach);
if (attach is null) return;
var config = await _trackPullCacheService.GetPullParamWithContentConfigAsync(attach.SubSystemId,
attach.ServiceProviderId);
if (@event.Data == null || config == null) return;
if (@event.Data == null) return;
var data = JObject.Parse(@event.Data);
var orderToken = data[config.ParamConfig.OrderPath];
if (orderToken is JArray orderTokens)

View File

@ -35,7 +35,7 @@ public class TrackPullCacheService : ApplicationService, ITrackPullCacheService
}
[NonAction]
public async Task<TrackPullParamWithContentConfigDto> GetPullParamWithContentConfigAsync(int subSystemId,
public async Task<TrackPullParamWithContentConfigDto?> GetPullParamWithContentConfigAsync(int subSystemId,
int serviceProviderId)
{
var data = await RedisHelper.Client.GetAsync<TrackPullParamWithContentConfigDto>(TrackPullContentKey(
@ -48,7 +48,7 @@ public class TrackPullCacheService : ApplicationService, ITrackPullCacheService
}
[NonAction]
public async Task<TrackPullParamWithContentConfigDto> SetPullConfigAsync(int? id = null, int? subSystemId = null,
public async Task<TrackPullParamWithContentConfigDto?> SetPullConfigAsync(int? id = null, int? subSystemId = null,
int? serviceProviderId = null)
{
var data = new TrackPullParamWithContentConfigDto();
@ -62,7 +62,6 @@ public class TrackPullCacheService : ApplicationService, ITrackPullCacheService
if (trackPullConfigEntity == null) return data;
var trackPullConfigDetail = await _trackPullConfigRepository.GetDetailAsync(trackPullConfigEntity.Id);
if (trackPullConfigDetail is null) return data;
var trackPullContentList = await _trackPullConfigRepository.GetContentListCacheAsync(trackPullConfigEntity.Id);
if (trackPullContentList.Count == 0) return data;