You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.1 KiB
C#
51 lines
1.1 KiB
C#
using System;
|
|
using Expedience.Infrastructure.Models;
|
|
using Expedience.Web.Services;
|
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
|
|
namespace Expedience.Web.Pages
|
|
{
|
|
public class RecordsModel(IApiService apiService) : PageModel
|
|
{
|
|
public List<DutyCompletionResult> Results { get; set; }
|
|
public string Mode { get; set; }
|
|
|
|
public async Task OnGet(string recordType, int territoryId, CancellationToken cancellationToken)
|
|
{
|
|
var recordTypeNum = 0;
|
|
|
|
if (recordType == "normal")
|
|
{
|
|
Mode = "Normal";
|
|
recordTypeNum = 1;
|
|
}
|
|
else if (recordType == "solo")
|
|
{
|
|
Mode = "Solo";
|
|
recordTypeNum = 2;
|
|
}
|
|
else if (recordType == "mine")
|
|
{
|
|
Mode = "MINE";
|
|
recordTypeNum = 3;
|
|
}
|
|
else if (recordType == "npc")
|
|
{
|
|
Mode = "NPC Assisted";
|
|
recordTypeNum = 4;
|
|
}
|
|
else if (recordType == "unsync")
|
|
{
|
|
Mode = "Unsynched";
|
|
recordTypeNum = 5;
|
|
}
|
|
else
|
|
throw new Exception($"Record Type {recordType} not found");
|
|
|
|
Results = await apiService.GetTopXRecords(recordTypeNum, territoryId, 10, cancellationToken);
|
|
|
|
|
|
}
|
|
}
|
|
}
|