Quellcode durchsuchen

公告返回字段

qinchaoyue vor 4 Monaten
Ursprung
Commit
dc12d2c54a

+ 19 - 2
src/Hotline.Api/Controllers/Snapshot/RedPackController.cs

@@ -4,16 +4,22 @@ using Hotline.Share.Dtos.Snapshot;
 using Microsoft.AspNetCore.Mvc;
 using Hotline.Repository.SqlSugar.Extensions;
 using Hotline.Share.Tools;
+using Hotline.Snapshot.Interfaces;
+using Hotline.Caching.Interfaces;
 
 namespace Hotline.Api.Controllers.Snapshot;
 
 public class RedPackController : BaseController
 {
     private readonly IRedPackApplication _redPackApplication;
+    private readonly IIndustryRepository _industryRepository;
+    private readonly ISystemDicDataCacheManager _sysDic;
 
-    public RedPackController(IRedPackApplication redPackApplication)
+    public RedPackController(IRedPackApplication redPackApplication, IIndustryRepository industryRepository, ISystemDicDataCacheManager sysDic)
     {
         _redPackApplication = redPackApplication;
+        _industryRepository = industryRepository;
+        _sysDic = sysDic;
     }
 
     /// <summary>
@@ -24,5 +30,16 @@ public class RedPackController : BaseController
     public async Task<PagedDto<SnapshotOrderAuditItemsOutDto>> GetRedPackAuditItemsAsync([FromQuery] SnapshotOrderAuditItemsInDto dto)
         => (await _redPackApplication.GetRedPackAuditItemsAsync(dto).ToPagedListAsync(dto)).ToPaged();
 
-
+    [HttpGet("audit/basedata")]
+    public async Task<Dictionary<string, object>> GetAuditBaseDataAsync()
+    {
+        var industry = await _industryRepository.Queryable()
+            .Select(m => new { m.Id, m.Name })
+            .ToListAsync();
+        return new Dictionary<string, object>
+        {
+            { "industry", industry },
+            { "configAmount", _sysDic.IndustryConfigAmount }
+        };
+    }
 }

+ 5 - 0
src/Hotline.Share/Dtos/Snapshot/SnapshotBulletinDto.cs

@@ -44,6 +44,11 @@ public class SnapshotBulletinItemsOutDto
     /// </summary>
     public string Title { get; set; }
 
+    /// <summary>
+    /// No
+    /// </summary>
+    public string? No { get; set; }
+
     /// <summary>
     /// 字典中添加类型Id
     /// </summary>

+ 5 - 0
src/Hotline/Caching/Interfaces/ISysDicDataCacheManager.cs

@@ -60,5 +60,10 @@ namespace Hotline.Caching.Interfaces
         /// 随手拍公告来源
         /// </summary>
         IReadOnlyCollection<SystemDicDataOutDto> SnapshotBulletinSource { get; }
+
+        /// <summary>
+        /// 随手拍行业配置金额
+        /// </summary>
+        IReadOnlyCollection<SystemDicDataOutDto> IndustryConfigAmount { get; }
     }
 }

+ 4 - 0
src/Hotline/Caching/Services/SysDicDataCacheManager.cs

@@ -122,6 +122,10 @@ namespace Hotline.Caching.Services
         /// </summary>
         public IReadOnlyCollection<SystemDicDataOutDto> SnapshotBulletinSource => GetOrAdd(SysDicTypeConsts.SnapshotBulletinSource);
 
+        /// <summary>
+        /// 随手拍行业配置金额
+        /// </summary>
+        public IReadOnlyCollection<SystemDicDataOutDto> IndustryConfigAmount => throw new NotImplementedException();
 
         public void RemoveSysDicDataCache(string code)
         {

+ 2 - 2
src/Hotline/Snapshot/SnapshotBulletin.cs

@@ -154,13 +154,13 @@ public class SnapshotBulletin : CreationEntity
     /// 视频地址
     /// </summary>
     [SugarColumn(ColumnDescription = "视频地址")]
-    public string VideoPath { get; set; }
+    public string? VideoPath { get; set; }
 
     /// <summary>
     /// 来源方式
     /// </summary>
     [SugarColumn(ColumnDescription = "来源方式")]
-    public string SourceMode { get; set; }
+    public string? SourceMode { get; set; }
 
     /// <summary>
     /// 阅读量+1