mycorerepository/MyCore/Controllers/ValuesController.cs
2020-12-16 21:35:51 +01:00

64 lines
1.8 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using MQTTnet;
using MQTTnet.Client;
using MQTTnet.Server;
using MyCore.Interfaces.Models;
using MyCore.Services;
using static MyCore.Services.OddService;
namespace MyCore.Controllers
{
[Authorize] // TODO Add ROLES (Roles = "Admin")
[Route("api/test")]
[ApiController]
public class ValuesController : ControllerBase
{
// GET api/values
/// <summary>
/// It's a test ! :)
/// </summary>
[AllowAnonymous]
[HttpGet]
public ActionResult<IEnumerable<string>> Get()
{
WidgetWeather widgetWeather = new WidgetWeather();
return new string[] { "value1", "value2" };
}
// GET api/values/5
[HttpGet("{id}")]
public ActionResult<string> Get(int id)
{
return "value";
}
// POST api/values
[HttpPost]
public void Post([FromBody] string value)
{
// For more information on protecting this API from Cross Site Request Forgery (CSRF) attacks, see https://go.microsoft.com/fwlink/?LinkID=717803
}
// PUT api/values/5
[HttpPut("{id}")]
public void Put(int id, [FromBody] string value)
{
// For more information on protecting this API from Cross Site Request Forgery (CSRF) attacks, see https://go.microsoft.com/fwlink/?LinkID=717803
}
// DELETE api/values/5
[HttpDelete("{id}")]
public void Delete(int id)
{
// For more information on protecting this API from Cross Site Request Forgery (CSRF) attacks, see https://go.microsoft.com/fwlink/?LinkID=717803
}
}
}