修改获取公告接口

This commit is contained in:
zpc 2025-07-23 05:00:42 +08:00
parent dfb75d795b
commit 032941a018
2 changed files with 12 additions and 5 deletions

View File

@ -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
/// <summary>
/// 获取单个公告内容
/// </summary>
/// <param name="entity"></param>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> NoticeInfo([FromBody] FMIntId entity)
[HttpGet]
public async Task<WebApiCallBack> 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 = "数据获取失败";

View File

@ -463,7 +463,7 @@
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.NoticeController.NoticeInfo(CoreCms.Net.Model.FromBody.FMIntId)">
<member name="M:CoreCms.Net.Web.WebApi.Controllers.NoticeController.NoticeInfo(System.Int32)">
<summary>
获取单个公告内容
</summary>