2023-02-17 00:38:01 +08:00
|
|
|
|
using Application.Api;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2023-02-18 01:29:20 +08:00
|
|
|
|
using Shared.Models;
|
2023-02-17 00:38:01 +08:00
|
|
|
|
|
|
|
|
|
namespace MainServer.Controllers.API;
|
|
|
|
|
|
|
|
|
|
[ApiController]
|
|
|
|
|
[Route("api/[controller]")]
|
|
|
|
|
public class PlayOptionController : BaseController<PlayOptionController>
|
|
|
|
|
{
|
|
|
|
|
[HttpGet("{cardId:long}")]
|
2023-02-21 22:45:51 +08:00
|
|
|
|
public async Task<ServiceResult<PlayOptionData>> GetPlayOptionById(long cardId)
|
2023-02-17 00:38:01 +08:00
|
|
|
|
{
|
|
|
|
|
var result = await Mediator.Send(new GetPlayOptionQuery(cardId));
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost]
|
2023-02-21 22:45:51 +08:00
|
|
|
|
public async Task<ServiceResult<bool>> SetPlayOption(PlayOptionData data)
|
2023-02-17 00:38:01 +08:00
|
|
|
|
{
|
|
|
|
|
var result = await Mediator.Send(new SetPlayOptionCommand(data));
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|