Yuyuqt commited on
Commit
f53877e
·
1 Parent(s): 87c9973

add feat: swagger

Browse files
Files changed (28) hide show
  1. LibraryManagement.Backend/Features/Books/BookController.cs +5 -5
  2. LibraryManagement.Backend/Features/Borrowing/BorrowingController.cs +4 -4
  3. LibraryManagement.Backend/Features/Categories/CategoryController.cs +3 -3
  4. LibraryManagement.Backend/Features/Subscriptions/SubscriptionController.cs +2 -2
  5. LibraryManagement.Backend/Features/Users/UserController.cs +5 -5
  6. LibraryManagement.Backend/Program.cs +1 -3
  7. LibraryManagement.Backend/Properties/launchSettings.json +1 -1
  8. LibraryManagement.Frontend/Components/App.razor +0 -20
  9. LibraryManagement.Frontend/Components/Layout/MainLayout.razor +0 -23
  10. LibraryManagement.Frontend/Components/Layout/MainLayout.razor.css +0 -96
  11. LibraryManagement.Frontend/Components/Layout/NavMenu.razor +0 -30
  12. LibraryManagement.Frontend/Components/Layout/NavMenu.razor.css +0 -105
  13. LibraryManagement.Frontend/Components/Pages/Counter.razor +0 -19
  14. LibraryManagement.Frontend/Components/Pages/Error.razor +0 -36
  15. LibraryManagement.Frontend/Components/Pages/Home.razor +0 -7
  16. LibraryManagement.Frontend/Components/Pages/Weather.razor +0 -64
  17. LibraryManagement.Frontend/Components/Routes.razor +0 -6
  18. LibraryManagement.Frontend/Components/_Imports.razor +0 -10
  19. LibraryManagement.Frontend/LibraryManagement.Frontend.csproj +0 -9
  20. LibraryManagement.Frontend/Program.cs +0 -27
  21. LibraryManagement.Frontend/Properties/launchSettings.json +0 -38
  22. LibraryManagement.Frontend/appsettings.Development.json +0 -8
  23. LibraryManagement.Frontend/appsettings.json +0 -9
  24. LibraryManagement.Frontend/wwwroot/app.css +0 -51
  25. LibraryManagement.Frontend/wwwroot/bootstrap/bootstrap.min.css +0 -0
  26. LibraryManagement.Frontend/wwwroot/bootstrap/bootstrap.min.css.map +0 -0
  27. LibraryManagement.Frontend/wwwroot/favicon.png +0 -0
  28. LibraryManagement.slnx +0 -1
LibraryManagement.Backend/Features/Books/BookController.cs CHANGED
@@ -15,7 +15,7 @@ namespace LibraryManagement.Backend.Features.Books
15
  }
16
 
17
  [HttpGet]
18
- [Authorize]
19
  public async Task<ActionResult<IEnumerable<BookDto>>> GetBooks()
20
  {
21
  var books = await _bookService.GetAllBooksAsync();
@@ -23,7 +23,7 @@ namespace LibraryManagement.Backend.Features.Books
23
  }
24
 
25
  [HttpGet("{id}")]
26
- [Authorize]
27
  public async Task<ActionResult<BookDto>> GetBook(int id)
28
  {
29
  var book = await _bookService.GetBookByIdAsync(id);
@@ -32,7 +32,7 @@ namespace LibraryManagement.Backend.Features.Books
32
  }
33
 
34
  [HttpPost]
35
- [Authorize(Roles = "Librarian")]
36
  public async Task<ActionResult<BookDto>> CreateBook([FromBody] BookCreateRequest request)
37
  {
38
  try
@@ -47,7 +47,7 @@ namespace LibraryManagement.Backend.Features.Books
47
  }
48
 
49
  [HttpPut("{id}")]
50
- [Authorize(Roles = "Librarian")]
51
  public async Task<ActionResult<BookDto>> UpdateBook(int id, [FromBody] BookUpdateRequest request)
52
  {
53
  var updatedBook = await _bookService.UpdateBookAsync(id, request);
@@ -56,7 +56,7 @@ namespace LibraryManagement.Backend.Features.Books
56
  }
57
 
58
  [HttpDelete("{id}")]
59
- [Authorize(Roles = "Librarian")]
60
  public async Task<IActionResult> DeleteBook(int id)
61
  {
62
  var success = await _bookService.DeleteBookAsync(id);
 
15
  }
16
 
17
  [HttpGet]
18
+ //[Authorize]
19
  public async Task<ActionResult<IEnumerable<BookDto>>> GetBooks()
