41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
using CMS_CORE_Library.Models;
|
|
using System.Collections.Generic;
|
|
using System.Web.Http;
|
|
using Thermo.Active.Model.DTOModels;
|
|
using Thermo.Active.NC;
|
|
using Thermo.Active.Utils;
|
|
|
|
namespace Thermo.Active.Controllers.WebApi
|
|
{
|
|
[RoutePrefix("api/starred_softkey")]
|
|
public class StarredUserSoftKeyController : aBaseApiController // ApiController
|
|
{
|
|
#if false
|
|
/// <summary>
|
|
/// Oggetto adapter condiviso da WebAPI
|
|
/// </summary>
|
|
protected static NcAdapter ncAdapter = new NcAdapter();
|
|
#endif
|
|
|
|
[Route("get"), HttpGet]
|
|
public IHttpActionResult GetStarredUserSoftkey()
|
|
{
|
|
// // Try connection
|
|
CmsError libraryError = ncAdapter.Connect();
|
|
if (libraryError.IsError())
|
|
{
|
|
ThermoActiveLogger.LogError($"ncAdapter Not connected! | GetOverview | {libraryError.exception}");
|
|
}
|
|
|
|
libraryError = ncAdapter.GetStarredUserSoftKeys(out List <DTOUserSoftKeyModel> softKeys);
|
|
if (libraryError.IsError())
|
|
{
|
|
ThermoActiveLogger.LogError($"GetStarredUserSoftkey error | {libraryError.exception}");
|
|
return BadRequest(libraryError.localizationKey);
|
|
}
|
|
|
|
return Ok(softKeys);
|
|
}
|
|
|
|
}
|
|
} |