From f4c56ae7064bf73ab1a26723fcadcdec0d7d7254 Mon Sep 17 00:00:00 2001 From: Natalia Date: Thu, 2 Mar 2023 18:19:48 +0300 Subject: [PATCH] base and custom navigation settings: added api descriptions --- .../Api/Settings/BaseSettingsController.cs | 8 ++- .../Settings/CustomNavigationController.cs | 63 ++++++++++++++++--- 2 files changed, 59 insertions(+), 12 deletions(-) diff --git a/web/ASC.Web.Api/Api/Settings/BaseSettingsController.cs b/web/ASC.Web.Api/Api/Settings/BaseSettingsController.cs index 9ad6c4cc08..d2d50a0b1d 100644 --- a/web/ASC.Web.Api/Api/Settings/BaseSettingsController.cs +++ b/web/ASC.Web.Api/Api/Settings/BaseSettingsController.cs @@ -24,8 +24,12 @@ // content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 // International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -namespace ASC.Web.Api.Controllers.Settings; - +namespace ASC.Web.Api.Controllers.Settings; + +/// +/// Portal settings API. +/// +///settings [Scope] [DefaultRoute] [ApiController] diff --git a/web/ASC.Web.Api/Api/Settings/CustomNavigationController.cs b/web/ASC.Web.Api/Api/Settings/CustomNavigationController.cs index 50c1a1463d..600b501de4 100644 --- a/web/ASC.Web.Api/Api/Settings/CustomNavigationController.cs +++ b/web/ASC.Web.Api/Api/Settings/CustomNavigationController.cs @@ -47,26 +47,60 @@ public class CustomNavigationController : BaseSettingsController _permissionContext = permissionContext; _settingsManager = settingsManager; _storageHelper = storageHelper; - } - + } + + /// + /// Returns a list of the custom navigation items. + /// + /// Get the custom navigation items + /// Custom navigation + /// List of the custom navigation items + /// api/2.0/settings/customnavigation/getall + /// GET [HttpGet("customnavigation/getall")] public List GetCustomNavigationItems() { return _settingsManager.Load().Items; - } - + } + + /// + /// Returns a custom navigation item sample. + /// + /// Get a custom navigation item sample + /// Custom navigation + /// Custom navigation item + /// api/2.0/settings/customnavigation/getsample + /// GET [HttpGet("customnavigation/getsample")] public CustomNavigationItem GetCustomNavigationItemSample() { return CustomNavigationItem.GetSample(); - } - + } + + /// + /// Returns a custom navigation item by the ID specified in the request. + /// + /// Get a custom navigation item by ID + /// Custom navigation + /// Custom navigation item ID + /// Custom navigation item + /// api/2.0/settings/customnavigation/get/{id} + /// GET [HttpGet("customnavigation/get/{id}")] public CustomNavigationItem GetCustomNavigationItem(Guid id) { return _settingsManager.Load().Items.FirstOrDefault(item => item.Id == id); - } - + } + + /// + /// Adds a custom navigation item with the parameters specified in the request. + /// + /// Add a custom navigation item + /// Custom navigation + /// Custom navigation parameters: ID, label, URL, big image, small image, show in menu or not, show on home page or not + /// Custom navigation item + /// api/2.0/settings/customnavigation/create + /// POST [HttpPost("customnavigation/create")] public async Task CreateCustomNavigationItem(CustomNavigationItem item) { @@ -118,8 +152,17 @@ public class CustomNavigationController : BaseSettingsController _messageService.Send(MessageAction.CustomNavigationSettingsUpdated); return item; - } - + } + + /// + /// Deletes a custom navigation item with the ID specified in the request. + /// + /// Delete a custom navigation item + /// Custom navigation + /// Custom navigation item ID + /// api/2.0/settings/customnavigation/delete/{id} + /// DELETE + /// Task awaiter [HttpDelete("customnavigation/delete/{id}")] public async Task DeleteCustomNavigationItem(Guid id) {