This commit is contained in:
2020-04-28 15:14:02 +00:00
parent 65e5d6ed2f
commit 8d4af9bc4e
2 changed files with 57 additions and 1 deletions

View File

@@ -99,7 +99,40 @@ namespace AyaNova.Api.Controllers
}
/// <summary>
/// V7 Import replace log entry
/// (internal use only)
/// </summary>
/// <param name="inObj"></param>
/// <param name="apiVersion">Automatically filled from route path, no need to specify in body</param>
/// <returns></returns>
[ApiExplorerSettings(IgnoreApi = true)]
[HttpPost]
public async Task<IActionResult> PostV7Modify([FromBody] V7Event inObj, ApiVersion apiVersion)
{
if (!serverState.IsOpen)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
//Only biz admin full users can do this
if (!Authorized.HasAnyRole(HttpContext.Items, AuthorizationRoles.BizAdminFull))
return StatusCode(403, new ApiNotAuthorizedResponse());
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));
await EventLogProcessor.V7_Modify_LogAsync(inObj, ct);
return NoContent();
}
public sealed class V7Event
{
public AyaType AyType { get; set; }
public long AyId { get; set; }
public long Creator { get; set; }
public long Modifier { get; set; }
public DateTime Created { get; set; }
public DateTime Modified { get; set; }
}
//------------