瀏覽代碼

新增页面基础数据

qinchaoyue 4 月之前
父節點
當前提交
b31da716eb
共有 1 個文件被更改,包括 17 次插入1 次删除
  1. 17 1
      src/Hotline.Api/Controllers/Snapshot/IndustryController.cs

+ 17 - 1
src/Hotline.Api/Controllers/Snapshot/IndustryController.cs

@@ -33,7 +33,7 @@ public class IndustryController : BaseController
     /// <returns></returns>
     [HttpGet("basedata")]
     public Dictionary<string, object> GetBaseData()
-    { 
+    {
         return new Dictionary<string, object>
         {
             { "department", _systemDicDataCacheManager.SnapshotDepartment },
@@ -93,5 +93,21 @@ public class IndustryController : BaseController
     [HttpPost("case")]
     public async Task AddIndustryCaseAsync([FromBody] AddIndustryCaseDto dto)
         => await _industryApplication.AddIndustryCaseAsync(dto);
+
+    /// <summary>
+    /// 页面基础数据
+    /// </summary>
+    /// <returns></returns>
+    [HttpGet("case/database")]
+    public async Task<Dictionary<string, object>> GetIndustryCaseDataBaseAsync()
+    {
+        var items = await _industryRepository.Queryable()
+            .Select(m => new { m.Id, m.Name })
+            .ToListAsync();
+        return new Dictionary<string, object>
+        {
+            { "industry", items }
+        };
+    }
     #endregion
 }