Ver Fonte

Merge branch 'feature/snapshot' into test

qinchaoyue há 1 mês atrás
pai
commit
94eca393c7

+ 13 - 1
src/Hotline.Api/Controllers/Snapshot/SnapshotController.cs

@@ -51,8 +51,9 @@ public class SnapshotController : BaseController
     private readonly ISessionContext _sessionContext;
     private readonly IThirdAccountRepository _thirdAccountRepository;
     private readonly ILogger<SnapshotController> _logger;
+    private readonly IRepository<SystemWebPageSetting> _webPageRepository;
 
-    public SnapshotController(IRepository<Order> orderRepository, ISnapshotApplication snapshotApplication, ISystemAreaDomainService systemAreaDomainService, IIndustryRepository industryRepository, IOrderDomainService orderDomainService, IFileRepository fileRepository, IOrderSnapshotRepository orderSnapshotRepository, ISystemDicDataCacheManager systemDicDataCacheManager, ISessionContext sessionContext, IThirdAccountRepository thirdAccountRepository, ILogger<SnapshotController> logger)
+    public SnapshotController(IRepository<Order> orderRepository, ISnapshotApplication snapshotApplication, ISystemAreaDomainService systemAreaDomainService, IIndustryRepository industryRepository, IOrderDomainService orderDomainService, IFileRepository fileRepository, IOrderSnapshotRepository orderSnapshotRepository, ISystemDicDataCacheManager systemDicDataCacheManager, ISessionContext sessionContext, IThirdAccountRepository thirdAccountRepository, ILogger<SnapshotController> logger, IRepository<SystemWebPageSetting> webPageRepository)
     {
         _orderRepository = orderRepository;
         _snapshotApplication = snapshotApplication;
@@ -65,6 +66,7 @@ public class SnapshotController : BaseController
         _sessionContext = sessionContext;
         _thirdAccountRepository = thirdAccountRepository;
         _logger = logger;
+        _webPageRepository = webPageRepository;
     }
 
     /// <summary>
@@ -76,6 +78,16 @@ public class SnapshotController : BaseController
     public async Task<HomePageOutDto> GetHomePageAsync()
         => await _snapshotApplication.GetHomePageAsync();
 
+    /// <summary>
+    /// 获取页面设置
+    /// </summary>
+    /// <param name="dto"></param>
+    /// <returns></returns>
+    [HttpGet("page/setting")]
+    [AllowAnonymous]
+    public async Task<IList<SystemWebPageSetting>> GetSystemWebPageAsync([FromQuery] SystemWebPageInDto dto)
+        => await _webPageRepository.Queryable().Where(m => m.Name == dto.Name && m.PageType == dto.PageType).ToListAsync(HttpContext.RequestAborted);
+
     /// <summary>
     /// 行业界面基础信息
     /// </summary>

+ 15 - 0
src/Hotline.Share/Dtos/Snapshot/IndustryDto.cs

@@ -1,6 +1,7 @@
 using Hotline.Share.Dtos.File;
 using Hotline.Share.Dtos.Settings;
 using Hotline.Share.Enums.Order;
+using Hotline.Share.Enums.Settings;
 using Hotline.Share.Enums.Snapshot;
 using Hotline.Share.Requests;
 using Hotline.Share.Tools;
@@ -206,6 +207,20 @@ public record IndustryListInDto(string? Name, string? ApproveOrgName) : PagedReq
 public record IndustryCaseItemInDto(string? CaseName, string? IndustryName) : PagedRequest;
 
 
+public class SystemWebPageInDto
+{
+    /// <summary>
+    /// 页面类型
+    /// </summary>
+    [Required]
+    public EPageType PageType { get; set; }
+
+    /// <summary>
+    /// 页面名称
+    /// </summary>
+    [Required]
+    public string Name { get; set; }
+}
 public class IndustryBaseOutDto
 {
     /// <summary>

+ 23 - 0
src/Hotline.Share/Enums/Settings/EPageType.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Hotline.Share.Enums.Settings;
+
+public enum EPageType
+{
+    /// <summary>
+    /// 正常
+    /// </summary>
+    [Description("正常")]
+    Normal = 1,
+
+    /// <summary>
+    /// 关怀
+    /// </summary>
+    [Description("关怀")]
+    Care = 2
+}

+ 32 - 0
src/Hotline/Settings/SystemWebPageSetting.cs

@@ -0,0 +1,32 @@
+using Hotline.Share.Enums.Settings;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using XF.Domain.Repository;
+
+namespace Hotline.Settings;
+
+public class SystemWebPageSetting : CreationEntity
+{
+    /// <summary>
+    /// 页面名字
+    /// </summary>
+    public string Name { get; set; }
+
+    /// <summary>
+    /// 页面类型
+    /// </summary>
+    public EPageType PageType { get; set; }
+
+    /// <summary>
+    /// 页面元素名称
+    /// </summary>
+    public string TagName { get; set; }
+
+    /// <summary>
+    /// 页面元素值
+    /// </summary>
+    public string TagValue { get; set; }
+}