This commit is contained in:
2018-08-24 17:15:15 +00:00
parent 33626df512
commit c51fc3a6e7
4 changed files with 25 additions and 18 deletions

View File

@@ -168,6 +168,10 @@ namespace AyaNova.Api.Controllers
{
//save and success return
await ct.SaveChangesAsync();
//Log
EventLogProcessor.AddEntry(new Event(biz.userId, o.Id, AyaType.Tag, AyaEvent.Created), ct);
return CreatedAtAction("GetTag", new { id = o.Id }, new ApiCreatedResponse(o));
}
}
@@ -236,6 +240,9 @@ namespace AyaNova.Api.Controllers
}
}
//Log
EventLogProcessor.AddEntry(new Event(biz.userId, oFromDb.Id, AyaType.Tag, AyaEvent.Modified), ct);
return Ok(new ApiOkResponse(new { ConcurrencyToken = oFromDb.ConcurrencyToken }));
}
@@ -301,6 +308,9 @@ namespace AyaNova.Api.Controllers
}
}
//Log
EventLogProcessor.AddEntry(new Event(biz.userId, oFromDb.Id, AyaType.Tag, AyaEvent.Modified), ct);
return Ok(new ApiOkResponse(new { ConcurrencyToken = oFromDb.ConcurrencyToken }));
}
@@ -346,6 +356,9 @@ namespace AyaNova.Api.Controllers
}
await ct.SaveChangesAsync();
//Log
EventLogProcessor.DeleteObject(biz.userId, AyaType.Tag, dbObj.Id, dbObj.Name, ct);
return NoContent();
}

View File

@@ -135,6 +135,9 @@ namespace AyaNova.Api.Controllers
{
//save and success return
await ct.SaveChangesAsync();
//BIZLOG: Not going to log this for now, it's too common an operation and would require bringing in more info. If decide to implement should log the parent object with text of tag instead
return CreatedAtAction("GetTagMap", new { id = o.Id }, new ApiCreatedResponse(o));
}
}
@@ -187,6 +190,8 @@ namespace AyaNova.Api.Controllers
await ct.SaveChangesAsync();
//BIZLOG: Not going to log this for now, it's too common an operation and would require bringing in more info. If decide to implement should log the parent object with text of tag instead
return NoContent();
}

View File

@@ -86,23 +86,7 @@ namespace AyaNova.Api.Controllers
JObject o = JObject.FromObject(new
{
seedLevel = seedLevel
// channel = new
// {
// title = "Star Wars",
// link = "http://www.starwars.com",
// description = "Star Wars blog.",
// item =
// from p in posts
// orderby p.Title
// select new
// {
// title = p.Title,
// description = p.Description,
// link = p.Link,
// category = p.Categories
// }
// }
seedLevel = seedLevel
});
OpsJob j = new OpsJob();
@@ -111,6 +95,10 @@ namespace AyaNova.Api.Controllers
j.Exclusive=true;//don't run other jobs, this will erase the db
j.JobInfo = o.ToString();
JobsBiz.AddJob(j, ct);
//Log
EventLogProcessor.AddEntry(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.TrialSeeder, AyaEvent.Created,size), ct);
return Accepted(new { JobId = j.GId });//202 accepted
}

View File

@@ -20,7 +20,8 @@ namespace AyaNova.Biz
AttachmentDownload=6,
LicenseFetch=7,
LicenseTrialRequest=8,
ServerStateChange=9
ServerStateChange=9,
SeedDatabase=10
}