Na most működik az API + adatbázis
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using WorkFlowCheck.BL.DTO;
|
||||
using WorkFlowCheck.BL.Services.Interfaces;
|
||||
|
||||
namespace WorkFlowCheck.API.Controllers
|
||||
{
|
||||
@@ -8,15 +9,21 @@ namespace WorkFlowCheck.API.Controllers
|
||||
[ApiController]
|
||||
public class UserController : ControllerBase
|
||||
{
|
||||
private IUserService _userService;
|
||||
public UserController(IUserService userService)
|
||||
{
|
||||
_userService = userService;
|
||||
}
|
||||
[HttpGet]
|
||||
public async Task<ApiResponseDTO<UserDTO>> Get()
|
||||
{
|
||||
var userDTO = new UserDTO() { Id = 1, Email = "email", Name = "Name" };
|
||||
var userDTO = await _userService.GetUser(1);
|
||||
var retVal = new ApiResponseDTO<UserDTO>()
|
||||
{
|
||||
IsSuccess = true,
|
||||
Data = userDTO
|
||||
};
|
||||
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user