username@email.com
2024-04-24 85405ca125ae7c139e7dbc2dc56a997f3f196e30
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
68
69
70
71
72
73
74
75
76
77
using CoreCms.Net.IServices;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using System.Threading.Tasks;
 
namespace CoreCms.Net.Web.WebApi.Controllers
{
    /// <summary>
    /// 充值接口
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class TopUpController : ControllerBase
    {
 
        private readonly ICoreCmsTopUpTypeServices _topUpTypeServices;
 
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="topUpTypeServices"></param>
        public TopUpController(ICoreCmsTopUpTypeServices topUpTypeServices)
        {
            _topUpTypeServices = topUpTypeServices;
        }
 
 
        #region 获取充值规则列表
        /// <summary>
        /// 获取通知列表
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<WebApiCallBack> TypeList()
        {
            var jm = new WebApiCallBack();
 
            var list = await _topUpTypeServices.QueryListByClauseAsync(p => p.isEnable == true, p => p.sortId, OrderByType.Desc, true, true);
            jm.status = true;
            jm.data = list;
 
            return jm;
        }
 
        #endregion
 
 
        #region 获取单个充值规则
        /// <summary>
        /// 获取单个充值规则
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<WebApiCallBack> GetTypeDetail([FromBody] FMIntId entity)
        {
            var jm = new WebApiCallBack();
 
            var model = await _topUpTypeServices.QueryByClauseAsync(p => p.id == entity.id, true, true);
            if (model == null)
            {
                jm.msg = "数据获取失败";
                return jm;
            }
            jm.status = true;
            jm.data = model;
            return jm;
 
        }
        #endregion
 
 
    }
}