mirror of
https://github.com/C9Glax/tranga.git
synced 2025-04-18 14:23:18 +02:00
Return JobIds and NotificationConnector-IDs on creation
This commit is contained in:
parent
832ddf1442
commit
207604a437
@ -87,7 +87,7 @@ public class JobController(PgsqlContext context) : Controller
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="MangaId">ID of Manga</param>
|
/// <param name="MangaId">ID of Manga</param>
|
||||||
/// <param name="recurrenceTime">How often should we check for new chapters</param>
|
/// <param name="recurrenceTime">How often should we check for new chapters</param>
|
||||||
/// <response code="201">Created new Job</response>
|
/// <response code="201">Job-IDs</response>
|
||||||
/// <response code="404">Could not find Manga with ID</response>
|
/// <response code="404">Could not find Manga with ID</response>
|
||||||
/// <response code="500">Error during Database Operation</response>
|
/// <response code="500">Error during Database Operation</response>
|
||||||
[HttpPut("DownloadAvailableChaptersJob/{MangaId}")]
|
[HttpPut("DownloadAvailableChaptersJob/{MangaId}")]
|
||||||
@ -107,7 +107,7 @@ public class JobController(PgsqlContext context) : Controller
|
|||||||
/// Create a new DownloadSingleChapterJob
|
/// Create a new DownloadSingleChapterJob
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ChapterId">ID of the Chapter</param>
|
/// <param name="ChapterId">ID of the Chapter</param>
|
||||||
/// <response code="201">Created new Job</response>
|
/// <response code="201">Job-IDs</response>
|
||||||
/// <response code="404">Could not find Chapter with ID</response>
|
/// <response code="404">Could not find Chapter with ID</response>
|
||||||
/// <response code="500">Error during Database Operation</response>
|
/// <response code="500">Error during Database Operation</response>
|
||||||
[HttpPut("DownloadSingleChapterJob/{ChapterId}")]
|
[HttpPut("DownloadSingleChapterJob/{ChapterId}")]
|
||||||
@ -126,7 +126,7 @@ public class JobController(PgsqlContext context) : Controller
|
|||||||
/// Create a new UpdateFilesDownloadedJob
|
/// Create a new UpdateFilesDownloadedJob
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="MangaId">ID of the Manga</param>
|
/// <param name="MangaId">ID of the Manga</param>
|
||||||
/// <response code="201">Created new Job</response>
|
/// <response code="201">Job-IDs</response>
|
||||||
/// <response code="201">Could not find Manga with ID</response>
|
/// <response code="201">Could not find Manga with ID</response>
|
||||||
/// <response code="500">Error during Database Operation</response>
|
/// <response code="500">Error during Database Operation</response>
|
||||||
[HttpPut("UpdateFilesJob/{MangaId}")]
|
[HttpPut("UpdateFilesJob/{MangaId}")]
|
||||||
@ -144,10 +144,10 @@ public class JobController(PgsqlContext context) : Controller
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a new UpdateMetadataJob for all Manga
|
/// Create a new UpdateMetadataJob for all Manga
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <response code="201">Created new Job</response>
|
/// <response code="201">Job-IDs</response>
|
||||||
/// <response code="500">Error during Database Operation</response>
|
/// <response code="500">Error during Database Operation</response>
|
||||||
[HttpPut("UpdateAllFilesJob")]
|
[HttpPut("UpdateAllFilesJob")]
|
||||||
[ProducesResponseType(Status201Created)]
|
[ProducesResponseType<string[]>(Status201Created, "application/json")]
|
||||||
[ProducesResponseType<string>(Status500InternalServerError, "text/plain")]
|
[ProducesResponseType<string>(Status500InternalServerError, "text/plain")]
|
||||||
public IActionResult CreateUpdateAllFilesDownloadedJob()
|
public IActionResult CreateUpdateAllFilesDownloadedJob()
|
||||||
{
|
{
|
||||||
@ -169,7 +169,7 @@ public class JobController(PgsqlContext context) : Controller
|
|||||||
/// Create a new UpdateMetadataJob
|
/// Create a new UpdateMetadataJob
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="MangaId">ID of the Manga</param>
|
/// <param name="MangaId">ID of the Manga</param>
|
||||||
/// <response code="201">Created new Job</response>
|
/// <response code="201">Job-IDs</response>
|
||||||
/// <response code="404">Could not find Manga with ID</response>
|
/// <response code="404">Could not find Manga with ID</response>
|
||||||
/// <response code="500">Error during Database Operation</response>
|
/// <response code="500">Error during Database Operation</response>
|
||||||
[HttpPut("UpdateMetadataJob/{MangaId}")]
|
[HttpPut("UpdateMetadataJob/{MangaId}")]
|
||||||
@ -187,10 +187,10 @@ public class JobController(PgsqlContext context) : Controller
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a new UpdateMetadataJob for all Manga
|
/// Create a new UpdateMetadataJob for all Manga
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <response code="201">Created new Job</response>
|
/// <response code="201">Job-IDs</response>
|
||||||
/// <response code="500">Error during Database Operation</response>
|
/// <response code="500">Error during Database Operation</response>
|
||||||
[HttpPut("UpdateAllMetadataJob")]
|
[HttpPut("UpdateAllMetadataJob")]
|
||||||
[ProducesResponseType(Status201Created)]
|
[ProducesResponseType<string[]>(Status201Created, "application/json")]
|
||||||
[ProducesResponseType<string>(Status500InternalServerError, "text/plain")]
|
[ProducesResponseType<string>(Status500InternalServerError, "text/plain")]
|
||||||
public IActionResult CreateUpdateAllMetadataJob()
|
public IActionResult CreateUpdateAllMetadataJob()
|
||||||
{
|
{
|
||||||
@ -332,10 +332,11 @@ public class JobController(PgsqlContext context) : Controller
|
|||||||
/// Stops the Job with the requested ID
|
/// Stops the Job with the requested ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="JobId">Job-ID</param>
|
/// <param name="JobId">Job-ID</param>
|
||||||
/// <remarks>NOT IMPLEMENTED</remarks>
|
/// <remarks><h1>NOT IMPLEMENTED</h1></remarks>
|
||||||
[HttpPost("{JobId}/Stop")]
|
[HttpPost("{JobId}/Stop")]
|
||||||
|
[ProducesResponseType(Status501NotImplemented)]
|
||||||
public IActionResult StopJob(string JobId)
|
public IActionResult StopJob(string JobId)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
return StatusCode(501);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -50,11 +50,11 @@ public class NotificationConnectorController(PgsqlContext context) : Controller
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>Formatting placeholders: "%title" and "%text" can be placed in url, header-values and body and will be replaced when notifications are sent</remarks>
|
/// <remarks>Formatting placeholders: "%title" and "%text" can be placed in url, header-values and body and will be replaced when notifications are sent</remarks>
|
||||||
/// <param name="notificationConnector">Notification-Connector</param>
|
/// <param name="notificationConnector">Notification-Connector</param>
|
||||||
/// <response code="201"></response>
|
/// <response code="201">ID of new connector</response>
|
||||||
/// <response code="409">A NotificationConnector with name already exists</response>
|
/// <response code="409">A NotificationConnector with name already exists</response>
|
||||||
/// <response code="500">Error during Database Operation</response>
|
/// <response code="500">Error during Database Operation</response>
|
||||||
[HttpPut]
|
[HttpPut]
|
||||||
[ProducesResponseType(Status201Created)]
|
[ProducesResponseType<string>(Status201Created, "application/json")]
|
||||||
[ProducesResponseType(Status409Conflict)]
|
[ProducesResponseType(Status409Conflict)]
|
||||||
[ProducesResponseType<string>(Status500InternalServerError, "text/plain")]
|
[ProducesResponseType<string>(Status500InternalServerError, "text/plain")]
|
||||||
public IActionResult CreateConnector([FromBody]NotificationConnector notificationConnector)
|
public IActionResult CreateConnector([FromBody]NotificationConnector notificationConnector)
|
||||||
@ -65,7 +65,7 @@ public class NotificationConnectorController(PgsqlContext context) : Controller
|
|||||||
{
|
{
|
||||||
context.NotificationConnectors.Add(notificationConnector);
|
context.NotificationConnectors.Add(notificationConnector);
|
||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
return Created();
|
return Created(notificationConnector.Name, notificationConnector);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@ -77,12 +77,12 @@ public class NotificationConnectorController(PgsqlContext context) : Controller
|
|||||||
/// Creates a new Gotify-Notification-Connector
|
/// Creates a new Gotify-Notification-Connector
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>Priority needs to be between 0 and 10</remarks>
|
/// <remarks>Priority needs to be between 0 and 10</remarks>
|
||||||
/// <response code="201"></response>
|
/// <response code="201">ID of new connector</response>
|
||||||
/// <response code="400"></response>
|
/// <response code="400"></response>
|
||||||
/// <response code="409">A NotificationConnector with name already exists</response>
|
/// <response code="409">A NotificationConnector with name already exists</response>
|
||||||
/// <response code="500">Error during Database Operation</response>
|
/// <response code="500">Error during Database Operation</response>
|
||||||
[HttpPut("Gotify")]
|
[HttpPut("Gotify")]
|
||||||
[ProducesResponseType(Status201Created)]
|
[ProducesResponseType<string>(Status201Created, "application/json")]
|
||||||
[ProducesResponseType(Status400BadRequest)]
|
[ProducesResponseType(Status400BadRequest)]
|
||||||
[ProducesResponseType(Status409Conflict)]
|
[ProducesResponseType(Status409Conflict)]
|
||||||
[ProducesResponseType<string>(Status500InternalServerError, "text/plain")]
|
[ProducesResponseType<string>(Status500InternalServerError, "text/plain")]
|
||||||
@ -103,12 +103,12 @@ public class NotificationConnectorController(PgsqlContext context) : Controller
|
|||||||
/// Creates a new Ntfy-Notification-Connector
|
/// Creates a new Ntfy-Notification-Connector
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>Priority needs to be between 1 and 5</remarks>
|
/// <remarks>Priority needs to be between 1 and 5</remarks>
|
||||||
/// <response code="201"></response>
|
/// <response code="201">ID of new connector</response>
|
||||||
/// <response code="400"></response>
|
/// <response code="400"></response>
|
||||||
/// <response code="409">A NotificationConnector with name already exists</response>
|
/// <response code="409">A NotificationConnector with name already exists</response>
|
||||||
/// <response code="500">Error during Database Operation</response>
|
/// <response code="500">Error during Database Operation</response>
|
||||||
[HttpPut("Ntfy")]
|
[HttpPut("Ntfy")]
|
||||||
[ProducesResponseType(Status201Created)]
|
[ProducesResponseType<string>(Status201Created, "application/json")]
|
||||||
[ProducesResponseType(Status400BadRequest)]
|
[ProducesResponseType(Status400BadRequest)]
|
||||||
[ProducesResponseType(Status409Conflict)]
|
[ProducesResponseType(Status409Conflict)]
|
||||||
[ProducesResponseType<string>(Status500InternalServerError, "text/plain")]
|
[ProducesResponseType<string>(Status500InternalServerError, "text/plain")]
|
||||||
@ -136,12 +136,12 @@ public class NotificationConnectorController(PgsqlContext context) : Controller
|
|||||||
/// Creates a new Lunasea-Notification-Connector
|
/// Creates a new Lunasea-Notification-Connector
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>https://docs.lunasea.app/lunasea/notifications/custom-notifications for id. Either device/:device_id or user/:user_id</remarks>
|
/// <remarks>https://docs.lunasea.app/lunasea/notifications/custom-notifications for id. Either device/:device_id or user/:user_id</remarks>
|
||||||
/// <response code="201"></response>
|
/// <response code="201">ID of new connector</response>
|
||||||
/// <response code="400"></response>
|
/// <response code="400"></response>
|
||||||
/// <response code="409">A NotificationConnector with name already exists</response>
|
/// <response code="409">A NotificationConnector with name already exists</response>
|
||||||
/// <response code="500">Error during Database Operation</response>
|
/// <response code="500">Error during Database Operation</response>
|
||||||
[HttpPut("Lunasea")]
|
[HttpPut("Lunasea")]
|
||||||
[ProducesResponseType(Status201Created)]
|
[ProducesResponseType<string>(Status201Created, "application/json")]
|
||||||
[ProducesResponseType(Status400BadRequest)]
|
[ProducesResponseType(Status400BadRequest)]
|
||||||
[ProducesResponseType(Status409Conflict)]
|
[ProducesResponseType(Status409Conflict)]
|
||||||
[ProducesResponseType<string>(Status500InternalServerError, "text/plain")]
|
[ProducesResponseType<string>(Status500InternalServerError, "text/plain")]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user