diff options
author | natrixaeria <janng@gmx.de> | 2019-05-17 21:02:08 +0200 |
---|---|---|
committer | natrixaeria <janng@gmx.de> | 2019-05-17 21:02:08 +0200 |
commit | bc74dde4dd7cf40216de4f0aae9a1b9ddf5e044b (patch) | |
tree | c1c7f759645417989f15f9716efbf68a8f1d3a6d /DSACore/Controllers/TokensController.cs | |
parent | 921d023a7652be5b1232ac41aeb2646b5f83ceb5 (diff) | |
parent | aad1d69b5e2bb0c82f657f7693462fd95a91fb9f (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.cs | 28 |
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 |