mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 22:43:25 +08:00
【新增】新增全局优惠展示接口,前端商品详情增加全局优惠显示入口。
This commit is contained in:
67
CoreCms.Net.Web.WebApi/Controllers/PromotionController.cs
Normal file
67
CoreCms.Net.Web.WebApi/Controllers/PromotionController.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 促销活动接口
|
||||
/// </summary>
|
||||
[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;
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public PromotionController(ICoreCmsPromotionServices promotionServices, IRedisOperationRepository redisOperationRepository, IHttpContextUser user, IUnitOfWork unionOfWork)
|
||||
{
|
||||
_promotionServices = promotionServices;
|
||||
_redisOperationRepository = redisOperationRepository;
|
||||
_user = user;
|
||||
_unionOfWork = unionOfWork;
|
||||
}
|
||||
|
||||
|
||||
//公共接口====================================================================================================
|
||||
|
||||
#region 获取全局促销列表==================================================
|
||||
/// <summary>
|
||||
/// 获取全局促销列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
//[Authorize]
|
||||
public async Task<WebApiCallBack> 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
|
||||
|
||||
|
||||
|
||||
//验证接口====================================================================================================
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user