This commit is contained in:
2020-06-11 20:15:01 +00:00
parent 0b9e93e338
commit 9b467d9152
2 changed files with 61 additions and 35 deletions

View File

@@ -1,10 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.EntityFrameworkCore;
using rockfishCore.Models;
using rockfishCore.Util;
@@ -25,8 +22,7 @@ namespace rockfishCore.Controllers
[HttpGet("{dbid}")]
public async Task<IActionResult> Get([FromRoute] Guid dbid)
{
//this is called after a successful check says there is a key below so it's not hammered (in theory)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
@@ -81,32 +77,32 @@ namespace rockfishCore.Controllers
}
[HttpGet("hello/{dbid}")]
public ActionResult Hello([FromRoute] Guid dbid)
{
//check to see if there is anything of note for this server like a new key or a message etc
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
// [HttpGet("hello/{dbid}")]
// public ActionResult Hello([FromRoute] Guid dbid)
// {
// //check to see if there is anything of note for this server like a new key or a message etc
// if (!ModelState.IsValid)
// {
// return BadRequest(ModelState);
// }
//return a json object with results if anything to report
// //return a json object with results if anything to report
//This is to simulate the scenarios where there is no license to return
//either due to no current account / canceled or simply no license exists
//Changes here must be reflected in RAVEN Util.License.Fetch block
bool bTestStatusOtherThanOk = false;
if (bTestStatusOtherThanOk)
{
return Json(new { Status = "NONE", Reason = "No license" });
//return Json(new {Status="Canceled", Reason="Non payment"});
}
else
{
return Ok(RavenKeyFactory.GetRavenTestKey(dbid));
}
// //This is to simulate the scenarios where there is no license to return
// //either due to no current account / canceled or simply no license exists
// //Changes here must be reflected in RAVEN Util.License.Fetch block
// bool bTestStatusOtherThanOk = false;
// if (bTestStatusOtherThanOk)
// {
// return Json(new { Status = "NONE", Reason = "No license" });
// //return Json(new {Status="Canceled", Reason="Non payment"});
// }
// else
// {
// return Ok(RavenKeyFactory.GetRavenTestKey(dbid));
// }
}
// }