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();