20
  {
21
  var books = await _bookService.GetAllBooksAsync();
 
23
  }
24
 
25
  [HttpGet("{id}")]
26
+ //[Authorize]
27
  public async Task<ActionResult<BookDto>> GetBook(int id)
28
  {
29
  var book = await _bookService.GetBookByIdAsync(id);
 
32
  }
33
 
34
  [HttpPost]
35
+ //[Authorize(Roles = "Librarian")]
36
  public async Task<ActionResult<BookDto>> CreateBook([FromBody] BookCreateRequest request)
37
  {
38
  try
 
47
  }
48
 
49
  [HttpPut("{id}")]
50
+ //[Authorize(Roles = "Librarian")]
51
  public async Task<ActionResult<BookDto>> UpdateBook(int id, [FromBody] BookUpdateRequest request)
52
  {
53
  var updatedBook = await _bookService.UpdateBookAsync(id, request);
 
56
  }
57
 
58
  [HttpDelete("{id}")]
59
+ //[Authorize(Roles = "Librarian")]
60
  public async Task<IActionResult> DeleteBook(int id)
61
  {
62
  var success = await _bookService.DeleteBookAsync(id);
LibraryManagement.Backend/Features/Borrowing/BorrowingController.cs CHANGED
@@ -16,7 +16,7 @@ namespace LibraryManagement.Backend.Features.Borrowings
16
  }
17
 
18
  [HttpPost("borrow")]
19
- [Authorize]
20
  public async Task<ActionResult<BorrowingDto>> BorrowBook([FromBody] BorrowRequest request)
21
  {
22
  try
@@ -35,7 +35,7 @@ namespace LibraryManagement.Backend.Features.Borrowings
35
  }
36
 
37
  [HttpPost("return/{id}")]
38
- [Authorize(Roles = "Librarian")]
39
  public async Task<ActionResult<BorrowingDto>> ReturnBook(int id)
40
  {
41
  try
@@ -50,7 +50,7 @@ namespace LibraryManagement.Backend.Features.Borrowings
50
  }
51
 
52
  [HttpGet("me")]
53
- [Authorize]
54
  public async Task<ActionResult<IEnumerable<BorrowingDto>>> GetMyBorrowings()
55
  {
56
  var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
@@ -62,7 +62,7 @@ namespace LibraryManagement.Backend.Features.Borrowings
62
  }
63
 
64
  [HttpGet]
65
- [Authorize(Roles = "Librarian")]
66
  public async Task<ActionResult<IEnumerable<BorrowingDto>>> GetAllBorrowings()
67
  {
68
  var borrowings = await _borrowingService.GetAllBorrowingsAsync();
 
16
  }
17
 
18
  [HttpPost("borrow")]
19
+ //[Authorize]
20
  public async Task<ActionResult<BorrowingDto>> BorrowBook([FromBody] BorrowRequest request)
21
  {
22
  try
 
35
  }
36
 
37
  [HttpPost("return/{id}")]
38
+ //[Authorize(Roles = "Librarian")]
39
  public async Task<ActionResult<BorrowingDto>> ReturnBook(int id)
40
  {
41
  try
 
50
  }
51
 
52
  [HttpGet("me")]
53
+ //[Authorize]
54
  public async Task<ActionResult<IEnumerable<BorrowingDto>>> GetMyBorrowings()
55
  {
56
  var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
 
62
  }
63
 
64
  [HttpGet]
65
+ //[Authorize(Roles = "Librarian")]
66
  public async Task<ActionResult<IEnumerable<BorrowingDto>>> GetAllBorrowings()
67
  {
68
  var borrowings = await _borrowingService.GetAllBorrowingsAsync();
LibraryManagement.Backend/Features/Categories/CategoryController.cs CHANGED
@@ -15,7 +15,7 @@ namespace LibraryManagement.Backend.Features.Categories
15
  }
16
 
17
  [HttpGet]
18
- [Authorize] // Accessible by both Librarian and Member
19
  public async Task<ActionResult<IEnumerable<CategoryDto>>> GetCategories()
20
  {
21
  var categories = await _categoryService.GetAllCategoriesAsync();
@@ -23,7 +23,7 @@ namespace LibraryManagement.Backend.Features.Categories
23
  }
24
 
25
  [HttpPost]
26
- [Authorize(Roles = "Librarian")]
27
  public async Task<ActionResult<CategoryDto>> CreateCategory([FromBody] CategoryCreateRequest request)
