2026-10-12 16:22:04 +08:00
|
|
|
using Common;
|
|
|
|
|
using CommonInfrastructure;
|
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using UserService.ScratchCard;
|
|
|
|
|
|
|
|
|
|
namespace UserApi.ScratchCard
|
|
|
|
|
{
|
|
|
|
|
[ApiController, Route("api/[controller]")]
|
|
|
|
|
[Authorize]
|
|
|
|
|
public class ScratchCardController : BaseController
|
|
|
|
|
{
|
|
|
|
|
private readonly IScratchCardService _scratchCardService;
|
|
|
|
|
|
|
|
|
|
public ScratchCardController(IScratchCardService scratchCardService)
|
|
|
|
|
{
|
|
|
|
|
_scratchCardService = scratchCardService;
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-19 00:44:00 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 使用刮刮卡抽奖
|
|
|
|
|
/// </summary>
|
2026-10-12 16:22:04 +08:00
|
|
|
[HttpGet("draw")]
|
|
|
|
|
public async Task<BaseResponse<ScratchCardResult>> Draw()
|
|
|
|
|
{
|
|
|
|
|
var res = await _scratchCardService.Draw(loginUser.UserId);
|
|
|
|
|
if (res.success)
|
|
|
|
|
return this.ToResult(res.result);
|
|
|
|
|
return this.ToFailResult<ScratchCardResult>(res.message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|