liaoxujun@qq.com
2024-02-28 9f8e542b9b74fe18a6a4e0a00fef4b50e3e62581
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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
 
 
 
        //验证接口====================================================================================================
 
 
 
    }
}