修改获取广告接口

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

View File

@ -18,7 +18,7 @@
<param name="advertPositionServices"></param> <param name="advertPositionServices"></param>
<param name="advertisementServices"></param> <param name="advertisementServices"></param>
</member> </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>
获取广告列表 获取广告列表
</summary> </summary>

View File

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