mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-28 07:58:40 +00:00
Add database support for hearted levels
This commit is contained in:
parent
b55e06b74c
commit
15551ed8f8
4 changed files with 40 additions and 1 deletions
16
DatabaseMigrations/8.sql
Normal file
16
DatabaseMigrations/8.sql
Normal file
|
@ -0,0 +1,16 @@
|
|||
create table HeartedLevels
|
||||
(
|
||||
HeartedLevelId int,
|
||||
UserId int not null,
|
||||
SlotId int not null
|
||||
);
|
||||
|
||||
create unique index HeartedLevels_HeartedLevelId_uindex
|
||||
on HeartedLevels (HeartedLevelId);
|
||||
|
||||
alter table HeartedLevels
|
||||
add constraint HeartedLevels_pk
|
||||
primary key (HeartedLevelId);
|
||||
|
||||
alter table HeartedLevels
|
||||
modify HeartedLevelId int auto_increment;
|
|
@ -11,7 +11,8 @@ namespace ProjectLighthouse.Controllers {
|
|||
[ApiController]
|
||||
[Route("LITTLEBIGPLANETPS3_XML/")]
|
||||
[Produces("text/xml")]
|
||||
public class LevelQueueController : ControllerBase {
|
||||
public class LevelListController : ControllerBase {
|
||||
#region Level Queue (lolcatftw)
|
||||
[HttpGet("slots/lolcatftw/{username}")]
|
||||
public IActionResult GetLevelQueue(string username) {
|
||||
IEnumerable<QueuedLevel> queuedLevels = new Database().QueuedLevels
|
||||
|
@ -59,5 +60,10 @@ namespace ProjectLighthouse.Controllers {
|
|||
|
||||
return this.Ok();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Hearted Levels
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -10,6 +10,7 @@ namespace ProjectLighthouse {
|
|||
public DbSet<Location> Locations { get; set; }
|
||||
public DbSet<Slot> Slots { get; set; }
|
||||
public DbSet<QueuedLevel> QueuedLevels { get; set; }
|
||||
public DbSet<HeartedLevel> HeartedLevels { get; set; }
|
||||
public DbSet<Comment> Comments { get; set; }
|
||||
public DbSet<Token> Tokens { get; set; }
|
||||
|
||||
|
|
16
ProjectLighthouse/Types/HeartedLevel.cs
Normal file
16
ProjectLighthouse/Types/HeartedLevel.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace ProjectLighthouse.Types {
|
||||
public class HeartedLevel {
|
||||
[Key] public int HeartedLevelId { get; set; }
|
||||
|
||||
public int UserId { get; set; }
|
||||
|
||||
[ForeignKey(nameof(UserId))] public User User { get; set; }
|
||||
|
||||
public int SlotId { get; set; }
|
||||
|
||||
[ForeignKey(nameof(SlotId))] public Slot Slot { get; set; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue