admin 1 year ago
parent
commit
219af14567

+ 2 - 1
src/Hotline.Api/Controllers/SettingController.cs

@@ -72,12 +72,13 @@ namespace Hotline.Api.Controllers
             //return await _systemSettingsRepository.QueryAsync(x => true);
 
             var (total,items) = await _systemSettingsRepository.Queryable()
+                .Includes(d=>d.Creator)
                 .WhereIF(!string.IsNullOrEmpty(dto.settingName), d => d.SettingName.Contains(dto.settingName))
                 .WhereIF(!string.IsNullOrEmpty(dto.code),d=>d.Code.Contains(dto.code))
                 .OrderBy(d => d.Sort)
                 .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
 
-            return new PagedDto<SystemSetting>(total, _mapper.Map<IReadOnlyList<SystemSetting>>(items));
+            return new PagedDto<SystemSetting>(total, items);
         }
 
         /// <summary>

+ 1 - 1
src/Hotline.Api/config/appsettings.Development.json

@@ -48,7 +48,7 @@
     }
   },
   "DatabaseConfiguration": {
-    "ApplyDbMigrations": true,
+    "ApplyDbMigrations": false,
     "ApplySeed": false
   },
   "MqConfiguration": {

+ 2 - 0
src/Hotline.Share/Requests/SettingsRequest.cs

@@ -19,6 +19,8 @@ namespace Hotline.Share.Requests
         public List<string> SettingValue { get; set; }
 
         public int Sort { get; set; }
+
+        public string Remark { get; set; }
     }
 
     public record class ModifySettingDto:AddSettingDto

+ 13 - 0
src/Hotline/Settings/SystemSetting.cs

@@ -1,4 +1,5 @@
 using System.ComponentModel;
+using Hotline.Users;
 using SqlSugar;
 using XF.Domain.Entities;
 using XF.Domain.Repository;
@@ -29,5 +30,17 @@ namespace Hotline.Settings
         /// </summary>
         public int Sort { get; set; }
 
+        /// <summary>
+        /// 说明
+        /// </summary>
+        [SugarColumn(IsNullable = true)]
+        public string Remark { get; set; }
+
+        /// <summary>
+        /// 创建人
+        /// </summary>
+        [Navigate(NavigateType.OneToOne,nameof(CreatorId))]
+        public User? Creator { get; set; }
+
     }
 }