More additions, lucky card based on day, redo of migrations because i messed up
This commit is contained in:
@@ -4,6 +4,10 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using TOOHUCardAPI.Data.Enums;
|
||||
using TOOHUCardAPI.Data.Services;
|
||||
using TOOHUCardAPI.DTO;
|
||||
|
||||
namespace TOOHUCardAPI.Controllers
|
||||
{
|
||||
@@ -11,8 +15,46 @@ namespace TOOHUCardAPI.Controllers
|
||||
[ApiController]
|
||||
public class RankDataController : MethodBasedController<RankDataController>
|
||||
{
|
||||
public RankDataController()
|
||||
private readonly ILogger<RankDataController> _logger;
|
||||
private readonly RankService _rankService;
|
||||
private readonly StoreService _storeService;
|
||||
private readonly UserService _userService;
|
||||
|
||||
public RankDataController(ILogger<RankDataController> logger, RankService rankService, StoreService storeService, UserService userService)
|
||||
{
|
||||
_logger = logger;
|
||||
_rankService = rankService;
|
||||
_storeService = storeService;
|
||||
_userService = userService;
|
||||
}
|
||||
|
||||
private RankType ParseRankType(string rankType)
|
||||
{
|
||||
if (rankType == null || rankType.Length > 1)
|
||||
{
|
||||
return RankType.All;
|
||||
}
|
||||
|
||||
char identifier = rankType.ToCharArray()[0];
|
||||
if (identifier == (char) RankType.Single)
|
||||
{
|
||||
return RankType.Single;
|
||||
}
|
||||
|
||||
if (identifier == (char) RankType.Team)
|
||||
{
|
||||
return RankType.Team;
|
||||
}
|
||||
|
||||
return RankType.All;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> GetRankData(string rank_type)
|
||||
{
|
||||
RankType parsedRankType = ParseRankType(rank_type);
|
||||
|
||||
return Ok(new OkResponse());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user