diff --git a/YD_Event.Application/Banner/BannerService.cs b/YD_Event.Application/Banner/BannerService.cs index ff97101..eba6b54 100644 --- a/YD_Event.Application/Banner/BannerService.cs +++ b/YD_Event.Application/Banner/BannerService.cs @@ -62,7 +62,7 @@ public class BannerService : BaseService, ITransi public async Task> GetList() { var config = await GetConfig(); - if (config.Mode == 1) // 自动配置 + if (config.Mode == 0) // 自动配置 { // 获取最新的4场赛事 var events = await _eventRepository.AsQueryable() diff --git a/YD_Event.Application/Banner/Dtos/BannerDtos.cs b/YD_Event.Application/Banner/Dtos/BannerDtos.cs index d7ea892..96ac1f6 100644 --- a/YD_Event.Application/Banner/Dtos/BannerDtos.cs +++ b/YD_Event.Application/Banner/Dtos/BannerDtos.cs @@ -136,7 +136,7 @@ public class BannerOutput public class BannerConfigInput { /// - /// 模式(0-手动配置 1-自动配置) + /// 模式(0-自动配置 1-手动配置) /// [Required] public int Mode { get; set; } @@ -148,7 +148,7 @@ public class BannerConfigInput public class BannerConfigOutput { /// - /// 模式(0-手动配置 1-自动配置) + /// 模式(0-自动配置 1-手动配置) /// public int Mode { get; set; } } diff --git a/YD_Event.Application/Client/EventClientController.cs b/YD_Event.Application/Client/EventClientController.cs index 6a0341d..0f3db7d 100644 --- a/YD_Event.Application/Client/EventClientController.cs +++ b/YD_Event.Application/Client/EventClientController.cs @@ -60,6 +60,7 @@ public class EventClientController : IDynamicApiController private readonly IOptionsMonitor _wechatTenpayClientOptionsMonitor; private readonly ILogger _logger; private readonly OrderNoGeneratorService _orderNoGeneratorService; + private readonly YD_Event.Application.Banner.BannerService _bannerService; public EventClientController( ISqlSugarRepository eventRepository, @@ -93,7 +94,8 @@ public class EventClientController : IDynamicApiController WeChatPayService weChatPayService, IOptionsMonitor wechatTenpayClientOptionsMonitor, ILogger logger, - OrderNoGeneratorService orderNoGeneratorService) + OrderNoGeneratorService orderNoGeneratorService, + YD_Event.Application.Banner.BannerService bannerService) { _eventRepository = eventRepository; _projectRepository = projectRepository; @@ -127,6 +129,7 @@ public class EventClientController : IDynamicApiController _wechatTenpayClientOptionsMonitor = wechatTenpayClientOptionsMonitor; _logger = logger; _orderNoGeneratorService = orderNoGeneratorService; + _bannerService = bannerService; } private long GetCurrentUserId() @@ -148,10 +151,7 @@ public class EventClientController : IDynamicApiController [DisplayName("获取轮播图列表")] public async Task> GetBannerList() { - var list = await _bannerRepository.AsQueryable() - .Where(b => !b.DeleteMark && b.Status == AvailabilityStatus.Enable) - .OrderByDescending(b => b.Sort) - .ToListAsync(); + var list = await _bannerService.GetList(); return list.Select(b => new BannerDto { diff --git a/YD_Event.Core/Entities/BannerConfig.cs b/YD_Event.Core/Entities/BannerConfig.cs index cf5b279..f2584a2 100644 --- a/YD_Event.Core/Entities/BannerConfig.cs +++ b/YD_Event.Core/Entities/BannerConfig.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -13,9 +13,9 @@ namespace YD_Event.Core.Entities public class BannerConfig : Entity, ISoftDelete, ICreatedUserId, ICreatedTime, IUpdatedUserId, IUpdatedTime { /// - /// 模式(0-手动配置 1-自动配置) + /// 模式(0-自动配置 1-手动配置) /// - [SugarColumn(ColumnDescription = "模式(0-手动配置 1-自动配置)")] + [SugarColumn(ColumnDescription = "模式(0-自动配置 1-手动配置)")] public int Mode { get; set; } ///