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.cs17
1 files changed, 7 insertions, 10 deletions
diff --git a/DSACore/Controllers/CommandsController.cs b/DSACore/Controllers/CommandsController.cs
index 5f27f63..b6e0be2 100644
--- a/DSACore/Controllers/CommandsController.cs
+++ b/DSACore/Controllers/CommandsController.cs
@@ -1,23 +1,21 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using DSACore.Models;
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
{
- [Route("api/[controller]")]
+ [Route("dsa/[controller]")]
public class CommandsController : Controller
{
// GET: api/<controller>
[HttpGet]
public string Get()
{
- return "Dies ist die supa dolle Web Api";
+ return "Usage: post the command to execute";
}
// GET api/<controller>/5
@@ -29,17 +27,16 @@ namespace DSACore.Controllers
// POST api/<controller>/Felis
[HttpPost]
- public string Post([FromBody]Command cmd)
+ public string Post([FromBody] Command cmd)
{
try
{
- return Commands.CommandHandler.ExecuteCommand(cmd).message;
+ return CommandHandler.ExecuteCommand(cmd).message;
}
catch (Exception e)
{
return $"Ein Fehler ist aufgetreten: \n {e.Message}";
}
-
}
/*
@@ -56,4 +53,4 @@ namespace DSACore.Controllers
{
}*/
}
-}
+} \ No newline at end of file