30 lines
830 B
C#
30 lines
830 B
C#
using Common;
|
|||
|
|
using CommonInfrastructure;
|
||
|
|
using Microsoft.AspNetCore.Authorization;
|
||
|
|
using Microsoft.AspNetCore.Mvc;
|
||
|
|
using UserService.SummonCard;
|
||
|
|
|
||
|
|
namespace UserApi.SummonCard
|
||
|
|
{
|
||
|
|
[ApiController, Route("api/[controller]")]
|
||
|
|
[Authorize]
|
||
|
|
public class SummonCardController : BaseController
|
||
|
|
{
|
||
|
|
private readonly ISummonCardService _summonCardService;
|
||
|
|
|
||
|
|
public SummonCardController(ISummonCardService summonCardService)
|
||
|
|
{
|
||
|
|
_summonCardService = summonCardService;
|
||
|
|
}
|
||
|
|
|
||
|
|
[HttpGet("use")]
|
||
|
|
public async Task<BaseResponse<string>> Use()
|
||
|
|
{
|
||
|
|
var res = await _summonCardService.Use(loginUser.UserId);
|
||
|
|
if (res.success)
|
||
|
|
return this.ToResult(res.message);
|
||
|
|
return this.ToFailResult<string>(res.message);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|