This commit is contained in:
@@ -29,14 +29,25 @@ namespace rockfishCore.Controllers
|
||||
|
||||
//### CUSTOMER ROUTE CALLED FROM RAVEN ####
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> PostLicenseFetchRequest([FromBody] dtoFetchRequest fetchRequest)
|
||||
public async Task<IActionResult> PostLicenseFetchRequest([FromBody] dtoFetchRequest fetchRequest, [FromQuery] bool dtt)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
string FetchRequestDbId=fetchRequest.DbId;
|
||||
string FetchRequestDbId = fetchRequest.DbId;
|
||||
|
||||
if (dtt)
|
||||
{
|
||||
return Ok(new
|
||||
{
|
||||
data = new
|
||||
{
|
||||
key = RavenKeyFactory.GetRavenTestKey(FetchRequestDbId)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
string LicenseKey = null;
|
||||
//check for a key for this dbid, first check licensed then check trial
|
||||
|
||||
@@ -460,6 +460,22 @@ oArP0E2Vbow3JMxq/oeXmHbrLMLQfYyXwFmciLFigOtkd45bfHdrbA==
|
||||
|
||||
|
||||
|
||||
public static string GetRavenTestKey(string dbid)
|
||||
{
|
||||
|
||||
//Build a sample test key, sign it and return it
|
||||
AyaNovaLicenseKey k = new AyaNovaLicenseKey();
|
||||
k.LicenseFormat = "8";
|
||||
k.RegisteredTo = "GZ TestCo Inc.";
|
||||
k.DbId = dbid;
|
||||
k.Features.Add(new LicenseFeature() { Feature = ACCOUNTING_FEATURE_NAME, Count = 0 });
|
||||
k.Features.Add(new LicenseFeature() { Feature = SERVICE_TECHS_FEATURE_NAME, Count = 1000 });
|
||||
k.MaintenanceExpiration = k.LicenseExpiration = DateTime.UtcNow.AddMonths(1);
|
||||
k.Features.Add(new LicenseFeature() { Feature = TRIAL_FEATURE_NAME, Count = 0 });
|
||||
k.Features.Add(new LicenseFeature() { Feature = RENTAL_FEATURE_NAME, Count = 0 });
|
||||
return GenerateRavenKey(k);
|
||||
}
|
||||
|
||||
//eoc
|
||||
}
|
||||
//eons
|
||||
@@ -472,39 +488,4 @@ oArP0E2Vbow3JMxq/oeXmHbrLMLQfYyXwFmciLFigOtkd45bfHdrbA==
|
||||
|
||||
|
||||
|
||||
// public static string GetRavenTestKey(Guid dbid)
|
||||
// {
|
||||
|
||||
// //Build a sample test key, sign it and return it
|
||||
// AyaNovaLicenseKey k = new AyaNovaLicenseKey();
|
||||
// k.LicenseFormat = "8";
|
||||
|
||||
// var vv = Math.Truncate((DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds);
|
||||
// string sId = vv.ToString();
|
||||
// if (sId.Contains(","))
|
||||
// sId = sId.Split('.')[0];
|
||||
// k.Id = $"00-{sId}";
|
||||
// k.RegisteredTo = "Best Besterson Inc.";
|
||||
// k.DbId = dbid;
|
||||
|
||||
// //add accounting and user features either way
|
||||
// k.Features.Add(new LicenseFeature() { Feature = ACCOUNTING_FEATURE_NAME, Count = 0 });
|
||||
// k.Features.Add(new LicenseFeature() { Feature = SERVICE_TECHS_FEATURE_NAME, Count = 1000 });
|
||||
|
||||
|
||||
// //fake trial key or fake licensed key
|
||||
// if (dbid == TEST_TRIAL_KEY_DBID)
|
||||
// {
|
||||
// k.MaintenanceExpiration = k.LicenseExpiration = DateTime.UtcNow.AddMonths(1);
|
||||
// k.Features.Add(new LicenseFeature() { Feature = TRIAL_FEATURE_NAME, Count = 0 });
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// k.MaintenanceExpiration = DateTime.UtcNow.AddYears(1);
|
||||
// k.LicenseExpiration = DateUtil.EmptyDateValue;//1/1/5555 as per spec
|
||||
// }
|
||||
|
||||
// return genKey(k);
|
||||
// }
|
||||
|
||||
// #endregion
|
||||
Reference in New Issue
Block a user