Start API and WebUI rework

This commit is contained in:
asesidaa
2023-02-17 00:38:01 +08:00
parent 6de389cf2b
commit 2ff32b9693
95 changed files with 813 additions and 82 deletions
@@ -0,0 +1,39 @@
using Application.Api;
using Application.Common.Models;
using Application.Dto.Api;
using Microsoft.AspNetCore.Mvc;
namespace MainServer.Controllers.API;
[ApiController]
[Route("api/[controller]")]
public class ProfilesController : BaseController<ProfilesController>
{
[HttpGet]
public async Task<ActionResult<ServiceResult<List<ClientCardDto>>>> GetAllCards()
{
var result = await Mediator.Send(new GetCardsQuery());
return result;
}
[HttpGet("{cardId:long}")]
public async Task<ActionResult<ServiceResult<TotalResultData>>> GetCardTotalResultById(long cardId)
{
var result = await Mediator.Send(new GetTotalResultQuery(cardId));
return result;
}
[HttpPost("Favorite")]
public async Task<ActionResult<ServiceResult<bool>>> SetFavoriteMusic(MusicDetailDto detail)
{
var result = await Mediator.Send(new SetFavoriteMusicCommand(detail));
return result;
}
[HttpPost("PlayerName")]
public async Task<ActionResult<ServiceResult<bool>>> SetPlayerName(ClientCardDto card)
{
var result = await Mediator.Send(new SetPlayerNameCommand(card));
return result;
}
}