28
  {
29
  try
@@ -38,7 +38,7 @@ namespace LibraryManagement.Backend.Features.Categories
38
  }
39
 
40
  [HttpDelete("{id}")]
41
- [Authorize(Roles = "Librarian")]
42
  public async Task<IActionResult> DeleteCategory(int id)
43
  {
44
  var success = await _categoryService.DeleteCategoryAsync(id);
 
15
  }
16
 
17
  [HttpGet]
18
+ //[Authorize] // Accessible by both Librarian and Member
19
  public async Task<ActionResult<IEnumerable<CategoryDto>>> GetCategories()
20
  {
21
  var categories = await _categoryService.GetAllCategoriesAsync();
 
23
  }
24
 
25
  [HttpPost]
26
+ //[Authorize(Roles = "Librarian")]
27
  public async Task<ActionResult<CategoryDto>> CreateCategory([FromBody] CategoryCreateRequest request)
28
  {
29
  try
 
38
  }
39
 
40
  [HttpDelete("{id}")]
41
+ //[Authorize(Roles = "Librarian")]
42
  public async Task<IActionResult> DeleteCategory(int id)
43
  {
44
  var success = await _categoryService.DeleteCategoryAsync(id);
LibraryManagement.Backend/Features/Subscriptions/SubscriptionController.cs CHANGED
@@ -23,7 +23,7 @@ namespace LibraryManagement.Backend.Features.Subscriptions
23
  }
24
 
25
  [HttpGet("subscriptions/me")]
26
- [Authorize]
27
  public async Task<ActionResult<SubscriptionDto>> GetMySubscription()
28
  {
29
  var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
@@ -38,7 +38,7 @@ namespace LibraryManagement.Backend.Features.Subscriptions
38
  }
39
 
40
  [HttpPost("subscriptions/subscribe")]
41
- [Authorize]
42
  public async Task<ActionResult<SubscriptionDto>> Subscribe([FromBody] SubscribeRequest request)
43
  {
44
  try
 
23
  }
24
 
25
  [HttpGet("subscriptions/me")]
26
+ //[Authorize]
27
  public async Task<ActionResult<SubscriptionDto>> GetMySubscription()
28
  {
29
  var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
 
38
  }
39
 
40
  [HttpPost("subscriptions/subscribe")]
41
+ //[Authorize]
42
  public async Task<ActionResult<SubscriptionDto>> Subscribe([FromBody] SubscribeRequest request)
43
  {
44
  try
LibraryManagement.Backend/Features/Users/UserController.cs CHANGED
@@ -15,7 +15,7 @@ namespace LibraryManagement.Backend.Features.Users
15
  }
16
 
17
  [HttpGet]
18
- [Authorize(Roles = "Librarian")]
19
  public async Task<ActionResult<IEnumerable<UserDto>>> GetUsers()
20
  {
21
  var users = await _userService.GetAllUsersAsync();
@@ -23,7 +23,7 @@ namespace LibraryManagement.Backend.Features.Users
23
  }
24
 
25
  [HttpGet("{id}")]
26
- [Authorize(Roles = "Librarian")]
27
  public async Task<ActionResult<UserDto>> GetUser(int id)
28
  {
29
  var user = await _userService.GetUserByIdAsync(id);
@@ -47,7 +47,7 @@ namespace LibraryManagement.Backend.Features.Users
47
  }
48
 
49
  [HttpPut("{id}")]
50
- [Authorize(Roles = "Librarian")]
51
  public async Task<ActionResult<UserDto>> UpdateUser(int id, [FromBody] UserUpdateRequest request)
52
  {
53
  var updatedUser = await _userService.UpdateUserAsync(id, request);
@@ -56,7 +56,7 @@ namespace LibraryManagement.Backend.Features.Users
56
  }
57
 
58
  [HttpPatch("{id}/role")]
59
- [Authorize(Roles = "Librarian")]
60
  public async Task<IActionResult> UpdateUserRole(int id, [FromBody] UserRoleUpdateRequest request)
61
  {
62
  var success = await _userService.UpdateUserRoleAsync(id, request.Role);
@@ -65,7 +65,7 @@ namespace LibraryManagement.Backend.Features.Users
65
  }
66
 
67
  [HttpDelete("{id}")]
68
- [Authorize(Roles = "Librarian")]
69
  public async Task<IActionResult> DeleteUser(int id)
70
  {
71
  var success = await _userService.DeleteUserAsync(id);
 
15
  }
16
 
17
  [HttpGet]
