Skip to content

Commit 3ca64be

Browse files
committed
Add .WebApp to the AdvancedTodoList namespace
1 parent 5f807f9 commit 3ca64be

15 files changed

+687
-687
lines changed

AdvancedTodoList.IntegrationTests/AdvancedTodoList.IntegrationTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</ItemGroup>
2222

2323
<ItemGroup>
24-
<ProjectReference Include="..\AdvancedTodoList\AdvancedTodoList.csproj" />
24+
<ProjectReference Include="..\AdvancedTodoList\AdvancedTodoList.WebApp.csproj" />
2525
</ItemGroup>
2626

2727
</Project>

AdvancedTodoList.UnitTests/AdvancedTodoList.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</ItemGroup>
2020

2121
<ItemGroup>
22-
<ProjectReference Include="..\AdvancedTodoList\AdvancedTodoList.csproj" />
22+
<ProjectReference Include="..\AdvancedTodoList\AdvancedTodoList.WebApp.csproj" />
2323
</ItemGroup>
2424

2525
</Project>

AdvancedTodoList.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.8.34330.188
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdvancedTodoList", "AdvancedTodoList\AdvancedTodoList.csproj", "{5A6E74CD-0DD8-4EDB-B01E-13F7B0A29013}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdvancedTodoList.WebApp", "AdvancedTodoList\AdvancedTodoList.WebApp.csproj", "{5A6E74CD-0DD8-4EDB-B01E-13F7B0A29013}"
77
EndProject
88
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdvancedTodoList.Core", "AdvancedTodoList.Core\AdvancedTodoList.Core.csproj", "{316DE5AB-84EC-46B3-82EE-A3F159750971}"
99
EndProject
File renamed without changes.

AdvancedTodoList/Controllers/AuthController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using AdvancedTodoList.Core.Dtos;
22
using AdvancedTodoList.Core.Services.Auth;
3-
using AdvancedTodoList.Extensions;
3+
using AdvancedTodoList.WebApp.Extensions;
44
using Microsoft.AspNetCore.Authorization;
55
using Microsoft.AspNetCore.Mvc;
66

7-
namespace AdvancedTodoList.Controllers;
7+
namespace AdvancedTodoList.WebApp.Controllers;
88

99
[ApiController]
1010
[Route("api/auth")]
Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,80 @@
11
using AdvancedTodoList.Core.Dtos;
22
using AdvancedTodoList.Core.Pagination;
33
using AdvancedTodoList.Core.Services;
4-
using AdvancedTodoList.Extensions;
4+
using AdvancedTodoList.WebApp.Extensions;
55
using Microsoft.AspNetCore.Authorization;
66
using Microsoft.AspNetCore.Mvc;
77

8-
namespace AdvancedTodoList.Controllers;
8+
namespace AdvancedTodoList.WebApp.Controllers;
99

