blob: df226070363cb030540882581fda3b7ae5ea4ced (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
using System;
using DSACore.Commands;
using DSACore.Models.Network;
using Microsoft.AspNetCore.Mvc;
namespace DSACore.Controllers
{
public class ScribbleController : Controller
{
[Route("[controller]")]
// GET: api/<controller>
[HttpGet]
public string Get()
{
return "Usage: get /tokens/{Token}";
}
[HttpPost]
public string Post([FromBody] Command cmd)
{
try
{
return CommandHandler.ExecuteCommand(cmd).message;
}
catch (Exception e)
{
return $"Ein Fehler ist aufgetreten: \n {e.Message}";
}
}
}
}
|