This commit is contained in:
2020-06-17 18:58:37 +00:00
parent fb586e0f5b
commit 305b61045d
6 changed files with 140 additions and 111 deletions

View File

@@ -8,6 +8,7 @@ using rockfishCore.Util;
namespace rockfishCore.Controllers
{
//### CUSTOMER ROUTE CALLED FROM RAVEN NO AUTH ####
[Produces("application/json")]
[Route("rvf")]
public class RvfController : Controller //RAVEN License fetch route
@@ -20,6 +21,7 @@ namespace rockfishCore.Controllers
}
//### CUSTOMER ROUTE CALLED FROM RAVEN ####
[HttpGet("{dbid}")]
public async Task<IActionResult> Get([FromRoute] Guid dbid)
{
@@ -63,46 +65,8 @@ namespace rockfishCore.Controllers
key = LicenseKey
}
});
}
// [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
// //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));
// }
// }
private bool LicenseExists(long id)
{
return ct.License.Any(e => e.Id == id);
}
}
}