mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-11 08:18:49 -07:00
backport Set/GetProduct from WoJSReStartedApi
Co-authored-by: Robert Paciorek <robert@opcode.eu.org>
This commit is contained in:
parent
f5c7bc0fca
commit
ff19b747d8
@ -35,6 +35,32 @@ public class ContentController : Controller {
|
|||||||
this.config = config;
|
this.config = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
//[Produces("application/xml")]
|
||||||
|
[Route("ContentWebService.asmx/GetProduct")] // used by World Of Jumpstart
|
||||||
|
public string? GetProduct([FromForm] string apiToken)
|
||||||
|
{
|
||||||
|
Viking? user = ctx.Sessions.FirstOrDefault(x => x.ApiToken == apiToken)?.Viking;
|
||||||
|
if (user is null)
|
||||||
|
return string.Empty;
|
||||||
|
|
||||||
|
return user.ProductData;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
//[Produces("application/xml")]
|
||||||
|
[Route("ContentWebService.asmx/SetProduct")] // used by World Of Jumpstart
|
||||||
|
public string? SetProduct([FromForm] string apiToken, [FromForm] string contentXml)
|
||||||
|
{
|
||||||
|
Viking? child = ctx.Sessions.FirstOrDefault(x => x.ApiToken == apiToken)?.Viking;
|
||||||
|
if (child is null)
|
||||||
|
return string.Empty;
|
||||||
|
|
||||||
|
child.ProductData = contentXml;
|
||||||
|
ctx.SaveChanges();
|
||||||
|
return child.ProductData;
|
||||||
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Produces("application/xml")]
|
[Produces("application/xml")]
|
||||||
[Route("ContentWebService.asmx/GetDefaultNameSuggestion")]
|
[Route("ContentWebService.asmx/GetDefaultNameSuggestion")]
|
||||||
|
@ -33,4 +33,6 @@ public class Viking {
|
|||||||
public virtual ICollection<GameData> GameData { get; set; } = null!;
|
public virtual ICollection<GameData> GameData { get; set; } = null!;
|
||||||
public virtual ICollection<ProfileAnswer> ProfileAnswers { get; set; } = null!;
|
public virtual ICollection<ProfileAnswer> ProfileAnswers { get; set; } = null!;
|
||||||
public virtual Dragon? SelectedDragon { get; set; }
|
public virtual Dragon? SelectedDragon { get; set; }
|
||||||
|
|
||||||
|
public string? ProductData { get; set; }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user