From a73610c83b7d1f240f0bbac19deeed81f2a729e1 Mon Sep 17 00:00:00 2001
From: zznty <94796179+zznty@users.noreply.github.com>
Date: Tue, 24 Jan 2023 18:34:13 +0700
Subject: [PATCH] update dependencies
---
TorchRemote.Models/TorchRemote.Models.csproj | 2 +-
TorchRemote.Plugin/Controllers/ChatController.cs | 4 ++--
TorchRemote.Plugin/Controllers/ServerController.cs | 4 ++--
TorchRemote.Plugin/Controllers/SettingsController.cs | 4 ++--
TorchRemote.Plugin/TorchRemote.Plugin.csproj | 11 +++++------
.../{JsonDataAttribute.cs => JsonBodyAttribute.cs} | 2 +-
6 files changed, 13 insertions(+), 14 deletions(-)
rename TorchRemote.Plugin/Utils/{JsonDataAttribute.cs => JsonBodyAttribute.cs} (95%)
diff --git a/TorchRemote.Models/TorchRemote.Models.csproj b/TorchRemote.Models/TorchRemote.Models.csproj
index 0c03f48..a807b4f 100644
--- a/TorchRemote.Models/TorchRemote.Models.csproj
+++ b/TorchRemote.Models/TorchRemote.Models.csproj
@@ -18,6 +18,6 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
diff --git a/TorchRemote.Plugin/Controllers/ChatController.cs b/TorchRemote.Plugin/Controllers/ChatController.cs
index 2582140..fb90507 100644
--- a/TorchRemote.Plugin/Controllers/ChatController.cs
+++ b/TorchRemote.Plugin/Controllers/ChatController.cs
@@ -34,7 +34,7 @@ public class ChatController : WebApiController, IChatController
private static readonly MethodInfo SingleTargetMethod = null!;
[Route(HttpVerbs.Post, $"{RootPath}/message")]
- public void SendMessage([JsonData] ChatMessageRequest request)
+ public void SendMessage([JsonBody] ChatMessageRequest request)
{
if (MyMultiplayer.Static is null)
throw new HttpException(HttpStatusCode.ServiceUnavailable);
@@ -84,7 +84,7 @@ public class ChatController : WebApiController, IChatController
}
[Route(HttpVerbs.Post, $"{RootPath}/command")]
- public async Task InvokeCommand([JsonData] ChatCommandRequest request)
+ public async Task InvokeCommand([JsonBody] ChatCommandRequest request)
{
if (Statics.CommandManager is null)
throw new HttpException(HttpStatusCode.ServiceUnavailable);
diff --git a/TorchRemote.Plugin/Controllers/ServerController.cs b/TorchRemote.Plugin/Controllers/ServerController.cs
index d6e08cf..e912b98 100644
--- a/TorchRemote.Plugin/Controllers/ServerController.cs
+++ b/TorchRemote.Plugin/Controllers/ServerController.cs
@@ -35,7 +35,7 @@ public class ServerController : WebApiController, IServerController
}
[Route(HttpVerbs.Post, $"{RootPath}/stop")]
- public async Task Stop([JsonData] StopServerRequest request)
+ public async Task Stop([JsonBody] StopServerRequest request)
{
if (!Statics.Torch.IsRunning)
throw HttpException.BadRequest($"Server can't stop in state {Statics.Torch.State}", Statics.Torch.State);
@@ -60,7 +60,7 @@ public class ServerController : WebApiController, IServerController
}
[Route(HttpVerbs.Post, $"{RootPath}/settings")]
- public async Task SetSettings([JsonData] ServerSettings request)
+ public async Task SetSettings([JsonBody] ServerSettings request)
{
var settings = Statics.Torch.DedicatedInstance.DedicatedConfig;
diff --git a/TorchRemote.Plugin/Controllers/SettingsController.cs b/TorchRemote.Plugin/Controllers/SettingsController.cs
index 0bf8cae..8b72704 100644
--- a/TorchRemote.Plugin/Controllers/SettingsController.cs
+++ b/TorchRemote.Plugin/Controllers/SettingsController.cs
@@ -33,7 +33,7 @@ public class SettingsController : WebApiController, ISettingsController
}
[Route(HttpVerbs.Get, $"{RootPath}/{{fullName}}/values")]
- public IEnumerable GetValues(string fullName, [JsonData] IEnumerable propertyNames)
+ public IEnumerable GetValues(string fullName, [JsonBody] IEnumerable propertyNames)
{
if (!Statics.SettingManager.Settings.TryGetValue(fullName, out var setting))
throw HttpException.NotFound($"Setting with fullName {fullName} not found", fullName);
@@ -76,7 +76,7 @@ public class SettingsController : WebApiController, ISettingsController
}
[Route(HttpVerbs.Patch, $"{RootPath}/{{fullName}}/values")]
- public int Patch(string fullName, [JsonData] IEnumerable properties)
+ public int Patch(string fullName, [JsonBody] IEnumerable properties)
{
if (!Statics.SettingManager.Settings.TryGetValue(fullName, out var setting))
throw HttpException.NotFound($"Setting with fullName {fullName} not found", fullName);
diff --git a/TorchRemote.Plugin/TorchRemote.Plugin.csproj b/TorchRemote.Plugin/TorchRemote.Plugin.csproj
index 80fce4a..93e488c 100644
--- a/TorchRemote.Plugin/TorchRemote.Plugin.csproj
+++ b/TorchRemote.Plugin/TorchRemote.Plugin.csproj
@@ -19,8 +19,8 @@
-
-
+
+
@@ -29,10 +29,9 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
+
+
+
diff --git a/TorchRemote.Plugin/Utils/JsonDataAttribute.cs b/TorchRemote.Plugin/Utils/JsonBodyAttribute.cs
similarity index 95%
rename from TorchRemote.Plugin/Utils/JsonDataAttribute.cs
rename to TorchRemote.Plugin/Utils/JsonBodyAttribute.cs
index a1bce52..3c627a1 100644
--- a/TorchRemote.Plugin/Utils/JsonDataAttribute.cs
+++ b/TorchRemote.Plugin/Utils/JsonBodyAttribute.cs
@@ -16,7 +16,7 @@ namespace TorchRemote.Plugin.Utils;
///
///
[AttributeUsage(AttributeTargets.Parameter)]
-public class JsonDataAttribute : Attribute, IRequestDataAttribute
+public class JsonBodyAttribute : Attribute, IRequestDataAttribute
{
///
public async Task