diff --git a/ProjectLighthouse.sln.DotSettings b/ProjectLighthouse.sln.DotSettings index 9cc7db0b..9035b5a5 100644 --- a/ProjectLighthouse.sln.DotSettings +++ b/ProjectLighthouse.sln.DotSettings @@ -93,6 +93,7 @@ True True True + True True True True diff --git a/ProjectLighthouse/Controllers/SlotsController.cs b/ProjectLighthouse/Controllers/SlotsController.cs index fd203a65..b74800c5 100644 --- a/ProjectLighthouse/Controllers/SlotsController.cs +++ b/ProjectLighthouse/Controllers/SlotsController.cs @@ -70,5 +70,20 @@ namespace LBPUnion.ProjectLighthouse.Controllers return this.Ok(LbpSerializer.TaggedStringElement("slots", response, "hint_start", pageStart + Math.Min(pageSize, 30))); } + + [HttpGet("slots/lbp2luckydip")] + public IActionResult LuckyDipSlots([FromQuery] int pageStart, [FromQuery] int pageSize, [FromQuery] int seed) + { + // TODO: Incorporate seed? + IQueryable slots = this.database.Slots.OrderBy + (_ => Guid.NewGuid()) + .Include(s => s.Creator) + .Include(s => s.Location) + .Skip(pageStart - 1) + .Take(Math.Min(pageSize, 30)); + string response = Enumerable.Aggregate(slots, string.Empty, (current, slot) => current + slot.Serialize()); + + return this.Ok(LbpSerializer.TaggedStringElement("slots", response, "hint_start", pageStart + Math.Min(pageSize, 30))); + } } } \ No newline at end of file