Refactor controllers
This commit is contained in:
parent
be1f02e1d9
commit
15b4cee75e
|
@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Mvc;
|
|||
using zotanpw.Backend.database;
|
||||
using zotanpw.Backend.database.Tables;
|
||||
|
||||
namespace zotanpw.Controllers.PlaybackHistory;
|
||||
namespace zotanpw.Controllers;
|
||||
|
||||
[ApiController, Route("/np/log")]
|
||||
public class LogPlayback : Controller {
|
|
@ -1,7 +1,7 @@
|
|||
// Auto-generated JSON mapping
|
||||
// ReSharper disable All
|
||||
|
||||
namespace zotanpw.Controllers.PlaybackHistory;
|
||||
namespace zotanpw.Controllers;
|
||||
|
||||
public class LogPlaybackRequest {
|
||||
public string? Artist { get; set; }
|
|
@ -1,6 +1,6 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace zotanpw.Controllers.well_known;
|
||||
namespace zotanpw.Controllers;
|
||||
|
||||
[ApiController, Route("/.well-known/pronouns")]
|
||||
public class Pronouns : Controller {
|
|
@ -3,14 +3,14 @@ using Microsoft.AspNetCore.Mvc;
|
|||
using zotanpw.Backend.database;
|
||||
using zotanpw.Backend.database.Tables;
|
||||
|
||||
namespace zotanpw.Controllers.Travelynx;
|
||||
namespace zotanpw.Controllers;
|
||||
|
||||
[ApiController, Route("/travelynx")]
|
||||
public class Travelynx : Controller {
|
||||
private static readonly string TravelynxSecret = System.IO.File.ReadAllLines(".bearer_token")[0];
|
||||
|
||||
[HttpPost]
|
||||
public TravelynxInfo Update([FromBody] TravelynxWebhookRequest rq) {
|
||||
public TravelynxInfo Update([FromBody] TravelynxRequest rq) {
|
||||
var token = Request.Headers.Authorization;
|
||||
if (token == TravelynxSecret) {
|
||||
var db = new Database.DbConn();
|
|
@ -1,9 +1,9 @@
|
|||
// Auto-generated JSON mapping
|
||||
// ReSharper disable All
|
||||
|
||||
namespace zotanpw.Controllers.Travelynx;
|
||||
namespace zotanpw.Controllers;
|
||||
|
||||
public class TravelynxWebhookRequest {
|
||||
public class TravelynxRequest {
|
||||
public string? Reason { get; set; }
|
||||
public Status? Status { get; set; }
|
||||
}
|
Loading…
Reference in a new issue