333
This commit is contained in:
parent
65f39352d6
commit
351ddb5c24
|
|
@ -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,51 +65,22 @@ 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<WebApiDto> GetAdvertList([FromQuery] string code)
|
||||
{
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
var list = await _advertisementServices.QueryPageAsync(p => p.code == entity.where, p => p.createTime, OrderByType.Desc,
|
||||
entity.page, entity.limit);
|
||||
jm.status = true;
|
||||
jm.data = list;
|
||||
|
||||
return jm;
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取广告位置信息=============================================================================
|
||||
/// <summary>
|
||||
/// 获取广告位置信息
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<WebApiCallBack> GetPositionList([FromBody] WxAdvert entity)
|
||||
{
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
var position = await _advertPositionServices.QueryListByClauseAsync(p => p.isEnable && p.code == entity.codes);
|
||||
if (!position.Any())
|
||||
if (string.IsNullOrEmpty(code))
|
||||
{
|
||||
return jm;
|
||||
return null;
|
||||
}
|
||||
var ids = position.Select(p => p.id).ToList();
|
||||
var isement = await _advertisementServices.QueryListByClauseAsync(p => ids.Contains(p.positionId));
|
||||
var jm = new WebApiDto();
|
||||
|
||||
Dictionary<string, List<CoreCmsAdvertisement>> list = new Dictionary<string, List<CoreCmsAdvertisement>>();
|
||||
list.Add(entity.codes, isement);
|
||||
|
||||
jm.status = true;
|
||||
jm.data = list;
|
||||
var list = await _advertisementServices.QueryListByClauseAsync(p => p.code == code, p => p.createTime, OrderByType.Desc);
|
||||
jm.Code = 0;
|
||||
jm.Data = list;
|
||||
|
||||
return jm;
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user