From 032941a0183ce44f74eeefada7fe854841fbad5a Mon Sep 17 00:00:00 2001 From: zpc Date: Wed, 23 Jul 2025 05:00:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96=E5=85=AC?= =?UTF-8?q?=E5=91=8A=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/NoticeController.cs | 15 +++++++++++---- src/CoreCms.Net.Web.WebApi/Doc.xml | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/CoreCms.Net.Web.WebApi/Controllers/NoticeController.cs b/src/CoreCms.Net.Web.WebApi/Controllers/NoticeController.cs index b33dbcb..07690af 100644 --- a/src/CoreCms.Net.Web.WebApi/Controllers/NoticeController.cs +++ b/src/CoreCms.Net.Web.WebApi/Controllers/NoticeController.cs @@ -13,14 +13,17 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using CoreCms.Net.Auth.HttpContextUser; using CoreCms.Net.Configuration; using CoreCms.Net.IServices; using CoreCms.Net.Model.FromBody; using CoreCms.Net.Model.ViewModels.UI; + using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; + using SqlSugar; namespace CoreCms.Net.Web.WebApi.Controllers @@ -73,14 +76,18 @@ namespace CoreCms.Net.Web.WebApi.Controllers /// /// 获取单个公告内容 /// - /// + /// /// - [HttpPost] - public async Task NoticeInfo([FromBody] FMIntId entity) + [HttpGet] + public async Task NoticeInfo([FromQuery] int id) { + if (id == 0) + { + throw new ArgumentNullException("id"); + } var jm = new WebApiCallBack(); - var model = await _noticeServices.QueryByIdAsync(entity.id); + var model = await _noticeServices.QueryByIdAsync(id); if (model == null) { jm.msg = "数据获取失败"; diff --git a/src/CoreCms.Net.Web.WebApi/Doc.xml b/src/CoreCms.Net.Web.WebApi/Doc.xml index 4db94f9..70c8a95 100644 --- a/src/CoreCms.Net.Web.WebApi/Doc.xml +++ b/src/CoreCms.Net.Web.WebApi/Doc.xml @@ -463,7 +463,7 @@ - + 获取单个公告内容