mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 17:23:26 +08:00
完成充值功能整体开发。
This commit is contained in:
77
CoreCms.Net.Web.WebApi/Controllers/TopUpController.cs
Normal file
77
CoreCms.Net.Web.WebApi/Controllers/TopUpController.cs
Normal file
@@ -0,0 +1,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
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user