Fix up requests to endpoints
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using SPTarkov.Server.Core.Controllers;
|
||||
using SPTarkov.Server.Core.Models.Common;
|
||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||
using SPTarkov.Server.Core.Models.Eft.Profile;
|
||||
using SPTarkov.Server.Core.Utils;
|
||||
|
||||
namespace SPTarkov.Server.Core.Callbacks;
|
||||
@@ -13,7 +14,7 @@ public class AchievementCallbacks(AchievementController achievementController, H
|
||||
/// Handle client/achievement/list
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public ValueTask<string> GetAchievements(string url, EmptyRequestData _, MongoId sessionID)
|
||||
public ValueTask<string> GetAchievements(string url, GetAchievementListRequest _, MongoId sessionID)
|
||||
{
|
||||
return new ValueTask<string>(httpResponseUtil.GetBody(achievementController.GetAchievements(sessionID)));
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ using SPTarkov.DI.Annotations;
|
||||
using SPTarkov.Server.Core.Controllers;
|
||||
using SPTarkov.Server.Core.Models.Common;
|
||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||
using SPTarkov.Server.Core.Models.Eft.Dialog;
|
||||
using SPTarkov.Server.Core.Services;
|
||||
using SPTarkov.Server.Core.Utils;
|
||||
|
||||
@@ -163,7 +164,7 @@ public class DataCallbacks(
|
||||
/// <summary>
|
||||
/// Handle /client/dialogue
|
||||
/// </summary>
|
||||
public ValueTask<string> GetDialogue(string url, object request, MongoId sessionID)
|
||||
public ValueTask<string> GetDialogue(string url, GetClientDialogueRequestData request, MongoId sessionID)
|
||||
{
|
||||
return new ValueTask<string>(httpResponseUtil.GetUnclearedBody(databaseService.GetTemplates().Dialogue));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using SPTarkov.Server.Core.Models.Utils;
|
||||
|
||||
namespace SPTarkov.Server.Core.Models.Eft.Dialog;
|
||||
|
||||
public record GetClientDialogueRequestData : IRequestData
|
||||
{
|
||||
[JsonPropertyName("traderId")]
|
||||
public string? TraderId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using SPTarkov.Server.Core.Models.Utils;
|
||||
|
||||
namespace SPTarkov.Server.Core.Models.Eft.Profile;
|
||||
|
||||
public record GetAchievementListRequest : IRequestData
|
||||
{
|
||||
[JsonPropertyName("completed")]
|
||||
public bool? Completed { get; set; }
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using SPTarkov.Server.Core.Callbacks;
|
||||
using SPTarkov.Server.Core.DI;
|
||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||
using SPTarkov.Server.Core.Models.Eft.Profile;
|
||||
using SPTarkov.Server.Core.Utils;
|
||||
|
||||
namespace SPTarkov.Server.Core.Routers.Static;
|
||||
@@ -11,7 +12,7 @@ public class AchievementStaticRouter(JsonUtil jsonUtil, AchievementCallbacks ach
|
||||
: StaticRouter(
|
||||
jsonUtil,
|
||||
[
|
||||
new RouteAction<EmptyRequestData>(
|
||||
new RouteAction<GetAchievementListRequest>(
|
||||
"/client/achievement/list",
|
||||
async (url, info, sessionID, output) => await achievementCallbacks.GetAchievements(url, info, sessionID)
|
||||
),
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using SPTarkov.Server.Core.Callbacks;
|
||||
using SPTarkov.Server.Core.DI;
|
||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||
using SPTarkov.Server.Core.Models.Eft.Dialog;
|
||||
using SPTarkov.Server.Core.Utils;
|
||||
|
||||
namespace SPTarkov.Server.Core.Routers.Static;
|
||||
@@ -55,7 +56,7 @@ public class DataStaticRouter(JsonUtil jsonUtil, DataCallbacks dataCallbacks)
|
||||
"/client/hideout/qte/list",
|
||||
async (url, info, sessionID, output) => await dataCallbacks.GetQteList(url, info, sessionID)
|
||||
),
|
||||
new RouteAction<EmptyRequestData>(
|
||||
new RouteAction<GetClientDialogueRequestData>(
|
||||
"/client/dialogue",
|
||||
async (url, info, sessionID, output) => await dataCallbacks.GetDialogue(url, info, sessionID)
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user