This commit is contained in:
Toru the Red Fox 2022-07-26 14:31:29 +01:00
commit 80a60a4b0e
2 changed files with 13 additions and 2 deletions

View file

@ -27,8 +27,9 @@ public class NewsController : ControllerBase
Title = "Test Title", Title = "Test Title",
Text = "Test Text", Text = "Test Text",
Date = 1348755214000, Date = 1348755214000,
Picks = "<picks></picks>",
}.Serialize() }.Serialize()
); ); ;
return this.Ok(LbpSerializer.StringElement("news", newsEntry)); return this.Ok(LbpSerializer.StringElement("news", newsEntry));
} }

View file

@ -14,9 +14,19 @@ public static class News {
public string Text { get; set; } public string Text { get; set; }
public NewsImage Image { get; set; } public NewsImage Image { get; set; }
public long Date { get; set; } public long Date { get; set; }
public string Type { get; set; }
public string Name { get; set; }
public string Author { get; set; }
public string Icon { get; set; }
public string Level { get; set; }
public string Picks { get; set; }
public string Serialize() public string Serialize()
=> LbpSerializer.StringElement("id", this.Id) + => LbpSerializer.StringElement("type", this.Type) +
LbpSerializer.StringElement("id", this.Id) +
LbpSerializer.StringElement("picks", this.Picks) +
LbpSerializer.StringElement("type", this.Type) +
LbpSerializer.StringElement("date", this.Date) +
LbpSerializer.StringElement("title", this.Title) + LbpSerializer.StringElement("title", this.Title) +
LbpSerializer.StringElement("summary", this.Summary) + LbpSerializer.StringElement("summary", this.Summary) +
LbpSerializer.StringElement("text", this.Text) + LbpSerializer.StringElement("text", this.Text) +