Skip to content
Snippets Groups Projects

Re #9677

Merged Dominik Poch requested to merge features/9677-sentiment-annotation into dev
19 files
+ 1439
158
Compare changes
  • Side-by-side
  • Inline
Files
19
@@ -196,5 +196,31 @@ namespace RestAPI.Controllers
}
[HttpPut("/annotation/{annotationId}/{instanceId}/sentiment")]
[ProducesResponseType((int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.Forbidden)]
public ActionResult SetTagInstanceSentiment([FromServices] ClientInfo clientInfo, Guid annotationId, Guid instanceId, SetInstanceSentimentRequest request)
{
if (clientInfo.LoggedUser == null)
{
logger.Warning("ClientInfo has null LoggerUser in [Authorized] controller /annotations");
return Problem();
}
try
{
annotationService.SetTagInstanceSentiment(annotationId, instanceId, clientInfo.LoggedUser.Id, clientInfo.LoggedUser.Role, request.Sentiment);
return Ok();
}
catch (InvalidOperationException e)
{
throw new BadRequestException(e.Message);
}
catch (UnauthorizedAccessException)
{
return Forbid();
}
}
}
}
Loading