This commit is contained in:
2020-05-21 21:24:26 +00:00
parent 0f99cf1f15
commit 19d8d05960
4 changed files with 13 additions and 13 deletions

View File

@@ -38,11 +38,11 @@ namespace AyaNova.Api.Controllers
}
/// <summary>
/// Get GlobalOpsSettings
/// Get GlobalOpsBackupSettings
/// </summary>
/// <returns>Global ops settings object</returns>
/// <returns>Global ops backup settings object</returns>
[HttpGet]
public async Task<IActionResult> GetGlobalOpsSettings()
public async Task<IActionResult> GetGlobalOpsBackupSettings()
{
if (serverState.IsClosed)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
@@ -65,12 +65,12 @@ namespace AyaNova.Api.Controllers
/// <summary>
/// POST (replace) Global biz settings
/// POST (replace) Global ops backup settings
/// </summary>
/// <param name="global"></param>
/// <returns>nothing</returns>
[HttpPost]
public async Task<IActionResult> ReplaceGlobalOpsSettings([FromBody] GlobalOpsBackupSettings global)
public async Task<IActionResult> ReplaceGlobalOpsBackupSettings([FromBody] GlobalOpsBackupSettings global)
{
if (serverState.IsClosed)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
@@ -92,11 +92,11 @@ namespace AyaNova.Api.Controllers
}
/// <summary>
/// Get Client app relevant GlobalOpsSettings
/// Get Client app relevant GlobalOpsBackupSettings
/// </summary>
/// <returns>Global settings object</returns>
/// <returns>Global ops backup settings object</returns>
[HttpGet("client")]
public async Task<ActionResult> GetClientGlobalOpsSettings()
public async Task<ActionResult> GetClientGlobalOpsBackupSettings()
{
//NOTE: currently this looks like a dupe of get above and it is
//but it's kept here in case want to return a subset of the settings only to client users

View File

@@ -38,7 +38,7 @@ namespace AyaNova.Biz
internal async Task<GlobalOpsBackupSettings> GetAsync(bool logTheGetEvent = true)
{
//first try to fetch from db
var ret = await ct.GlobalOpsSettings.SingleOrDefaultAsync(m => m.Id == 1);
var ret = await ct.GlobalOpsBackupSettings.SingleOrDefaultAsync(m => m.Id == 1);
if (logTheGetEvent && ret != null)
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, 1, BizType, AyaEvent.Retrieved), ct);
@@ -60,7 +60,7 @@ namespace AyaNova.Biz
//put
internal async Task<bool> ReplaceAsync(GlobalOpsBackupSettings putObject)
{
var dbObject = await ct.GlobalOpsSettings.FirstOrDefaultAsync(m => m.Id == 1);
var dbObject = await ct.GlobalOpsBackupSettings.FirstOrDefaultAsync(m => m.Id == 1);
if (dbObject == null)
throw new System.Exception("GlobalOpsSettingsBiz::ReplaceAsync -> Global settings object not found in database!!");

View File

@@ -9,7 +9,7 @@ namespace AyaNova.Models
public virtual DbSet<UserOptions> UserOptions { get; set; }
public virtual DbSet<Widget> Widget { get; set; }
public virtual DbSet<GlobalBizSettings> GlobalBizSettings { get; set; }
public virtual DbSet<GlobalOpsBackupSettings> GlobalOpsSettings { get; set; }
public virtual DbSet<GlobalOpsBackupSettings> GlobalOpsBackupSettings { get; set; }
public virtual DbSet<Event> Event { get; set; }
public virtual DbSet<SearchDictionary> SearchDictionary { get; set; }
public virtual DbSet<SearchKey> SearchKey { get; set; }

View File

@@ -21,11 +21,11 @@ namespace AyaNova.Util
internal static void Initialize(AyContext ct = null)
{
//fetch or create as not provided (meaning this was called from Startup.cs)
Backup = ct.GlobalOpsSettings.FirstOrDefault(z => z.Id == 1);
Backup = ct.GlobalOpsBackupSettings.FirstOrDefault(z => z.Id == 1);
if (Backup == null)
{
Backup = new GlobalOpsBackupSettings();
ct.GlobalOpsSettings.Add(Backup);
ct.GlobalOpsBackupSettings.Add(Backup);
ct.SaveChanges();
}
}