添加接口
This commit is contained in:
parent
3ca183a5a7
commit
bc86767caa
|
|
@ -0,0 +1,37 @@
|
|||
using CloudGaming.Api.Base;
|
||||
using CloudGaming.Code.DataAccess;
|
||||
using CloudGaming.Code.Other;
|
||||
using CloudGaming.DtoModel.RedemptionCode;
|
||||
using CloudGaming.DtoModel.SevenSign;
|
||||
|
||||
using HuanMeng.DotNetCore.Base;
|
||||
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace CloudGaming.Api.Controllers;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 兑换码
|
||||
/// </summary>
|
||||
public class RedemptionController : CloudGamingControllerBase
|
||||
{
|
||||
public RedemptionController(IServiceProvider _serviceProvider) : base(_serviceProvider)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// 使用兑换码
|
||||
/// </summary>
|
||||
/// <param name="redemptionCode"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Authorize]
|
||||
public async Task<BaseResponse<bool>> UseRedemptionCode([FromBody] RedemptionCodeRequest redemptionCode)
|
||||
{
|
||||
RedemptionBLL redemptionBLL = new RedemptionBLL(ServiceProvider);
|
||||
return await redemptionBLL.UseRedemptionCodeAsync(redemptionCode.Code);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -23,7 +23,13 @@ namespace CloudGaming.Code.Other
|
|||
{
|
||||
}
|
||||
|
||||
public async Task<BaseResponse<bool>> UseRedemptionCode(string code)
|
||||
/// <summary>
|
||||
/// 使用兑换码
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
public async Task<BaseResponse<bool>> UseRedemptionCodeAsync(string code)
|
||||
{
|
||||
if (string.IsNullOrEmpty(code))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CloudGaming.DtoModel.RedemptionCode
|
||||
{
|
||||
public class RedemptionCodeRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 兑换码
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user