white label settings: added api descriptions

This commit is contained in:
Natalia Ovchinnikova 2023-03-13 18:18:57 +03:00
parent b4c27ea1b5
commit f357b70edc

View File

@ -64,8 +64,19 @@ public class WhitelabelController : BaseSettingsController
_commonLinkUtility = commonLinkUtility; _commonLinkUtility = commonLinkUtility;
_mapper = mapper; _mapper = mapper;
_companyWhiteLabelSettingsHelper = companyWhiteLabelSettingsHelper; _companyWhiteLabelSettingsHelper = companyWhiteLabelSettingsHelper;
} }
/// <summary>
/// Saves the white label settings specified in the request.
/// </summary>
/// <short>
/// Save the white label settings
/// </short>
/// <category>Rebranding</category>
/// <param name="inDto">White label settings: logo text, tenant IDs with their logos</param>
/// <returns>True if the operation is sucessful</returns>
/// <path>api/2.0/settings/whitelabel/save</path>
/// <httpMethod>POST</httpMethod>
///<visible>false</visible> ///<visible>false</visible>
[HttpPost("whitelabel/save")] [HttpPost("whitelabel/save")]
public async Task<bool> SaveWhiteLabelSettings(WhiteLabelRequestsDto inDto) public async Task<bool> SaveWhiteLabelSettings(WhiteLabelRequestsDto inDto)
@ -98,8 +109,18 @@ public class WhitelabelController : BaseSettingsController
_tenantWhiteLabelSettingsHelper.Save(settings, Tenant.Id, _tenantLogoManager); _tenantWhiteLabelSettingsHelper.Save(settings, Tenant.Id, _tenantLogoManager);
return true; return true;
} }
/// <summary>
/// Saves the white label settings from files.
/// </summary>
/// <short>
/// Save the white label settings from files
/// </short>
/// <category>Rebranding</category>
/// <returns>True if the operation is successful</returns>
/// <path>api/2.0/settings/whitelabel/savefromfiles</path>
/// <httpMethod>POST</httpMethod>
///<visible>false</visible> ///<visible>false</visible>
[HttpPost("whitelabel/savefromfiles")] [HttpPost("whitelabel/savefromfiles")]
public async Task<bool> SaveWhiteLabelSettingsFromFiles() public async Task<bool> SaveWhiteLabelSettingsFromFiles()
@ -157,8 +178,20 @@ public class WhitelabelController : BaseSettingsController
var parts = fileName.Split('.'); var parts = fileName.Split('.');
logoType = (WhiteLabelLogoTypeEnum)Convert.ToInt32(parts[0]); logoType = (WhiteLabelLogoTypeEnum)Convert.ToInt32(parts[0]);
fileExt = parts.Last(); fileExt = parts.Last();
} }
/// <summary>
/// Returns the white label logos.
/// </summary>
/// <short>
/// Get the white label logos
/// </short>
/// <category>Rebranding</category>
/// <param name="inDto">Specifies if the logo is for a dark theme or not</param>
/// <returns>White label logos</returns>
/// <path>api/2.0/settings/whitelabel/logos</path>
/// <httpMethod>GET</httpMethod>
/// <requiresAuthorization>false</requiresAuthorization>
///<visible>false</visible> ///<visible>false</visible>
[AllowNotPayment, AllowAnonymous] [AllowNotPayment, AllowAnonymous]
[HttpGet("whitelabel/logos")] [HttpGet("whitelabel/logos")]
@ -212,8 +245,18 @@ public class WhitelabelController : BaseSettingsController
yield return result; yield return result;
} }
} }
/// <summary>
/// Returns the white label logo text.
/// </summary>
/// <short>
/// Get the white label logo text
/// </short>
/// <category>Rebranding</category>
/// <returns>Logo text</returns>
/// <path>api/2.0/settings/whitelabel/logotext</path>
/// <httpMethod>GET</httpMethod>
///<visible>false</visible> ///<visible>false</visible>
[AllowNotPayment] [AllowNotPayment]
[HttpGet("whitelabel/logotext")] [HttpGet("whitelabel/logotext")]
@ -224,9 +267,19 @@ public class WhitelabelController : BaseSettingsController
var settings = _settingsManager.Load<TenantWhiteLabelSettings>(); var settings = _settingsManager.Load<TenantWhiteLabelSettings>();
return settings.LogoText ?? TenantWhiteLabelSettings.DefaultLogoText; return settings.LogoText ?? TenantWhiteLabelSettings.DefaultLogoText;
} }
/// <summary>
/// Restores the white label options.
/// </summary>
/// <short>
/// Restore the white label options
/// </short>
/// <category>Rebranding</category>
/// <returns>True if the operation is successful</returns>
/// <path>api/2.0/settings/whitelabel/restore</path>
/// <httpMethod>PUT</httpMethod>
///<visible>false</visible> ///<visible>false</visible>
[HttpPut("whitelabel/restore")] [HttpPut("whitelabel/restore")]
public async Task<bool> RestoreWhiteLabelOptions() public async Task<bool> RestoreWhiteLabelOptions()
@ -243,8 +296,16 @@ public class WhitelabelController : BaseSettingsController
_settingsManager.Save(tenantInfoSettings); _settingsManager.Save(tenantInfoSettings);
return true; return true;
} }
/// <summary>
/// Returns the licensor data.
/// </summary>
/// <short>Get the licensor data</short>
/// <category>Rebranding</category>
/// <returns>List of company white label settings</returns>
/// <path>api/2.0/settings/companywhitelabel</path>
/// <httpMethod>GET</httpMethod>
///<visible>false</visible> ///<visible>false</visible>
[HttpGet("companywhitelabel")] [HttpGet("companywhitelabel")]
public List<CompanyWhiteLabelSettings> GetLicensorData() public List<CompanyWhiteLabelSettings> GetLicensorData()
@ -261,8 +322,17 @@ public class WhitelabelController : BaseSettingsController
} }
return result; return result;
} }
/// <summary>
/// Saves the company white label settings specified in the request.
/// </summary>
/// <category>Rebranding</category>
/// <short>Save the company white label settings</short>
/// <param name="companyWhiteLabelSettingsWrapper">Company white label settings: company name, site, email, address, phone, licensor or not, default settings or not</param>
/// <returns>True if the operation is successful</returns>
/// <path>api/2.0/settings/rebranding/company</path>
/// <httpMethod>POST</httpMethod>
///<visible>false</visible> ///<visible>false</visible>
[HttpPost("rebranding/company")] [HttpPost("rebranding/company")]
public bool SaveCompanyWhiteLabelSettings(CompanyWhiteLabelSettingsWrapper companyWhiteLabelSettingsWrapper) public bool SaveCompanyWhiteLabelSettings(CompanyWhiteLabelSettingsWrapper companyWhiteLabelSettingsWrapper)
@ -280,15 +350,31 @@ public class WhitelabelController : BaseSettingsController
_settingsManager.Save(companyWhiteLabelSettingsWrapper.Settings); _settingsManager.Save(companyWhiteLabelSettingsWrapper.Settings);
return true; return true;
} }
/// <summary>
/// Returns the company white label settings.
/// </summary>
/// <category>Rebranding</category>
/// <short>Get the company white label settings</short>
/// <returns>Company white label settings</returns>
/// <path>api/2.0/settings/rebranding/company</path>
/// <httpMethod>GET</httpMethod>
///<visible>false</visible> ///<visible>false</visible>
[HttpGet("rebranding/company")] [HttpGet("rebranding/company")]
public CompanyWhiteLabelSettingsDto GetCompanyWhiteLabelSettings() public CompanyWhiteLabelSettingsDto GetCompanyWhiteLabelSettings()
{ {
return _mapper.Map<CompanyWhiteLabelSettings, CompanyWhiteLabelSettingsDto>(_settingsManager.Load<CompanyWhiteLabelSettings>()); return _mapper.Map<CompanyWhiteLabelSettings, CompanyWhiteLabelSettingsDto>(_settingsManager.Load<CompanyWhiteLabelSettings>());
} }
/// <summary>
/// Deletes the company white label settings.
/// </summary>
/// <category>Rebranding</category>
/// <short>Delete the company white label settings</short>
/// <returns>Default company white label settings</returns>
/// <path>api/2.0/settings/rebranding/company</path>
/// <httpMethod>DELETE</httpMethod>
///<visible>false</visible> ///<visible>false</visible>
[HttpDelete("rebranding/company")] [HttpDelete("rebranding/company")]
public CompanyWhiteLabelSettings DeleteCompanyWhiteLabelSettings() public CompanyWhiteLabelSettings DeleteCompanyWhiteLabelSettings()
@ -302,7 +388,16 @@ public class WhitelabelController : BaseSettingsController
return defaultSettings; return defaultSettings;
} }
/// <summary>
/// Saves the additional white label settings specified in the request.
/// </summary>
/// <category>Rebranding</category>
/// <short>Save the additional white label settings</short>
/// <param name="wrapper">Additional white label settings: StartDocsEnabled, HelpCenterEnabled, FeedbackAndSupportEnabled, FeedbackAndSupportUrl, UserForumEnabled, UserForumUrl, VideoGuidesEnabled, VideoGuidesUrl, SalesEmail, BuyUrl, LicenseAgreementsEnabled, IsDefault, LicenseAgreementsUrl</param>
/// <returns>True if the operation is successful</returns>
/// <path>api/2.0/settings/rebranding/additional</path>
/// <httpMethod>POST</httpMethod>
///<visible>false</visible> ///<visible>false</visible>
[HttpPost("rebranding/additional")] [HttpPost("rebranding/additional")]
public bool SaveAdditionalWhiteLabelSettings(AdditionalWhiteLabelSettingsWrapper wrapper) public bool SaveAdditionalWhiteLabelSettings(AdditionalWhiteLabelSettingsWrapper wrapper)
@ -318,15 +413,31 @@ public class WhitelabelController : BaseSettingsController
_settingsManager.Save(wrapper.Settings); _settingsManager.Save(wrapper.Settings);
return true; return true;
} }
/// <summary>
/// Returns the additional white label settings.
/// </summary>
/// <category>Rebranding</category>
/// <short>Get the additional white label settings</short>
/// <returns>Additional white label settings: StartDocsEnabled, HelpCenterEnabled, FeedbackAndSupportEnabled, FeedbackAndSupportUrl, UserForumEnabled, UserForumUrl, VideoGuidesEnabled, VideoGuidesUrl, SalesEmail, BuyUrl, LicenseAgreementsEnabled, IsDefault, LicenseAgreementsUrl</returns>
/// <path>api/2.0/settings/rebranding/additional</path>
/// <httpMethod>GET</httpMethod>
///<visible>false</visible> ///<visible>false</visible>
[HttpGet("rebranding/additional")] [HttpGet("rebranding/additional")]
public AdditionalWhiteLabelSettingsDto GetAdditionalWhiteLabelSettings() public AdditionalWhiteLabelSettingsDto GetAdditionalWhiteLabelSettings()
{ {
return _mapper.Map<AdditionalWhiteLabelSettings, AdditionalWhiteLabelSettingsDto>(_settingsManager.Load<AdditionalWhiteLabelSettings>()); return _mapper.Map<AdditionalWhiteLabelSettings, AdditionalWhiteLabelSettingsDto>(_settingsManager.Load<AdditionalWhiteLabelSettings>());
} }
/// <summary>
/// Deletes the additional white label settings.
/// </summary>
/// <category>Rebranding</category>
/// <short>Delete the additional white label settings</short>
/// <returns>Default additional white label settings</returns>
/// <path>api/2.0/settings/rebranding/additional</path>
/// <httpMethod>DELETE</httpMethod>
///<visible>false</visible> ///<visible>false</visible>
[HttpDelete("rebranding/additional")] [HttpDelete("rebranding/additional")]
public AdditionalWhiteLabelSettings DeleteAdditionalWhiteLabelSettings() public AdditionalWhiteLabelSettings DeleteAdditionalWhiteLabelSettings()
@ -339,8 +450,17 @@ public class WhitelabelController : BaseSettingsController
_settingsManager.Save(defaultSettings); _settingsManager.Save(defaultSettings);
return defaultSettings; return defaultSettings;
} }
/// <summary>
/// Saves the mail white label settings specified in the request.
/// </summary>
/// <category>Rebranding</category>
/// <short>Save the mail white label settings</short>
/// <param name="settings">Mail white label settings: FooterEnabled, FooterSocialEnabled, SupportUrl, SupportEmail, SalesEmail, DemoUrl, SiteUrl</param>
/// <returns>True if the operation is successful</returns>
/// <path>api/2.0/settings/rebranding/mail</path>
/// <httpMethod>POST</httpMethod>
///<visible>false</visible> ///<visible>false</visible>
[HttpPost("rebranding/mail")] [HttpPost("rebranding/mail")]
public bool SaveMailWhiteLabelSettings(MailWhiteLabelSettings settings) public bool SaveMailWhiteLabelSettings(MailWhiteLabelSettings settings)
@ -352,8 +472,17 @@ public class WhitelabelController : BaseSettingsController
_settingsManager.Save(settings); _settingsManager.Save(settings);
return true; return true;
} }
/// <summary>
/// Updates the mail white label settings with a paramater specified in the request.
/// </summary>
/// <category>Rebranding</category>
/// <short>Update the mail white label settings</short>
/// <param name="inDto">Specifies if a footer will be enabled or not</param>
/// <returns>True if the operation is successful</returns>
/// <path>api/2.0/settings/rebranding/mail</path>
/// <httpMethod>PUT</httpMethod>
///<visible>false</visible> ///<visible>false</visible>
[HttpPut("rebranding/mail")] [HttpPut("rebranding/mail")]
public bool UpdateMailWhiteLabelSettings(MailWhiteLabelSettingsRequestsDto inDto) public bool UpdateMailWhiteLabelSettings(MailWhiteLabelSettingsRequestsDto inDto)
@ -368,15 +497,31 @@ public class WhitelabelController : BaseSettingsController
_settingsManager.Save(settings); _settingsManager.Save(settings);
return true; return true;
} }
/// <summary>
/// Returns the mail white label settings.
/// </summary>
/// <category>Rebranding</category>
/// <short>Get the mail white label settings</short>
/// <returns>Mail white label settings: FooterEnabled, FooterSocialEnabled, SupportUrl, SupportEmail, SalesEmail, DemoUrl, SiteUrl</returns>
/// <path>api/2.0/settings/rebranding/mail</path>
/// <httpMethod>GET</httpMethod>
///<visible>false</visible> ///<visible>false</visible>
[HttpGet("rebranding/mail")] [HttpGet("rebranding/mail")]
public MailWhiteLabelSettings GetMailWhiteLabelSettings() public MailWhiteLabelSettings GetMailWhiteLabelSettings()
{ {
return _settingsManager.Load<MailWhiteLabelSettings>(); return _settingsManager.Load<MailWhiteLabelSettings>();
} }
/// <summary>
/// Deletes the mail white label settings.
/// </summary>
/// <category>Rebranding</category>
/// <short>Delete the mail white label settings</short>
/// <returns>Default mail white label settings</returns>
/// <path>api/2.0/settings/rebranding/mail</path>
/// <httpMethod>DELETE</httpMethod>
///<visible>false</visible> ///<visible>false</visible>
[HttpDelete("rebranding/mail")] [HttpDelete("rebranding/mail")]
public MailWhiteLabelSettings DeleteMailWhiteLabelSettings() public MailWhiteLabelSettings DeleteMailWhiteLabelSettings()
@ -391,6 +536,14 @@ public class WhitelabelController : BaseSettingsController
return defaultSettings; return defaultSettings;
} }
/// <summary>
/// Checks if the white label is enabled or not.
/// </summary>
/// <category>Rebranding</category>
/// <short>Check the white label availability</short>
/// <returns>Boolean value: true if the white label is enabled</returns>
/// <path>api/2.0/settings/enableWhitelabel</path>
/// <httpMethod>GET</httpMethod>
///<visible>false</visible> ///<visible>false</visible>
[HttpGet("enableWhitelabel")] [HttpGet("enableWhitelabel")]
public bool GetEnableWhitelabel() public bool GetEnableWhitelabel()