This commit is contained in:
@@ -73,8 +73,6 @@ namespace AyaNova.Api.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// List of all DataList keys available
|
/// List of all DataList keys available
|
||||||
///
|
///
|
||||||
@@ -92,5 +90,30 @@ namespace AyaNova.Api.Controllers
|
|||||||
return Ok(ApiOkResponse.Response(DataListFactory.GetListOfAllDataListKeyNames(), true));
|
return Ok(ApiOkResponse.Response(DataListFactory.GetListOfAllDataListKeyNames(), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// List of all fields for data list key specified
|
||||||
|
///
|
||||||
|
/// Required roles: Any
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>List of DataListFieldDefinition</returns>
|
||||||
|
[HttpGet("ListFields")]
|
||||||
|
public ActionResult GetDataListFields([FromQuery] string DataListKey)
|
||||||
|
{
|
||||||
|
if (!serverState.IsOpen)
|
||||||
|
{
|
||||||
|
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
|
||||||
|
}
|
||||||
|
|
||||||
|
var DataList = DataListFactory.GetAyaDataList(DataListKey);
|
||||||
|
//was the name not found as a list?
|
||||||
|
if (DataList == null)
|
||||||
|
{
|
||||||
|
return BadRequest(new ApiErrorResponse(ApiErrorCode.NOT_FOUND, "DataListKey", $"DataList \"{DataListKey}\" specified does not exist"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return Ok(ApiOkResponse.Response(DataList.FieldDefinitions, true));
|
||||||
|
}
|
||||||
|
|
||||||
}//eoc
|
}//eoc
|
||||||
}//ens
|
}//ens
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
@@ -32,7 +34,10 @@ namespace AyaNova.DataList
|
|||||||
public int AyaObjectType { get; set; }
|
public int AyaObjectType { get; set; }
|
||||||
|
|
||||||
//SERVER - for building sql queries
|
//SERVER - for building sql queries
|
||||||
|
//don't return these properties when api user fetches field list definitions in DataListController
|
||||||
|
[JsonIgnore]
|
||||||
public string SqlIdColumnName { get; set; }
|
public string SqlIdColumnName { get; set; }
|
||||||
|
[JsonIgnore]
|
||||||
public string SqlValueColumnName { get; set; }
|
public string SqlValueColumnName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user