Browse Source

新增微信小程序首页数据接口

qinchaoyue 5 months ago
parent
commit
3f107115b7
1 changed files with 10 additions and 0 deletions
  1. 10 0
      src/Hotline.Api/Controllers/Snapshot/SnapshotController.cs

+ 10 - 0
src/Hotline.Api/Controllers/Snapshot/SnapshotController.cs

@@ -6,6 +6,7 @@ using Hotline.Share.Dtos.Article;
 using Hotline.Share.Dtos.Snapshot;
 using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Mvc;
+using System.Reflection;
 using XF.Domain.Repository;
 
 namespace Hotline.Api.Controllers.Snapshot;
@@ -26,6 +27,15 @@ public class SnapshotController : BaseController
         _systemAreaDomainService = systemAreaDomainService;
     }
 
+    /// <summary>
+    /// 首页数据
+    /// </summary>
+    /// <returns></returns>
+    [HttpGet("home")]
+    [AllowAnonymous]
+    public async Task<IReadOnlyList<HomePageOutDto>> GetHomePageAsync()
+        => await _snapshotApplication.GetHomePageAsync();
+
     /// <summary>
     /// 获取小程序公告列表
     /// </summary>