mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-15 06:02:28 +00:00
parent
d810a3a9f1
commit
e18e606787
2 changed files with 18 additions and 4 deletions
|
@ -47,6 +47,8 @@ public class CollectionController : ControllerBase
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
categoriesSerialized += LbpSerializer.StringElement("text_search", LbpSerializer.StringElement("url", "/slots/searchLBP3"));
|
||||||
|
|
||||||
return this.Ok
|
return this.Ok
|
||||||
(
|
(
|
||||||
LbpSerializer.TaggedStringElement
|
LbpSerializer.TaggedStringElement
|
||||||
|
|
|
@ -9,7 +9,7 @@ using Microsoft.EntityFrameworkCore;
|
||||||
namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Controllers.Slots;
|
namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Controllers.Slots;
|
||||||
|
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("LITTLEBIGPLANETPS3_XML/")]
|
[Route("LITTLEBIGPLANETPS3_XML/slots")]
|
||||||
[Produces("text/xml")]
|
[Produces("text/xml")]
|
||||||
public class SearchController : ControllerBase
|
public class SearchController : ControllerBase
|
||||||
{
|
{
|
||||||
|
@ -19,8 +19,17 @@ public class SearchController : ControllerBase
|
||||||
this.database = database;
|
this.database = database;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("slots/search")]
|
[HttpGet("searchLBP3")]
|
||||||
public async Task<IActionResult> SearchSlots([FromQuery] string query, [FromQuery] int pageSize, [FromQuery] int pageStart)
|
public Task<IActionResult> SearchSlotsLBP3([FromQuery] int pageSize, [FromQuery] int pageStart, [FromQuery] string textFilter)
|
||||||
|
=> SearchSlots(textFilter, pageSize, pageStart, "results");
|
||||||
|
|
||||||
|
[HttpGet("search")]
|
||||||
|
public async Task<IActionResult> SearchSlots(
|
||||||
|
[FromQuery] string query,
|
||||||
|
[FromQuery] int pageSize,
|
||||||
|
[FromQuery] int pageStart,
|
||||||
|
string keyName = "slots"
|
||||||
|
)
|
||||||
{
|
{
|
||||||
GameToken? gameToken = await this.database.GameTokenFromRequest(this.Request);
|
GameToken? gameToken = await this.database.GameTokenFromRequest(this.Request);
|
||||||
if (gameToken == null) return this.StatusCode(403, "");
|
if (gameToken == null) return this.StatusCode(403, "");
|
||||||
|
@ -51,6 +60,9 @@ public class SearchController : ControllerBase
|
||||||
|
|
||||||
string response = slots.Aggregate("", (current, slot) => current + slot.Serialize(gameToken.GameVersion));
|
string response = slots.Aggregate("", (current, slot) => current + slot.Serialize(gameToken.GameVersion));
|
||||||
|
|
||||||
return this.Ok(LbpSerializer.TaggedStringElement("slots", response, "total", dbQuery.Count()));
|
return this.Ok(LbpSerializer.TaggedStringElement(keyName, response, "total", dbQuery.Count()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// /LITTLEBIGPLANETPS3_XML?pageStart=1&pageSize=10&resultTypes[]=slot&resultTypes[]=playlist&resultTypes[]=user&adventure=dontCare&textFilter=qwer
|
||||||
|
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue