This commit is contained in:
2020-07-01 18:14:57 +00:00
parent 78598688ac
commit cd16d4acbf
2 changed files with 59 additions and 15 deletions

View File

@@ -48,7 +48,7 @@ namespace AyaNova.Api.Controllers
/// <param name="enumkey">The key name of the enumerated type</param>
/// <returns>List</returns>
[HttpGet("list/{enumkey}")]
public ActionResult GetList([FromRoute]string enumkey)
public ActionResult GetList([FromRoute] string enumkey)
{
if (serverState.IsClosed)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
@@ -148,10 +148,45 @@ namespace AyaNova.Api.Controllers
ReturnList.Add(new NameIdItem() { Name = LT["UserTypeUtility"], Id = (long)UserType.Utility });
ReturnList.Add(new NameIdItem() { Name = LT["UserTypeServiceContractor"], Id = (long)UserType.ServiceContractor });
}
else if (keyNameInLowerCase == StringUtil.TrimTypeName(typeof(AyaEvent).ToString()).ToLowerInvariant())
{
TranslationKeysToFetch.Add("EventDeleted");
TranslationKeysToFetch.Add("EventCreated");
TranslationKeysToFetch.Add("EventRetrieved");
TranslationKeysToFetch.Add("EventModified");
TranslationKeysToFetch.Add("EventAttachmentCreate");
TranslationKeysToFetch.Add("EventAttachmentDelete");
TranslationKeysToFetch.Add("EventAttachmentDownload");
TranslationKeysToFetch.Add("EventLicenseFetch");
TranslationKeysToFetch.Add("EventLicenseTrialRequest");
TranslationKeysToFetch.Add("EventServerStateChange");
TranslationKeysToFetch.Add("EventSeedDatabase");
TranslationKeysToFetch.Add("EventAttachmentModified");
TranslationKeysToFetch.Add("AdminEraseDatabase");
TranslationKeysToFetch.Add("EventResetSerial");
TranslationKeysToFetch.Add("EventUtilityFileDownload");
var LT = TranslationBiz.GetSubsetStaticAsync(TranslationKeysToFetch, TranslationId).Result;
ReturnList.Add(new NameIdItem() { Name = LT["EventDeleted"], Id = (long)AyaEvent.Deleted });
ReturnList.Add(new NameIdItem() { Name = LT["EventCreated"], Id = (long)AyaEvent.Created });
ReturnList.Add(new NameIdItem() { Name = LT["EventRetrieved"], Id = (long)AyaEvent.Retrieved });
ReturnList.Add(new NameIdItem() { Name = LT["EventModified"], Id = (long)AyaEvent.Modified });
ReturnList.Add(new NameIdItem() { Name = LT["EventAttachmentCreate"], Id = (long)AyaEvent.AttachmentCreate });
ReturnList.Add(new NameIdItem() { Name = LT["EventAttachmentDelete"], Id = (long)AyaEvent.AttachmentDelete });
ReturnList.Add(new NameIdItem() { Name = LT["EventAttachmentDownload"], Id = (long)AyaEvent.AttachmentDownload });
ReturnList.Add(new NameIdItem() { Name = LT["EventLicenseFetch"], Id = (long)AyaEvent.LicenseFetch });
ReturnList.Add(new NameIdItem() { Name = LT["EventLicenseTrialRequest"], Id = (long)AyaEvent.LicenseTrialRequest });
ReturnList.Add(new NameIdItem() { Name = LT["EventServerStateChange"], Id = (long)AyaEvent.ServerStateChange });
ReturnList.Add(new NameIdItem() { Name = LT["EventSeedDatabase"], Id = (long)AyaEvent.SeedDatabase });
ReturnList.Add(new NameIdItem() { Name = LT["EventAttachmentModified"], Id = (long)AyaEvent.AttachmentModified });
ReturnList.Add(new NameIdItem() { Name = LT["AdminEraseDatabase"], Id = (long)AyaEvent.EraseAllData });
ReturnList.Add(new NameIdItem() { Name = LT["EventResetSerial"], Id = (long)AyaEvent.ResetSerial });
ReturnList.Add(new NameIdItem() { Name = LT["EventUtilityFileDownload"], Id = (long)AyaEvent.UtilityFileDownload });
}
else if (keyNameInLowerCase == StringUtil.TrimTypeName(typeof(AuthorizationRoles).ToString()).ToLowerInvariant())
{
// TranslationKeysToFetch.Add("AuthorizationRoleNoRole");
// TranslationKeysToFetch.Add("AuthorizationRoleNoRole");
TranslationKeysToFetch.Add("AuthorizationRoleBizAdminLimited");
TranslationKeysToFetch.Add("AuthorizationRoleBizAdminFull");
TranslationKeysToFetch.Add("AuthorizationRoleDispatchLimited");
@@ -169,10 +204,10 @@ namespace AyaNova.Api.Controllers
TranslationKeysToFetch.Add("AuthorizationRoleOpsAdminFull");
TranslationKeysToFetch.Add("AuthorizationRoleSalesLimited");
TranslationKeysToFetch.Add("AuthorizationRoleSalesFull");
// TranslationKeysToFetch.Add("AuthorizationRoleAll");
// TranslationKeysToFetch.Add("AuthorizationRoleAll");
var LT = TranslationBiz.GetSubsetStaticAsync(TranslationKeysToFetch, TranslationId).Result;
// ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleNoRole"], Id = (long)AuthorizationRoles.NoRole });
// ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleNoRole"], Id = (long)AuthorizationRoles.NoRole });
ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleBizAdminLimited"], Id = (long)AuthorizationRoles.BizAdminLimited });
ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleBizAdminFull"], Id = (long)AuthorizationRoles.BizAdminFull });
ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleDispatchLimited"], Id = (long)AuthorizationRoles.DispatchLimited });
@@ -190,7 +225,7 @@ namespace AyaNova.Api.Controllers
ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleOpsAdminFull"], Id = (long)AuthorizationRoles.OpsAdminFull });
ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleSalesLimited"], Id = (long)AuthorizationRoles.SalesLimited });
ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleSalesFull"], Id = (long)AuthorizationRoles.SalesFull });
// ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleAll"], Id = (long)AuthorizationRoles.All });
// ReturnList.Add(new NameIdItem() { Name = LT["AuthorizationRoleAll"], Id = (long)AuthorizationRoles.All });
}
else