summaryrefslogtreecommitdiff
path: root/DSACore/Controllers/CommandsController.cs
diff options
context:
space:
mode:
Diffstat (limited to 'DSACore/Controllers/CommandsController.cs')
-rw-r--r--DSACore/Controllers/CommandsController.cs19
1 files changed, 6 insertions, 13 deletions
diff --git a/DSACore/Controllers/CommandsController.cs b/DSACore/Controllers/CommandsController.cs
index b6e0be2..2edbbaf 100644
--- a/DSACore/Controllers/CommandsController.cs
+++ b/DSACore/Controllers/CommandsController.cs
@@ -1,20 +1,16 @@
using System;
-using DSACore.Models.Network;
using DSALib.Commands;
using DSALib.Models.Network;
using Microsoft.AspNetCore.Mvc;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
-namespace DSACore.Controllers
-{
+namespace DSACore.Controllers {
[Route("dsa/[controller]")]
- public class CommandsController : Controller
- {
+ public class CommandsController : Controller {
// GET: api/<controller>
[HttpGet]
- public string Get()
- {
+ public string Get() {
return "Usage: post the command to execute";
}
@@ -27,14 +23,11 @@ namespace DSACore.Controllers
// POST api/<controller>/Felis
[HttpPost]
- public string Post([FromBody] Command cmd)
- {
- try
- {
+ public string Post([FromBody] Command cmd) {
+ try {
return CommandHandler.ExecuteCommand(cmd).message;
}
- catch (Exception e)
- {
+ catch (Exception e) {
return $"Ein Fehler ist aufgetreten: \n {e.Message}";
}
}