mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-27 15:38:39 +00:00
Implement privacySettings, /t_conf, /showModerated, and /match
This commit is contained in:
parent
f045bdf015
commit
ec35e6f9bb
4 changed files with 35 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using ProjectLighthouse.Serialization;
|
using ProjectLighthouse.Serialization;
|
||||||
|
using ProjectLighthouse.Types;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Controllers {
|
namespace ProjectLighthouse.Controllers {
|
||||||
[ApiController]
|
[ApiController]
|
||||||
|
@ -12,8 +13,9 @@ namespace ProjectLighthouse.Controllers {
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("t_conf")]
|
[HttpGet("t_conf")]
|
||||||
|
[Produces("text/json")]
|
||||||
public IActionResult TConf() {
|
public IActionResult TConf() {
|
||||||
return this.Ok();
|
return this.Ok("[{\"StatusCode\":200}]");
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("farc_hashes")]
|
[HttpGet("farc_hashes")]
|
||||||
|
@ -22,8 +24,14 @@ namespace ProjectLighthouse.Controllers {
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("privacySettings")]
|
[HttpGet("privacySettings")]
|
||||||
|
[Produces("text/xml")]
|
||||||
public IActionResult PrivacySettings() {
|
public IActionResult PrivacySettings() {
|
||||||
return this.Ok();
|
PrivacySettings ps = new() {
|
||||||
|
LevelVisibility = "unset",
|
||||||
|
ProfileVisibility = "unset"
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.Ok(ps.Serialize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -25,9 +25,16 @@ namespace ProjectLighthouse.Controllers {
|
||||||
return this.Ok(slot.Serialize());
|
return this.Ok(slot.Serialize());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet("slots/lolcatftw/{username}")]
|
||||||
|
public IActionResult SlotsLolCat(string username) {
|
||||||
|
string response = Enumerable.Aggregate(new Database().Slots, string.Empty, (current, slot) => current + slot.Serialize());
|
||||||
|
|
||||||
|
return this.Ok(LbpSerializer.TaggedStringElement("slots", response, "total", 1));
|
||||||
|
}
|
||||||
|
|
||||||
[HttpPost("showModerated")]
|
[HttpPost("showModerated")]
|
||||||
public IActionResult ShowModerated() {
|
public IActionResult ShowModerated() {
|
||||||
return this.Ok();
|
return this.Ok("<resources/>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -109,8 +109,9 @@ namespace ProjectLighthouse.Controllers {
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("match")]
|
[HttpPost("match")]
|
||||||
|
[Produces("text/json")]
|
||||||
public IActionResult Match() {
|
public IActionResult Match() {
|
||||||
return this.Ok();
|
return this.Ok("[{\"StatusCode\":200}]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
15
ProjectLighthouse/Types/PrivacySettings.cs
Normal file
15
ProjectLighthouse/Types/PrivacySettings.cs
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
using ProjectLighthouse.Serialization;
|
||||||
|
|
||||||
|
namespace ProjectLighthouse.Types {
|
||||||
|
public class PrivacySettings {
|
||||||
|
public string LevelVisibility { get; set; }
|
||||||
|
public string ProfileVisibility { get; set; }
|
||||||
|
|
||||||
|
public string Serialize() {
|
||||||
|
return LbpSerializer.StringElement("privacySettings",
|
||||||
|
LbpSerializer.StringElement("levelVisibility", LevelVisibility) +
|
||||||
|
LbpSerializer.StringElement("profileVisibility", ProfileVisibility)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue