using System.Linq;
using CoreCms.Net.Auth.HttpContextUser;
using CoreCms.Net.Caching.AutoMate.RedisCache;
using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using CoreCms.Net.Configuration;
namespace CoreCms.Net.Web.WebApi.Controllers
{
///
/// 促销活动接口
///
[Route("api/[controller]/[action]")]
[ApiController]
public class PromotionController : ControllerBase
{
private readonly ICoreCmsPromotionServices _promotionServices;
private readonly IRedisOperationRepository _redisOperationRepository;
private readonly IHttpContextUser _user;
private readonly IUnitOfWork _unionOfWork;
///
/// 构造函数
///
public PromotionController(ICoreCmsPromotionServices promotionServices, IRedisOperationRepository redisOperationRepository, IHttpContextUser user, IUnitOfWork unionOfWork)
{
_promotionServices = promotionServices;
_redisOperationRepository = redisOperationRepository;
_user = user;
_unionOfWork = unionOfWork;
}
//公共接口====================================================================================================
#region 获取全局促销列表==================================================
///
/// 获取全局促销列表
///
///
[HttpPost]
//[Authorize]
public async Task GetPromotionList([FromBody] FMIntId entity)
{
var jm = new WebApiCallBack() { msg = "获取失败" };
var list = await _promotionServices.GetPromotionList(entity.id);
jm.status = true;
jm.data = list;
jm.msg = "获取成功";
return jm;
}
#endregion
//验证接口====================================================================================================
}
}