소스 검색

Set base root for UserController

Feature
Safet Purkovic 4 년 전
부모
커밋
d6ed83a8fd

BIN
.vs/BlackRock/v17/.suo 파일 보기


BIN
BlackRock.Reporting.API/BlackRock.db-shm 파일 보기


BIN
BlackRock.Reporting.API/BlackRock.db-wal 파일 보기


+ 5
- 9
BlackRock.Reporting.API/Controllers/UsersController.cs 파일 보기

@@ -1,5 +1,4 @@
using BlackRock.Reporting.API.Controllers.Model;
using BlackRock.Reporting.API.Jwt.Filters;
using BlackRock.Reporting.API.Mediator.UserMediator.Commands;
using BlackRock.Reporting.API.Mediator.UserMediator.Queries;
using MediatR;
@@ -8,9 +7,8 @@ using Microsoft.AspNetCore.Mvc;

namespace BlackRock.Reporting.API.Controllers
{
//[Route("api/users")]
[Authorize]
//[JwtAuthentication]
[Route("api/users")]
public class UsersController : Controller
{
private readonly IMediator mediator;
@@ -22,7 +20,7 @@ namespace BlackRock.Reporting.API.Controllers

// GET: api/users/1
[HttpGet]
[Route("api/users/{id}")]
[Route("{id}")]
public async Task<IActionResult> GetUser(int id)
{
var result = await mediator.Send(new GetUserQuery { Id = id });
@@ -36,7 +34,6 @@ namespace BlackRock.Reporting.API.Controllers
}
// GET: api/users?Page=2&PageSize=25
[HttpGet]
[Route("api/users")]
public async Task<IActionResult> GetAllUsers(GetAllUsersQuery query)
{
var result = await mediator.Send(query);
@@ -52,7 +49,6 @@ namespace BlackRock.Reporting.API.Controllers
}
// POST: api/users
[HttpPost]
[Route("api/users")]
public async Task<IActionResult> CreateUser([FromBody] CreateUserCommand user)
{
if (!ModelState.IsValid)
@@ -68,7 +64,7 @@ namespace BlackRock.Reporting.API.Controllers
}
// PUT: api/users/1
[HttpPut]
[Route("api/users/{id}")]
[Route("{id}")]
public async Task<IActionResult> UpdateUser(int id, [FromBody] UpdateUserCommand user)
{
if (!ModelState.IsValid)
@@ -82,7 +78,7 @@ namespace BlackRock.Reporting.API.Controllers
}
// PATCH: api/users/1/email
[HttpPatch]
[Route("api/users/{id}/email")]
[Route("{id}/email")]
public async Task<IActionResult> UpdateUserEmail(int id, [FromBody] UpdateUserEmailCommand user)
{
if (!ModelState.IsValid)
@@ -97,7 +93,7 @@ namespace BlackRock.Reporting.API.Controllers
}
// DELETE: api/users/1
[HttpDelete]
[Route("api/users/{id}")]
[Route("{id}")]
public async Task<IActionResult> DeleteUser(int id)
{
if (!ModelState.IsValid)

+ 0
- 1
BlackRock.Reporting.API/Program.cs 파일 보기

@@ -24,7 +24,6 @@ builder.Services.AddScoped<IUsersRepository, UsersRepository>();
builder.Services.AddScoped<IUnitOfWork, UnitOfWork>();
builder.Services.AddScoped<IJwtManager, JwtManager>();
builder.Services.AddScoped<IRefreshTokenManager, RefreshTokenManager>();
builder.Services.AddScoped<IAuthenticationMediator, AuthenticationMediator>();
builder.Services.AddCors();
builder.Services.AddControllers();
builder.Services.AddAutoMapper(typeof(Program));

+ 5
- 0
BlackRock.Reporting.API/obj/staticwebassets.pack.sentinel 파일 보기

@@ -132,3 +132,8 @@
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0

Loading…
취소
저장