18
+ //[Authorize(Roles = "Librarian")]
19
  public async Task<ActionResult<IEnumerable<UserDto>>> GetUsers()
20
  {
21
  var users = await _userService.GetAllUsersAsync();
 
23
  }
24
 
25
  [HttpGet("{id}")]
26
+ //[Authorize(Roles = "Librarian")]
27
  public async Task<ActionResult<UserDto>> GetUser(int id)
28
  {
29
  var user = await _userService.GetUserByIdAsync(id);
 
47
  }
48
 
49
  [HttpPut("{id}")]
50
+ //[Authorize(Roles = "Librarian")]
51
  public async Task<ActionResult<UserDto>> UpdateUser(int id, [FromBody] UserUpdateRequest request)
52
  {
53
  var updatedUser = await _userService.UpdateUserAsync(id, request);
 
56
  }
57
 
58
  [HttpPatch("{id}/role")]
59
+ //[Authorize(Roles = "Librarian")]
60
  public async Task<IActionResult> UpdateUserRole(int id, [FromBody] UserRoleUpdateRequest request)
61
  {
62
  var success = await _userService.UpdateUserRoleAsync(id, request.Role);
 
65
  }
66
 
67
  [HttpDelete("{id}")]
68
+ //[Authorize(Roles = "Librarian")]
69
  public async Task<IActionResult> DeleteUser(int id)
