60 lines
1.7 KiB
C#
60 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
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
|
|
{
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class RankDataController : MethodBasedController<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());
|
|
}
|
|
}
|
|
} |