ソースを参照

Set base root for UserController

Feature
Safet Purkovic 4年前
コミット
d6ed83a8fd

バイナリ
.vs/BlackRock/v17/.suo ファイルの表示


バイナリ
BlackRock.Reporting.API/BlackRock.db-shm ファイルの表示


バイナリ
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

読み込み中…
キャンセル
保存