70
  {
71
  var success = await _userService.DeleteUserAsync(id);
LibraryManagement.Backend/Program.cs CHANGED
@@ -82,12 +82,10 @@ var app = builder.Build();
82
 
83
  app.UseSwagger();
84
  app.UseSwaggerUI();
85
-
86
- app.UseHttpsRedirection();
87
-
88
  app.UseAuthentication();
89
  app.UseAuthorization();
90
 
91
  app.MapControllers();
92
 
93
  app.Run();
 
 
82
 
83
  app.UseSwagger();
84
  app.UseSwaggerUI();
 
 
 
85
  app.UseAuthentication();
86
  app.UseAuthorization();
87
 
88
  app.MapControllers();
89
 
90
  app.Run();
91
+
LibraryManagement.Backend/Properties/launchSettings.json CHANGED
@@ -14,7 +14,7 @@
14
  "dotnetRunMessages": true,
15
  "launchBrowser": true,
16
  "launchUrl": "swagger",
17
- "applicationUrl": "http://localhost:5199",
18
  "environmentVariables": {
19
  "ASPNETCORE_ENVIRONMENT": "Development"
20
  }
 
14
  "dotnetRunMessages": true,
15
  "launchBrowser": true,
16
  "launchUrl": "swagger",
17
+ "applicationUrl": "http://localhost:5001",
18
  "environmentVariables": {
19
  "ASPNETCORE_ENVIRONMENT": "Development"
20
  }
LibraryManagement.Frontend/Components/App.razor DELETED
@@ -1,20 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="utf-8" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <base href="/" />
8
- <link rel="stylesheet" href="bootstrap/bootstrap.min.css" />
9
- <link rel="stylesheet" href="app.css" />
10
- <link rel="stylesheet" href="LibraryManagement.Frontend.styles.css" />
11
- <link rel="icon" type="image/png" href="favicon.png" />
12
- <HeadOutlet />
13
- </head>
14
-
15
- <body>
16
- <Routes />
17
- <script src="_framework/blazor.web.js"></script>
18
- </body>
19
-
20
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
LibraryManagement.Frontend/Components/Layout/MainLayout.razor DELETED
@@ -1,23 +0,0 @@
1
- @inherits LayoutComponentBase
2
-
3
- <div class="page">
4
- <div class="sidebar">
5
- <NavMenu />
6
- </div>
7
-
8
- <main>
9
- <div class="top-row px-4">
10
- <a href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a>
11
- </div>
12
-
13
- <article class="content px-4">
14
- @Body
15
- </article>
16
- </main>
17
- </div>
18
-
19
- <div id="blazor-error-ui">
20
- An unhandled error has occurred.
21
- <a href="" class="reload">Reload</a>
22
- <a class="dismiss">🗙</a>
23
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
LibraryManagement.Frontend/Components/Layout/MainLayout.razor.css DELETED
@@ -1,96 +0,0 @@
1
- .page {
2
- position: relative;
3
- display: flex;
4
- flex-direction: column;
5
- }
6
-
7
- main {
8
- flex: 1;
9
- }
10
-
11
- .sidebar {
12
- background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
13
- }
14
-
15
- .top-row {
16
- background-color: #f7f7f7;
17
- border-bottom: 1px solid #d6d5d5;
18
- justify-content: flex-end;
19
- height: 3.5rem;
20
- display: flex;
21
- align-items: center;
22
- }
23
-
24
- .top-row ::deep a, .top-row ::deep .btn-link {
25
- white-space: nowrap;
26
- margin-left: 1.5rem;
27
- text-decoration: none;
28
- }
29
-
30
- .top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
31
- text-decoration: underline;
32
- }
33
-
34
- .top-row ::deep a:first-child {
35
- overflow: hidden;
36
- text-overflow: ellipsis;
37
- }
38
-
39
- @media (max-width: 640.98px) {
40
- .top-row {
41
- justify-content: space-between;
42
- }
43
-
44
- .top-row ::deep a, .top-row ::deep .btn-link {
45
- margin-left: 0;
46
- }
47
- }
48
-
49
- @media (min-width: 641px) {
50
- .page {
51
- flex-direction: row;
52
- }
53
-
54
- .sidebar {
55
- width: 250px;
56
- height: 100vh;
57
- position: sticky;
58
- top: 0;
59
- }
60
-
61
- .top-row {
62
- position: sticky;
63
- top: 0;
64
- z-index: 1;
65
- }
66
-
67
- .top-row.auth ::deep a:first-child {
68
- flex: 1;
69
- text-align: right;
70
- width: 0;
71
- }
72
-
73
- .top-row, article {
74
- padding-left: 2rem !important;
75
- padding-right: 1.5rem !important;
76
- }
77
- }
78
-
79
- #blazor-error-ui {
80
- background: lightyellow;
81
- bottom: 0;
82
- box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
83
- display: none;
84
- left: 0;
85
- padding: 0.6rem 1.25rem 0.7rem 1.25rem;
86
- position: fixed;
87
- width: 100%;
88
- z-index: 1000;
89
- }
90
-
91
- #blazor-error-ui .dismiss {
92
- cursor: pointer;
93
- position: absolute;
94
- right: 0.75rem;
95
- top: 0.5rem;
96
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
LibraryManagement.Frontend/Components/Layout/NavMenu.razor DELETED
@@ -1,30 +0,0 @@
1
- <div class="top-row ps-3 navbar navbar-dark">
2
- <div class="container-fluid">
3
- <a class="navbar-brand" href="">LibraryManagement.Frontend</a>
4
- </div>
5
- </div>
6
-
7
- <input type="checkbox" title="Navigation menu" class="navbar-toggler" />
8
-
9
- <div class="nav-scrollable" onclick="document.querySelector('.navbar-toggler').click()">
10
- <nav class="flex-column">
11
- <div class="nav-item px-3">
12
- <NavLink class="nav-link" href="" Match="NavLinkMatch.All">
13
- <span class="bi bi-house-door-fill-nav-menu" aria-hidden="true"></span> Home
14
- </NavLink>
15
- </div>
16
-
17
- <div class="nav-item px-3">
18
- <NavLink class="nav-link" href="counter">
19
- <span class="bi bi-plus-square-fill-nav-menu" aria-hidden="true"></span> Counter
20
- </NavLink>
21
- </div>
22
-
23
- <div class="nav-item px-3">
24
- <NavLink class="nav-link" href="weather">
25
- <span class="bi bi-list-nested-nav-menu" aria-hidden="true"></span> Weather
26
- </NavLink>
27
- </div>
28
- </nav>
29
- </div>
30
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
LibraryManagement.Frontend/Components/Layout/NavMenu.razor.css DELETED
@@ -1,105 +0,0 @@
1
- .navbar-toggler {
2
- appearance: none;
3
- cursor: pointer;
4
- width: 3.5rem;
5
- height: 2.5rem;
6
- color: white;
7
- position: absolute;
8
- top: 0.5rem;
9
- right: 1rem;
10
- border: 1px solid rgba(255, 255, 255, 0.1);
11
- background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem rgba(255, 255, 255, 0.1);
12
- }
13
-
14
- .navbar-toggler:checked {
15
- background-color: rgba(255, 255, 255, 0.5);
16
- }
17
-
18
- .top-row {
19
- height: 3.5rem;
20
- background-color: rgba(0,0,0,0.4);
21
- }
22
-
23
- .navbar-brand {
24
- font-size: 1.1rem;
25
- }
26
-
27
- .bi {
28
- display: inline-block;
29
- position: relative;
30
- width: 1.25rem;
31
- height: 1.25rem;
32
- margin-right: 0.75rem;
33
- top: -1px;
34
- background-size: cover;
35
- }
36
-
37
- .bi-house-door-fill-nav-menu {
38
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-house-door-fill' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z'/%3E%3C/svg%3E");
39
- }
40
-
41
- .bi-plus-square-fill-nav-menu {
42
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-plus-square-fill' viewBox='0 0 16 16'%3E%3Cpath d='M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm6.5 4.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3a.5.5 0 0 1 1 0z'/%3E%3C/svg%3E");
43
- }
44
-
45
- .bi-list-nested-nav-menu {
46
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-list-nested' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.5 11.5A.5.5 0 0 1 5 11h10a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 1 3h10a.5.5 0 0 1 0 1H1a.5.5 0 0 1-.5-.5z'/%3E%3C/svg%3E");
47
- }
48
-
49
- .nav-item {
50
- font-size: 0.9rem;
51
- padding-bottom: 0.5rem;
52
- }
53
-
54
- .nav-item:first-of-type {
55
- padding-top: 1rem;
56
- }
57
-
58
- .nav-item:last-of-type {
59
- padding-bottom: 1rem;
60
- }
61
-
62
- .nav-item ::deep .nav-link {
63
- color: #d7d7d7;
64
- background: none;
65
- border: none;
66
- border-radius: 4px;
67
- height: 3rem;
68
- display: flex;
69
- align-items: center;
70
- line-height: 3rem;
71
- width: 100%;
72
- }
73
-
74
- .nav-item ::deep a.active {
75
- background-color: rgba(255,255,255,0.37);
76
- color: white;
77
- }
78
-
79
- .nav-item ::deep .nav-link:hover {
80
- background-color: rgba(255,255,255,0.1);
81
- color: white;
82
- }
83
-
84
- .nav-scrollable {
85
- display: none;
86
- }
87
-
88
- .navbar-toggler:checked ~ .nav-scrollable {
89
- display: block;
90
- }
91
-
92
- @media (min-width: 641px) {
93
- .navbar-toggler {
94
- display: none;
95
- }
96
-
97
- .nav-scrollable {
98
- /* Never collapse the sidebar for wide screens */
99
- display: block;
100
-
101
- /* Allow sidebar to scroll for tall menus */
102
- height: calc(100vh - 3.5rem);
103
- overflow-y: auto;
104
- }
105
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
LibraryManagement.Frontend/Components/Pages/Counter.razor DELETED
@@ -1,19 +0,0 @@
1
- @page "/counter"
2
- @rendermode InteractiveServer
3
-
4
- <PageTitle>Counter</PageTitle>
5
-
6
- <h1>Counter</h1>
7
-
8
- <p role="status">Current count: @currentCount</p>
9
-
10
- <button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
11
-
12
- @code {
13
- private int currentCount = 0;
14
-
15
- private void IncrementCount()
16
- {
17
- currentCount++;
18
- }
19
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
LibraryManagement.Frontend/Components/Pages/Error.razor DELETED
@@ -1,36 +0,0 @@
1
- @page "/Error"
2
- @using System.Diagnostics
3
-
4
- <PageTitle>Error</PageTitle>
5
-
6
- <h1 class="text-danger">Error.</h1>
7
- <h2 class="text-danger">An error occurred while processing your request.</h2>
8
-
9
- @if (ShowRequestId)
10
- {
11
- <p>
12
- <strong>Request ID:</strong> <code>@RequestId</code>
13
- </p>
14
- }
15
-
16
- <h3>Development Mode</h3>
17
- <p>
18
- Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
19
- </p>
20
- <p>
21
- <strong>The Development environment shouldn't be enabled for deployed applications.</strong>
22
- It can result in displaying sensitive information from exceptions to end users.
23
- For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
24
- and restarting the app.
25
- </p>
26
-
27
- @code{
28
- [CascadingParameter]
29
- private HttpContext? HttpContext { get; set; }
30
-
31
- private string? RequestId { get; set; }
32
- private bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
33
-
34
- protected override void OnInitialized() =>
35
- RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier;
36
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
LibraryManagement.Frontend/Components/Pages/Home.razor DELETED
@@ -1,7 +0,0 @@
1
- @page "/"
2
-
3
- <PageTitle>Home</PageTitle>
4
-
5
- <h1>Hello, world!</h1>
6
-
7
- Welcome to your new app.
 
 
 
 
 
 
 
 
LibraryManagement.Frontend/Components/Pages/Weather.razor DELETED
@@ -1,64 +0,0 @@
1
- @page "/weather"
2
- @attribute [StreamRendering]
3
-
4
- <PageTitle>Weather</PageTitle>
5
-
6
- <h1>Weather</h1>
7
-
8
- <p>This component demonstrates showing data.</p>
9
-
10
- @if (forecasts == null)
11
- {
12
- <p><em>Loading...</em></p>
13
- }
14
- else
15
- {
16
- <table class="table">
17
- <thead>
18
- <tr>
19
- <th>Date</th>
20
- <th>Temp. (C)</th>
21
- <th>Temp. (F)</th>
22
- <th>Summary</th>
23
- </tr>
24
- </thead>
25
- <tbody>
26
- @foreach (var forecast in forecasts)
27
- {
28
- <tr>
29
- <td>@forecast.Date.ToShortDateString()</td>
30
- <td>@forecast.TemperatureC</td>
31
- <td>@forecast.TemperatureF</td>
32
- <td>@forecast.Summary</td>
33
- </tr>
34
- }
35
- </tbody>
36
- </table>
37
- }
38
-
39
- @code {
40
- private WeatherForecast[]? forecasts;
41
-
42
- protected override async Task OnInitializedAsync()
43
- {
44
- // Simulate asynchronous loading to demonstrate streaming rendering
45
- await Task.Delay(500);
46
-
47
- var startDate = DateOnly.FromDateTime(DateTime.Now);
48
- var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" };
49
- forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast
50
- {
51
- Date = startDate.AddDays(index),
52
- TemperatureC = Random.Shared.Next(-20, 55),
53
- Summary = summaries[Random.Shared.Next(summaries.Length)]
54
- }).ToArray();
55
- }
56
-
57
- private class WeatherForecast
58
- {
59
- public DateOnly Date { get; set; }
60
- public int TemperatureC { get; set; }
61
- public string? Summary { get; set; }
62
- public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
63
- }
64
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
LibraryManagement.Frontend/Components/Routes.razor DELETED
@@ -1,6 +0,0 @@
1
- <Router AppAssembly="typeof(Program).Assembly">
2
- <Found Context="routeData">
3
- <RouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)" />
4
- <FocusOnNavigate RouteData="routeData" Selector="h1" />
5
- </Found>
6
- </Router>
 
 
 
 
 
 
 
LibraryManagement.Frontend/Components/_Imports.razor DELETED
@@ -1,10 +0,0 @@
1
- @using System.Net.Http
2
- @using System.Net.Http.Json
3
- @using Microsoft.AspNetCore.Components.Forms
4
- @using Microsoft.AspNetCore.Components.Routing
5
- @using Microsoft.AspNetCore.Components.Web
6
- @using static Microsoft.AspNetCore.Components.Web.RenderMode
7
- @using Microsoft.AspNetCore.Components.Web.Virtualization
8
- @using Microsoft.JSInterop
9
- @using LibraryManagement.Frontend
10
- @using LibraryManagement.Frontend.Components
 
 
 
 
 
 
 
 
 
 
 
LibraryManagement.Frontend/LibraryManagement.Frontend.csproj DELETED
@@ -1,9 +0,0 @@
1
- <Project Sdk="Microsoft.NET.Sdk.Web">
2
-
3
- <PropertyGroup>
4
- <TargetFramework>net8.0</TargetFramework>
5
- <Nullable>enable</Nullable>
6
- <ImplicitUsings>enable</ImplicitUsings>
7
- </PropertyGroup>
8
-
9
- </Project>
 
 
 
 
 
 
 
 
 
 
LibraryManagement.Frontend/Program.cs DELETED
@@ -1,27 +0,0 @@
1
- using LibraryManagement.Frontend.Components;
2
-
3
- var builder = WebApplication.CreateBuilder(args);
4
-
5
- // Add services to the container.
6
- builder.Services.AddRazorComponents()
7
- .AddInteractiveServerComponents();
8
-
9
- var app = builder.Build();
10
-
11
- // Configure the HTTP request pipeline.
12
- if (!app.Environment.IsDevelopment())
13
- {
14
- app.UseExceptionHandler("/Error", createScopeForErrors: true);
15
- // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
16
- app.UseHsts();
17
- }
18
-
19
- app.UseHttpsRedirection();
20
-
21
- app.UseStaticFiles();
22
- app.UseAntiforgery();
23
-
24
- app.MapRazorComponents<App>()
25
- .AddInteractiveServerRenderMode();
26
-
27
- app.Run();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
LibraryManagement.Frontend/Properties/launchSettings.json DELETED
@@ -1,38 +0,0 @@
1
- {
2
- "$schema": "http://json.schemastore.org/launchsettings.json",
3
- "iisSettings": {
4
- "windowsAuthentication": false,
5
- "anonymousAuthentication": true,
6
- "iisExpress": {
7
- "applicationUrl": "http://localhost:63301",
8
- "sslPort": 44390
9
- }
10
- },
11
- "profiles": {
12
- "http": {
13
- "commandName": "Project",
14
- "dotnetRunMessages": true,
15
- "launchBrowser": true,
16
- "applicationUrl": "http://localhost:5008",
17
- "environmentVariables": {
18
- "ASPNETCORE_ENVIRONMENT": "Development"
19
- }
20
- },
21
- "https": {
22
- "commandName": "Project",
23
- "dotnetRunMessages": true,
24
- "launchBrowser": true,
25
- "applicationUrl": "https://localhost:7187;http://localhost:5008",
26
- "environmentVariables": {
27
- "ASPNETCORE_ENVIRONMENT": "Development"
28
- }
29
- },
30
- "IIS Express": {
31
- "commandName": "IISExpress",
32
- "launchBrowser": true,
33
- "environmentVariables": {
34
- "ASPNETCORE_ENVIRONMENT": "Development"
35
- }
36
- }
37
- }
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
LibraryManagement.Frontend/appsettings.Development.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "Logging": {
3
- "LogLevel": {
4
- "Default": "Information",
5
- "Microsoft.AspNetCore": "Warning"
6
- }
7
- }
8
- }
 
 
 
 
 
 
 
 
 
LibraryManagement.Frontend/appsettings.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "Logging": {
3
- "LogLevel": {
4
- "Default": "Information",
5
- "Microsoft.AspNetCore": "Warning"
6
- }
7
- },
8
- "AllowedHosts": "*"
9
- }
 
 
 
 
 
 
 
 
 
 
LibraryManagement.Frontend/wwwroot/app.css DELETED
@@ -1,51 +0,0 @@
1
- html, body {
2
- font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
3
- }
4
-
5
- a, .btn-link {
6
- color: #006bb7;
7
- }
8
-
9
- .btn-primary {
10
- color: #fff;
11
- background-color: #1b6ec2;
12
- border-color: #1861ac;
13
- }
14
-
15
- .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
16
- box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
17
- }
18
-
19
- .content {
20
- padding-top: 1.1rem;
21
- }
22
-
23
- h1:focus {
24
- outline: none;
25
- }
26
-
27
- .valid.modified:not([type=checkbox]) {
28
- outline: 1px solid #26b050;
29
- }
30
-
31
- .invalid {
32
- outline: 1px solid #e50000;
33
- }
34
-
35
- .validation-message {
36
- color: #e50000;
37
- }
38
-
39
- .blazor-error-boundary {
40
- background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
41
- padding: 1rem 1rem 1rem 3.7rem;
42
- color: white;
43
- }
44
-
45
- .blazor-error-boundary::after {
46
- content: "An error has occurred."
47
- }
48
-
49
- .darker-border-checkbox.form-check-input {
50
- border-color: #929292;
51
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
LibraryManagement.Frontend/wwwroot/bootstrap/bootstrap.min.css DELETED
The diff for this file is too large to render. See raw diff
 
LibraryManagement.Frontend/wwwroot/bootstrap/bootstrap.min.css.map DELETED
The diff for this file is too large to render. See raw diff
 
LibraryManagement.Frontend/wwwroot/favicon.png DELETED
Binary file (1.15 kB)
 
LibraryManagement.slnx CHANGED
@@ -1,5 +1,4 @@
1
  <Solution>
2
  <Project Path="Database/Database.csproj" Id="1ec23dc7-355d-4456-a503-cfd0fb81cd5c" />
3
  <Project Path="LibraryManagement.Backend/LibraryManagement.Backend.csproj" Id="82e311b1-ce76-4235-9d5f-0d06a942d038" />
4
- <Project Path="LibraryManagement.Frontend/LibraryManagement.Frontend.csproj" Id="4209546e-83fd-4d5c-8707-47c86053d9a8" />
5
  </Solution>
 
1
  <Solution>
2
  <Project Path="Database/Database.csproj" Id="1ec23dc7-355d-4456-a503-cfd0fb81cd5c" />
3
  <Project Path="LibraryManagement.Backend/LibraryManagement.Backend.csproj" Id="82e311b1-ce76-4235-9d5f-0d06a942d038" />
 
4
  </Solution>