From 547fe598cb28c1ed77388fa6f06dc3a88c13e8f6 Mon Sep 17 00:00:00 2001 From: RudiThoeni Date: Wed, 18 Dec 2024 09:19:33 +0100 Subject: [PATCH] updating CRUD Methods attributes --- Helper/Helper.csproj | 2 +- .../api/AccommodationApiController.cs | 17 +++++++++++---- .../Controllers/api/ArticleApiController.cs | 2 +- .../Controllers/api/EventApiController.cs | 15 ++++++++++--- .../Controllers/api/EventV2ApiController.cs | 15 ++++++++++--- .../api/ODHActivityPoiController.cs | 15 ++++++++++--- .../Controllers/api/PublisherController.cs | 9 ++++++++ .../Controllers/api/SourceController.cs | 9 ++++++++ OdhApiCore/Controllers/api/TagController.cs | 21 +++++++++++++------ .../Controllers/api/VenueApiController.cs | 15 ++++++++++--- .../Controllers/api/VenueV2ApiController.cs | 17 +++++++++++---- .../api/WebcamInfoApiController.cs | 21 +++++++++++++------ 12 files changed, 124 insertions(+), 34 deletions(-) diff --git a/Helper/Helper.csproj b/Helper/Helper.csproj index 629181db..7ffb3ab5 100644 --- a/Helper/Helper.csproj +++ b/Helper/Helper.csproj @@ -13,7 +13,7 @@ - + diff --git a/OdhApiCore/Controllers/api/AccommodationApiController.cs b/OdhApiCore/Controllers/api/AccommodationApiController.cs index 3339f724..4db5a0d7 100644 --- a/OdhApiCore/Controllers/api/AccommodationApiController.cs +++ b/OdhApiCore/Controllers/api/AccommodationApiController.cs @@ -963,9 +963,12 @@ private IActionResult GetFeatureListXML(CancellationToken cancellationToken) /// Accommodation Object /// Http Response //[ApiExplorerSettings(IgnoreApi = true)] - [InvalidateCacheOutput(typeof(AccommodationController), nameof(GetAccommodations))] + //[InvalidateCacheOutput(typeof(AccommodationController), nameof(GetAccommodations))] //[Authorize(Roles = "DataWriter,DataCreate,AccoManager,AccoCreate,AccommodationWriter,AccommodationManager,AccommodationCreate")] [AuthorizeODH(PermissionAction.Create)] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpPost, Route("Accommodation")] public Task Post([FromBody] AccommodationV2 accommodation) { @@ -996,9 +999,12 @@ public Task Post([FromBody] AccommodationV2 accommodation) /// Accommodation Object /// Http Response //[ApiExplorerSettings(IgnoreApi = true)] - [InvalidateCacheOutput(typeof(AccommodationController), nameof(GetAccommodations))] + //[InvalidateCacheOutput(typeof(AccommodationController), nameof(GetAccommodations))] [AuthorizeODH(PermissionAction.Update)] //[Authorize(Roles = "DataWriter,DataModify,AccoManager,AccoModify,AccommodationWriter,AccommodationManager,AccommodationModify,AccommodationUpdate")] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpPut, Route("Accommodation/{id}")] public Task Put(string id, [FromBody] AccommodationV2 accommodation) { @@ -1026,10 +1032,13 @@ public Task Put(string id, [FromBody] AccommodationV2 accommodati /// /// Accommodation Id /// Http Response - [ApiExplorerSettings(IgnoreApi = true)] - [InvalidateCacheOutput(typeof(AccommodationController), nameof(GetAccommodations))] + //[ApiExplorerSettings(IgnoreApi = true)] + //[InvalidateCacheOutput(typeof(AccommodationController), nameof(GetAccommodations))] [AuthorizeODH(PermissionAction.Delete)] //[Authorize(Roles = "DataWriter,DataDelete,AccoManager,AccoDelete,AccommodationWriter,AccommodationManager,AccommodationDelete")] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpDelete, Route("Accommodation/{id}")] public Task Delete(string id) { diff --git a/OdhApiCore/Controllers/api/ArticleApiController.cs b/OdhApiCore/Controllers/api/ArticleApiController.cs index baf7d985..f496a715 100644 --- a/OdhApiCore/Controllers/api/ArticleApiController.cs +++ b/OdhApiCore/Controllers/api/ArticleApiController.cs @@ -329,7 +329,7 @@ private Task GetArticleTypeSingle(string id, string? language, st //[ApiExplorerSettings(IgnoreApi = true)] //[Authorize(Roles = "DataWriter,DataCreate,ArticleManager,ArticleCreate")] [AuthorizeODH(PermissionAction.Create)] - [InvalidateCacheOutput(nameof(GetArticleList))] + //[InvalidateCacheOutput(nameof(GetArticleList))] [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] diff --git a/OdhApiCore/Controllers/api/EventApiController.cs b/OdhApiCore/Controllers/api/EventApiController.cs index 0469cf49..7dec8932 100644 --- a/OdhApiCore/Controllers/api/EventApiController.cs +++ b/OdhApiCore/Controllers/api/EventApiController.cs @@ -362,9 +362,12 @@ private Task GetEventTopicSingleAsync(string id, string? language /// Event Object /// Http Response //[ApiExplorerSettings(IgnoreApi = true)] - [InvalidateCacheOutput(nameof(GetEventList))] + //[InvalidateCacheOutput(nameof(GetEventList))] [AuthorizeODH(PermissionAction.Create)] //[Authorize(Roles = "DataWriter,DataCreate,EventManager,EventCreate")] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpPost, Route("Event")] public Task Post([FromBody] EventLinked odhevent) { @@ -393,9 +396,12 @@ public Task Post([FromBody] EventLinked odhevent) /// Event Object /// Http Response //[ApiExplorerSettings(IgnoreApi = true)] - [InvalidateCacheOutput(nameof(GetEventList))] + //[InvalidateCacheOutput(nameof(GetEventList))] [AuthorizeODH(PermissionAction.Update)] //[Authorize(Roles = "DataWriter,DataModify,EventManager,EventModify,EventUpdate")] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpPut, Route("Event/{id}")] public Task Put(string id, [FromBody] EventLinked odhevent) { @@ -424,9 +430,12 @@ public Task Put(string id, [FromBody] EventLinked odhevent) /// Event Id /// Http Response //[ApiExplorerSettings(IgnoreApi = true)] - [InvalidateCacheOutput(nameof(GetEventList))] + //[InvalidateCacheOutput(nameof(GetEventList))] //[Authorize(Roles = "DataWriter,DataDelete,EventManager,EventDelete")] [AuthorizeODH(PermissionAction.Delete)] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpDelete, Route("Event/{id}")] public Task Delete(string id) { diff --git a/OdhApiCore/Controllers/api/EventV2ApiController.cs b/OdhApiCore/Controllers/api/EventV2ApiController.cs index 289b413b..36eb9260 100644 --- a/OdhApiCore/Controllers/api/EventV2ApiController.cs +++ b/OdhApiCore/Controllers/api/EventV2ApiController.cs @@ -401,9 +401,12 @@ private Task GetSingle(string id, string? language, string[] fiel /// Event Object /// Http Response //[ApiExplorerSettings(IgnoreApi = true)] - [InvalidateCacheOutput(nameof(GetEventList))] + //[InvalidateCacheOutput(nameof(GetEventList))] [AuthorizeODH(PermissionAction.Create)] //[Authorize(Roles = "DataWriter,DataCreate,EventManager,EventCreate")] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpPost, Route("Event")] public Task Post([FromBody] EventV2 odhevent) { @@ -434,7 +437,10 @@ public Task Post([FromBody] EventV2 odhevent) /// Event Object /// Http Response //[ApiExplorerSettings(IgnoreApi = true)] - [InvalidateCacheOutput(nameof(GetEventList))] + //[InvalidateCacheOutput(nameof(GetEventList))] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [AuthorizeODH(PermissionAction.Update)] //[Authorize(Roles = "DataWriter,DataModify,EventManager,EventModify,EventUpdate")] [HttpPut, Route("Event/{id}")] @@ -466,8 +472,11 @@ public Task Put(string id, [FromBody] EventV2 odhevent) /// Event Id /// Http Response //[ApiExplorerSettings(IgnoreApi = true)] - [InvalidateCacheOutput(nameof(GetEventList))] + //[InvalidateCacheOutput(nameof(GetEventList))] //[Authorize(Roles = "DataWriter,DataDelete,EventManager,EventDelete")] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [AuthorizeODH(PermissionAction.Delete)] [HttpDelete, Route("Event/{id}")] public Task Delete(string id) diff --git a/OdhApiCore/Controllers/api/ODHActivityPoiController.cs b/OdhApiCore/Controllers/api/ODHActivityPoiController.cs index 9ce80394..2cd885ee 100644 --- a/OdhApiCore/Controllers/api/ODHActivityPoiController.cs +++ b/OdhApiCore/Controllers/api/ODHActivityPoiController.cs @@ -395,8 +395,11 @@ private Task GetSmgPoiTypesSingle(string id, string? language, st /// ODHActivityPoi Object /// Http Response //[ApiExplorerSettings(IgnoreApi = true)] - [InvalidateCacheOutput(typeof(ODHActivityPoiController), nameof(GetODHActivityPoiList))] + //[InvalidateCacheOutput(typeof(ODHActivityPoiController), nameof(GetODHActivityPoiList))] //[Authorize(Roles = "DataWriter,DataCreate,ODHActivityPoiWriter,ODHActivityPoiManager,ODHActivityPoiCreate,SmgPoiManager,SmgPoiCreate")] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [AuthorizeODH(PermissionAction.Create)] [HttpPost, Route("ODHActivityPoi")] public Task Post([FromBody] ODHActivityPoiLinked odhactivitypoi) @@ -450,8 +453,11 @@ public Task Post([FromBody] ODHActivityPoiLinked odhactivitypoi) /// ODHActivityPoi Object /// Http Response //[ApiExplorerSettings(IgnoreApi = true)] - [InvalidateCacheOutput(typeof(ODHActivityPoiController), nameof(GetODHActivityPoiList))] + //[InvalidateCacheOutput(typeof(ODHActivityPoiController), nameof(GetODHActivityPoiList))] //[Authorize(Roles = "DataWriter,DataModify,ODHActivityPoiWriter,ODHActivityPoiManager,ODHActivityPoiModify,ODHActivityPoiUpdate,SmgPoiManager,SmgPoiModify")] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [AuthorizeODH(PermissionAction.Update)] [HttpPut, Route("ODHActivityPoi/{id}")] public Task Put(string id, [FromBody] ODHActivityPoiLinked odhactivitypoi) @@ -505,8 +511,11 @@ public Task Put(string id, [FromBody] ODHActivityPoiLinked odhact /// ODHActivityPoi Id /// Http Response //[ApiExplorerSettings(IgnoreApi = true)] - [InvalidateCacheOutput(typeof(ODHActivityPoiController), nameof(GetODHActivityPoiList))] + //[InvalidateCacheOutput(typeof(ODHActivityPoiController), nameof(GetODHActivityPoiList))] //[Authorize(Roles = "DataWriter,DataDelete,ODHActivityPoiWriter,ODHActivityPoiManager,ODHActivityPoiDelete,SmgPoiManager,SmgPoiDelete")] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [AuthorizeODH(PermissionAction.Delete)] [HttpDelete, Route("ODHActivityPoi/{id}")] public Task Delete(string id) diff --git a/OdhApiCore/Controllers/api/PublisherController.cs b/OdhApiCore/Controllers/api/PublisherController.cs index 6b3a7564..c943c2bc 100644 --- a/OdhApiCore/Controllers/api/PublisherController.cs +++ b/OdhApiCore/Controllers/api/PublisherController.cs @@ -190,6 +190,9 @@ private Task GetSingle(string id, string? language, string[] fiel /// PublisherLinked Object /// Http Response //[Authorize(Roles = "DataWriter,DataCreate,PublisherManager,PublisherCreate")] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [AuthorizeODH(PermissionAction.Create)] [HttpPost, Route("Publisher")] public Task Post([FromBody] PublisherLinked publisher) @@ -216,6 +219,9 @@ public Task Post([FromBody] PublisherLinked publisher) /// Http Response //[Authorize(Roles = "DataWriter,DataModify,PublisherManager,PublisherModify,PublisherUpdate")] [AuthorizeODH(PermissionAction.Update)] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpPut, Route("Publisher/{id}")] public Task Put(string id, [FromBody] PublisherLinked publisher) { @@ -237,6 +243,9 @@ public Task Put(string id, [FromBody] PublisherLinked publisher) /// Http Response //[Authorize(Roles = "DataWriter,DataDelete,PublisherManager,PublisherDelete")] [AuthorizeODH(PermissionAction.Delete)] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpDelete, Route("Publisher/{id}")] public Task Delete(string id) { diff --git a/OdhApiCore/Controllers/api/SourceController.cs b/OdhApiCore/Controllers/api/SourceController.cs index fe10d307..a196d319 100644 --- a/OdhApiCore/Controllers/api/SourceController.cs +++ b/OdhApiCore/Controllers/api/SourceController.cs @@ -189,6 +189,9 @@ private Task GetSingle(string id, string? language, string[] fiel /// SourceLinked Object /// Http Response //[Authorize(Roles = "DataWriter,DataCreate,SourceManager,SourceCreate")] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [AuthorizeODH(PermissionAction.Create)] [HttpPost, Route("Source")] public Task Post([FromBody] SourceLinked source) @@ -215,6 +218,9 @@ public Task Post([FromBody] SourceLinked source) /// Http Response //[Authorize(Roles = "DataWriter,DataModify,SourceManager,SourceModify,SourceUpdate")] [AuthorizeODH(PermissionAction.Update)] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpPut, Route("Source/{id}")] public Task Put(string id, [FromBody] SourceLinked source) { @@ -236,6 +242,9 @@ public Task Put(string id, [FromBody] SourceLinked source) /// Http Response //[Authorize(Roles = "DataWriter,DataDelete,SourceManager,SourceDelete")] [AuthorizeODH(PermissionAction.Delete)] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpDelete, Route("Source/{id}")] public Task Delete(string id) { diff --git a/OdhApiCore/Controllers/api/TagController.cs b/OdhApiCore/Controllers/api/TagController.cs index 19177b86..6380764c 100644 --- a/OdhApiCore/Controllers/api/TagController.cs +++ b/OdhApiCore/Controllers/api/TagController.cs @@ -214,10 +214,13 @@ private Task GetSingle(string id, string? language, string[] fiel /// /// Tag Object /// Http Response - [ApiExplorerSettings(IgnoreApi = true)] - [InvalidateCacheOutput(nameof(GetTagAsync))] + //[ApiExplorerSettings(IgnoreApi = true)] + //[InvalidateCacheOutput(nameof(GetTagAsync))] //[Authorize(Roles = "DataWriter,DataCreate,TagManager,TagCreate")] [AuthorizeODH(PermissionAction.Create)] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpPost, Route("Tag")] public Task Post([FromBody] TagLinked tag) { @@ -239,10 +242,13 @@ public Task Post([FromBody] TagLinked tag) /// Tag Id /// Tag Object /// Http Response - [ApiExplorerSettings(IgnoreApi = true)] - [InvalidateCacheOutput(nameof(GetTagAsync))] + //[ApiExplorerSettings(IgnoreApi = true)] + //[InvalidateCacheOutput(nameof(GetTagAsync))] //[Authorize(Roles = "DataWriter,DataModify,TagManager,TagModify,TagUpdate")] [AuthorizeODH(PermissionAction.Update)] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpPut, Route("Tag/{id}")] public Task Put(string id, [FromBody] TagLinked tag) { @@ -263,10 +269,13 @@ public Task Put(string id, [FromBody] TagLinked tag) /// /// Tag Id /// Http Response - [ApiExplorerSettings(IgnoreApi = true)] - [InvalidateCacheOutput(nameof(GetTagAsync))] + //[ApiExplorerSettings(IgnoreApi = true)] + //[InvalidateCacheOutput(nameof(GetTagAsync))] //[Authorize(Roles = "DataWriter,DataDelete,TagManager,TagDelete")] [AuthorizeODH(PermissionAction.Delete)] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpDelete, Route("Tag/{id}")] public Task Delete(string id) { diff --git a/OdhApiCore/Controllers/api/VenueApiController.cs b/OdhApiCore/Controllers/api/VenueApiController.cs index 289b772f..34341448 100644 --- a/OdhApiCore/Controllers/api/VenueApiController.cs +++ b/OdhApiCore/Controllers/api/VenueApiController.cs @@ -357,10 +357,13 @@ private Task GetVenueTypesSingleAsync(string id, string? language /// /// Venue Object /// Http Response - [ApiExplorerSettings(IgnoreApi = true)] + //[ApiExplorerSettings(IgnoreApi = true)] //[InvalidateCacheOutput(nameof(GetVenueList))] //[Authorize(Roles = "DataWriter,DataCreate,VenueManager,VenueCreate")] [AuthorizeODH(PermissionAction.Create)] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpPost, Route("Venue")] public Task Post([FromBody] VenueLinked venue) { @@ -389,10 +392,13 @@ public Task Post([FromBody] VenueLinked venue) /// Venue Id /// Venue Object /// Http Response - [ApiExplorerSettings(IgnoreApi = true)] + //[ApiExplorerSettings(IgnoreApi = true)] //[InvalidateCacheOutput(nameof(GetVenueList))] //[Authorize(Roles = "DataWriter,DataModify,VenueManager,VenueModify,VenueUpdate")] [AuthorizeODH(PermissionAction.Update)] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpPut, Route("Venue/{id}")] public Task Put(string id, [FromBody] VenueLinked venue) { @@ -421,10 +427,13 @@ public Task Put(string id, [FromBody] VenueLinked venue) /// /// Venue Id /// Http Response - [ApiExplorerSettings(IgnoreApi = true)] + //[ApiExplorerSettings(IgnoreApi = true)] //[InvalidateCacheOutput(nameof(GetVenueList))] //[Authorize(Roles = "DataWriter,DataDelete,VenueManager,VenueDelete")] [AuthorizeODH(PermissionAction.Delete)] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpDelete, Route("Venue/{id}")] public Task Delete(string id) { diff --git a/OdhApiCore/Controllers/api/VenueV2ApiController.cs b/OdhApiCore/Controllers/api/VenueV2ApiController.cs index 410966f3..cfd13ea6 100644 --- a/OdhApiCore/Controllers/api/VenueV2ApiController.cs +++ b/OdhApiCore/Controllers/api/VenueV2ApiController.cs @@ -326,7 +326,7 @@ private Task GetSingle(string id, string? language, string[] fiel } #endregion - + #region POST PUT DELETE /// @@ -334,10 +334,13 @@ private Task GetSingle(string id, string? language, string[] fiel /// /// Venue Object /// Http Response - [ApiExplorerSettings(IgnoreApi = true)] + //[ApiExplorerSettings(IgnoreApi = true)] //[InvalidateCacheOutput(nameof(GetVenueList))] //[Authorize(Roles = "DataWriter,DataCreate,VenueManager,VenueCreate")] [AuthorizeODH(PermissionAction.Create)] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpPost, Route("Venue")] public Task Post([FromBody] VenueV2 venue) { @@ -367,10 +370,13 @@ public Task Post([FromBody] VenueV2 venue) /// Venue Id /// Venue Object /// Http Response - [ApiExplorerSettings(IgnoreApi = true)] + //[ApiExplorerSettings(IgnoreApi = true)] //[InvalidateCacheOutput(nameof(GetVenueList))] //[Authorize(Roles = "DataWriter,DataModify,VenueManager,VenueModify,VenueUpdate")] [AuthorizeODH(PermissionAction.Update)] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpPut, Route("Venue/{id}")] public Task Put(string id, [FromBody] VenueV2 venue) { @@ -400,10 +406,13 @@ public Task Put(string id, [FromBody] VenueV2 venue) /// /// Venue Id /// Http Response - [ApiExplorerSettings(IgnoreApi = true)] + //[ApiExplorerSettings(IgnoreApi = true)] //[InvalidateCacheOutput(nameof(GetVenueList))] //[Authorize(Roles = "DataWriter,DataDelete,VenueManager,VenueDelete")] [AuthorizeODH(PermissionAction.Delete)] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpDelete, Route("Venue/{id}")] public Task Delete(string id) { diff --git a/OdhApiCore/Controllers/api/WebcamInfoApiController.cs b/OdhApiCore/Controllers/api/WebcamInfoApiController.cs index 1c869724..1528da08 100644 --- a/OdhApiCore/Controllers/api/WebcamInfoApiController.cs +++ b/OdhApiCore/Controllers/api/WebcamInfoApiController.cs @@ -211,10 +211,13 @@ private Task GetSingleAsync(string id, string? language, string[] /// /// WebcamInfo Object /// Http Response - [ApiExplorerSettings(IgnoreApi = true)] + //[ApiExplorerSettings(IgnoreApi = true)] [AuthorizeODH(PermissionAction.Create)] //[Authorize(Roles = "DataWriter,DataCreate,WebcamManager,WebcamCreate")] - [InvalidateCacheOutput(typeof(WebcamInfoController), nameof(Get))] + //[InvalidateCacheOutput(typeof(WebcamInfoController), nameof(Get))] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpPost, Route("WebcamInfo")] public Task Post([FromBody] WebcamInfoLinked webcam) { @@ -240,10 +243,13 @@ public Task Post([FromBody] WebcamInfoLinked webcam) /// WebcamInfo Id /// WebcamInfo Object /// Http Response - [ApiExplorerSettings(IgnoreApi = true)] + //[ApiExplorerSettings(IgnoreApi = true)] [AuthorizeODH(PermissionAction.Update)] //[Authorize(Roles = "DataWriter,DataModify,WebcamManager,WebcamModify,WebcamUpdate")] - [InvalidateCacheOutput(typeof(WebcamInfoController), nameof(Get))] + //[InvalidateCacheOutput(typeof(WebcamInfoController), nameof(Get))] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpPut, Route("WebcamInfo/{id}")] public Task Put(string id, [FromBody] WebcamInfoLinked webcam) { @@ -265,10 +271,13 @@ public Task Put(string id, [FromBody] WebcamInfoLinked webcam) /// /// WebcamInfo Id /// Http Response - [ApiExplorerSettings(IgnoreApi = true)] + //[ApiExplorerSettings(IgnoreApi = true)] [AuthorizeODH(PermissionAction.Delete)] //[Authorize(Roles = "DataWriter,DataDelete,WebcamManager,WebcamDelete")] - [InvalidateCacheOutput(typeof(WebcamInfoController), nameof(Get))] + //[InvalidateCacheOutput(typeof(WebcamInfoController), nameof(Get))] + [ProducesResponseType(typeof(PGCRUDResult), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] [HttpDelete, Route("WebcamInfo/{id}")] public Task Delete(string id) {