From dfb75d795b6a7f82e23a942bc0cbcb7683527b5f Mon Sep 17 00:00:00 2001 From: zpc Date: Wed, 23 Jul 2025 04:09:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96=E5=B9=BF?= =?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/AdvertController.cs | 14 ++++++++++---- src/CoreCms.Net.Web.WebApi/Doc.xml | 2 +- src/CoreCms.Net.Web.WebApi/Program.cs | 10 +++++++++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/CoreCms.Net.Web.WebApi/Controllers/AdvertController.cs b/src/CoreCms.Net.Web.WebApi/Controllers/AdvertController.cs index 1c1f57f..fda3413 100644 --- a/src/CoreCms.Net.Web.WebApi/Controllers/AdvertController.cs +++ b/src/CoreCms.Net.Web.WebApi/Controllers/AdvertController.cs @@ -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 /// /// /// - [HttpPost] - public async Task GetAdvertList([FromBody] FMPageByIntId entity) + [HttpGet] + public async Task 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; diff --git a/src/CoreCms.Net.Web.WebApi/Doc.xml b/src/CoreCms.Net.Web.WebApi/Doc.xml index 9efe682..4db94f9 100644 --- a/src/CoreCms.Net.Web.WebApi/Doc.xml +++ b/src/CoreCms.Net.Web.WebApi/Doc.xml @@ -18,7 +18,7 @@ - + 获取广告列表 diff --git a/src/CoreCms.Net.Web.WebApi/Program.cs b/src/CoreCms.Net.Web.WebApi/Program.cs index 60c0691..18a4077 100644 --- a/src/CoreCms.Net.Web.WebApi/Program.cs +++ b/src/CoreCms.Net.Web.WebApi/Program.cs @@ -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();