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.Models; using MyCore.Services; namespace MyCore.Controllers { [Authorize(Roles = "Admin")] [Route("api/user")] [ApiController] public class UserController : ControllerBase { private readonly UserService _userService; public UserController(UserService userService) { _userService = userService; } // GET api/user /// /// Get a list of user /// [HttpGet] public ActionResult> Get() { //return new string[] { "value1", "value2" }; //return _userService.GetUsers(); return null; } // GET api/user/5 /// /// Get a specific user /// /// id user [HttpGet("{id}")] public ActionResult Get(string id) { UserInfo user = new UserInfo(); user.FirstName = "Thomas"; user.Id = "01"; return user; //return _userService.GetUser(id); } /* // 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 }*/ } }