修改获取广告接口

This commit is contained in:
zpc 2025-07-23 04:09:30 +08:00
parent 7d6c37a98a
commit dfb75d795b
3 changed files with 20 additions and 6 deletions

View File

@ -12,14 +12,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.Entities;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
namespace CoreCms.Net.Web.WebApi.Controllers
@ -62,13 +65,16 @@ namespace CoreCms.Net.Web.WebApi.Controllers
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
public async Task<WebApiCallBack> GetAdvertList([FromBody] FMPageByIntId entity)
[HttpGet]
public async Task<WebApiCallBack> GetAdvertList([FromQuery] string code)
{
if (string.IsNullOrEmpty(code))
{
return null;
}
var jm = new WebApiCallBack();
var list = await _advertisementServices.QueryPageAsync(p => p.code == entity.where, p => p.createTime, OrderByType.Desc,
entity.page, entity.limit);
var list = await _advertisementServices.QueryListByClauseAsync(p => p.code == code, p => p.createTime, OrderByType.Desc);
jm.status = true;
jm.data = list;

View File

@ -18,7 +18,7 @@
<param name="advertPositionServices"></param>
<param name="advertisementServices"></param>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.AdvertController.GetAdvertList(CoreCms.Net.Model.FromBody.FMPageByIntId)">
<member name="M:CoreCms.Net.Web.WebApi.Controllers.AdvertController.GetAdvertList(System.String)">
<summary>
获取广告列表
</summary>

View File

@ -1,7 +1,9 @@
using System;
using System.Linq;
using Autofac;
using Autofac.Extensions.DependencyInjection;
using CoreCms.Net.Auth;
using CoreCms.Net.Configuration;
using CoreCms.Net.Core.AutoFac;
@ -14,11 +16,15 @@ using CoreCms.Net.Swagger;
using CoreCms.Net.Task;
using CoreCms.Net.Web.WebApi.Infrastructure;
using CoreCms.Net.WeChat.Service.Mediator;
using Essensoft.Paylink.Alipay;
using Essensoft.Paylink.WeChatPay;
using Hangfire;
using Hangfire.Dashboard.BasicAuthorization;
using MediatR;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpOverrides;
@ -29,8 +35,10 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using NLog.Web;
var builder = WebApplication.CreateBuilder(args);
@ -206,7 +214,7 @@ HangfireDispose.HangfireService();
//使用 Session
app.UseSession();
if (app.Environment.IsDevelopment())
if (app.Environment.IsDevelopment() || true)
{
// 在开发环境中,使用异常页面,这样可以暴露错误堆栈信息,所以不要放在生产环境。
app.UseDeveloperExceptionPage();