1010
[Authorize]
1111
[ApiController]
1212
[Route("api/todo/{listId}/invitationLinks")]
1313
public class InvitationLinksController(IInvitationLinksService invitationLinksService) : ControllerBase
1414
{
15-
private readonly IInvitationLinksService _invitationLinksService = invitationLinksService;
15+
private readonly IInvitationLinksService _invitationLinksService = invitationLinksService;
1616

17-
/// <summary>
18-
/// Gets a page with invitation links of the to-do list with the specified ID.
19-
/// </summary>
20-
/// <param name="listId">ID of the to-do list.</param>
21-
/// <param name="paginationParameters">Paginations parameters to apply.</param>
22-
/// <response code="200">Returns invitation links of the to-do list.</response>
23-
/// <response code="401">Authentication failed.</response>
24-
/// <response code="403">User has no permission to perform this action.</response>
25-
/// <response code="404">To-do list was not found.</response>
26-
[HttpGet(Name = nameof(GetInvitationLinksAsync))]
27-
[ProducesResponseType(typeof(Page<InvitationLinkDto>), StatusCodes.Status200OK)]
28-
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
29-
[ProducesResponseType(StatusCodes.Status403Forbidden)]
30-
[ProducesResponseType(StatusCodes.Status404NotFound)]
31-
public async Task<IActionResult> GetInvitationLinksAsync(
32-
[FromRoute] string listId, [FromQuery] PaginationParameters paginationParameters)
33-
{
34-
TodoListContext context = new(listId, User.GetUserId()!);
35-
var result = await _invitationLinksService.GetInvitationLinksAsync(context, paginationParameters);
36-
return result.ToActionResult();
37-
}
17+
/// <summary>
18+
/// Gets a page with invitation links of the to-do list with the specified ID.
19+
/// </summary>
20+
/// <param name="listId">ID of the to-do list.</param>
21+
/// <param name="paginationParameters">Paginations parameters to apply.</param>
22+
/// <response code="200">Returns invitation links of the to-do list.</response>
23+
/// <response code="401">Authentication failed.</response>
24+
/// <response code="403">User has no permission to perform this action.</response>
25+
/// <response code="404">To-do list was not found.</response>
26+
[HttpGet(Name = nameof(GetInvitationLinksAsync))]
27+
[ProducesResponseType(typeof(Page<InvitationLinkDto>), StatusCodes.Status200OK)]
28+
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
29+
[ProducesResponseType(StatusCodes.Status403Forbidden)]
30+
[ProducesResponseType(StatusCodes.Status404NotFound)]
31+
public async Task<IActionResult> GetInvitationLinksAsync(
32+
[FromRoute] string listId, [FromQuery] PaginationParameters paginationParameters)
33+
{
34+
TodoListContext context = new(listId, User.GetUserId()!);
35+
var result = await _invitationLinksService.GetInvitationLinksAsync(context, paginationParameters);
36+
return result.ToActionResult();
37+
}
3838

39-
/// <summary>
40-
/// Creates a new to-do list invitation link.
41-
/// </summary>
42-
/// <param name="listId">ID of the to-do list which will contain the invitation link.</param>
43-
/// <response code="200">Successfully created.</response>
44-
/// <response code="400">Validation failed.</response>
45-
/// <response code="401">Authentication failed.</response>
46-
/// <response code="403">User has no permission to perform this action.</response>
47-
/// <response code="404">To-do list was not found.</response>
48-
[HttpPost]
49-
[ProducesResponseType(typeof(InvitationLinkDto), StatusCodes.Status200OK)]
50-
[ProducesResponseType(StatusCodes.Status400BadRequest)]
51-
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
52-
[ProducesResponseType(StatusCodes.Status403Forbidden)]
53-
[ProducesResponseType(StatusCodes.Status404NotFound)]
54-
public async Task<IActionResult> PostInvitationLinkAsync([FromRoute] string listId)
55-
{
56-
TodoListContext context = new(listId, User.GetUserId()!);
57-
var response = await _invitationLinksService.CreateAsync(context);
58-
return response.ToActionResult();
59-
}
39+
/// <summary>
40+
/// Creates a new to-do list invitation link.
41+
/// </summary>
42+
/// <param name="listId">ID of the to-do list which will contain the invitation link.</param>
43+
/// <response code="200">Successfully created.</response>
44+
/// <response code="400">Validation failed.</response>
45+
/// <response code="401">Authentication failed.</response>
46+
/// <response code="403">User has no permission to perform this action.</response>
47+
/// <response code="404">To-do list was not found.</response>
48+
[HttpPost]
49+
[ProducesResponseType(typeof(InvitationLinkDto), StatusCodes.Status200OK)]
50+
[ProducesResponseType(StatusCodes.Status400BadRequest)]
51+
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
52+
[ProducesResponseType(StatusCodes.Status403Forbidden)]
53+
[ProducesResponseType(StatusCodes.Status404NotFound)]
54+
public async Task<IActionResult> PostInvitationLinkAsync([FromRoute] string listId)
55+
{
56+
TodoListContext context = new(listId, User.GetUserId()!);
57+
var response = await _invitationLinksService.CreateAsync(context);
58+
return response.ToActionResult();
59+
}
6060

61-
/// <summary>
62-
/// Deletes a to-do list invitation link.
63-
/// </summary>
64-
/// <response code="204">Success.</response>
65-
/// <response code="401">Authentication failed.</response>
66-
/// <response code="403">User has no permission to perform this action.</response>
67-
/// <response code="404">To-do list invitation link was not found.</response>
68-
[HttpDelete("{invitationLinkId}")]
69-
[ProducesResponseType(StatusCodes.Status204NoContent)]
70-
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
71-
[ProducesResponseType(StatusCodes.Status403Forbidden)]
72-
[ProducesResponseType(StatusCodes.Status404NotFound)]
73-
public async Task<IActionResult> DeleteInvitationLinkAsync(
74-
[FromRoute] string listId, [FromRoute] int invitationLinkId)
75-
{
76-
TodoListContext context = new(listId, User.GetUserId()!);
77-
var result = await _invitationLinksService.DeleteAsync(context, invitationLinkId);
78-
return result.ToActionResult();
79-
}
61+
/// <summary>
62+
/// Deletes a to-do list invitation link.
63+
/// </summary>
64+
/// <response code="204">Success.</response>
65+
/// <response code="401">Authentication failed.</response>
66+
/// <response code="403">User has no permission to perform this action.</response>
67+
/// <response code="404">To-do list invitation link was not found.</response>
68+
[HttpDelete("{invitationLinkId}")]
69+
[ProducesResponseType(StatusCodes.Status204NoContent)]
70+
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
71+
[ProducesResponseType(StatusCodes.Status403Forbidden)]
72+
[ProducesResponseType(StatusCodes.Status404NotFound)]
73+
public async Task<IActionResult> DeleteInvitationLinkAsync(
74+
[FromRoute] string listId, [FromRoute] int invitationLinkId)
75+
{
76+
TodoListContext context = new(listId, User.GetUserId()!);
77+
var result = await _invitationLinksService.DeleteAsync(context, invitationLinkId);
78+
return result.ToActionResult();
79+
}
8080
}

AdvancedTodoList/Controllers/JoinTodoListController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using AdvancedTodoList.Core.Dtos;
22
using AdvancedTodoList.Core.Services;
3-
using AdvancedTodoList.Extensions;
3+
using AdvancedTodoList.WebApp.Extensions;
44
using Microsoft.AspNetCore.Authorization;
55
using Microsoft.AspNetCore.Mvc;
66

7-
namespace AdvancedTodoList.Controllers;
7+
namespace AdvancedTodoList.WebApp.Controllers;
88

99
[Authorize]
1010
[ApiController]

0 commit comments

Comments
 (0)