summaryrefslogtreecommitdiff
path: root/DSACore/Controllers/TokensController.cs
diff options
context:
space:
mode:
authornatrixaeria <janng@gmx.de>2019-05-17 21:02:08 +0200
committernatrixaeria <janng@gmx.de>2019-05-17 21:02:08 +0200
commitbc74dde4dd7cf40216de4f0aae9a1b9ddf5e044b (patch)
treec1c7f759645417989f15f9716efbf68a8f1d3a6d /DSACore/Controllers/TokensController.cs
parent921d023a7652be5b1232ac41aeb2646b5f83ceb5 (diff)
parentaad1d69b5e2bb0c82f657f7693462fd95a91fb9f (diff)
Merge branch 'scribble' of https://github.com/TrueDoctor/DiscoBot into scribble
Diffstat (limited to 'DSACore/Controllers/TokensController.cs')
-rw-r--r--DSACore/Controllers/TokensController.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/DSACore/Controllers/TokensController.cs b/DSACore/Controllers/TokensController.cs
new file mode 100644
index 0000000..453d477
--- /dev/null
+++ b/DSACore/Controllers/TokensController.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace DSACore.Controllers
+{
+ [Route("lobby/[controller]")]
+ [ApiController]
+ public class TokensController : Controller
+ {
+
+ // GET
+ [HttpGet("{token}")]
+ public async Task<ActionResult<string>> Get(int token)
+ {
+
+ if (!Hubs.Users.Tokens.Exists(x => x.GetHashCode() == token))
+ {
+ return NotFound();
+ }
+
+ var group = Hubs.Users.Tokens.Find(x => x.GetHashCode() == token);
+ return Ok(group);
+ }
+ }
+} \ No newline at end of file