Skip to content

Commit 81df49d

Browse files
fix: compile errors
1 parent d5fd426 commit 81df49d

10 files changed

Lines changed: 31 additions & 72 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using CanBeYours.Application.Services.DemoThings;
2+
using Microsoft.Extensions.DependencyInjection;
3+
4+
namespace CanBeYours.Application;
5+
6+
public static class Startup
7+
{
8+
public static void AddApplicationModule(this IServiceCollection services)
9+
{
10+
//services.RegisterHandlers(typeof(Startup));
11+
12+
services.AddScoped<IDemoThingService, DemoThingService>();
13+
}
14+
}

src/1-Libraries/Infrastructure/Startup.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using CanBeYours.Application.Services.DemoThings;
1+
using CanBeYours.Application;
22
using CanBeYours.Core.Domain.DemoThings;
33
using CanBeYours.Infrastructure.DbContext;
44
using CanBeYours.Infrastructure.Mapping;
@@ -14,12 +14,11 @@ public static class Startup
1414
{
1515
public static void AddInfrastructureModule(this IServiceCollection services)
1616
{
17+
services.AddApplicationModule();
1718
services.RegisterHandlers(typeof(Startup));
1819
services.AddMongoDbContext();
1920
services.AddDomainServices();
20-
services.AddServices();
2121
services.AddMappingProfileFromAssemblyContaining<DemoThingMappingProfile>();
22-
services.RegisterBaseModule(typeof(Startup).Assembly);
2322
services.AddValidatorsFromAssembly(typeof(Startup).Assembly);
2423
}
2524

@@ -37,9 +36,4 @@ public static void AddDomainServices(this IServiceCollection services)
3736
{
3837
services.AddScoped<IDemoThingRepository, DemoThingRepository>();
3938
}
40-
41-
public static void AddServices(this IServiceCollection services)
42-
{
43-
services.AddScoped<IDemoThingService, DemoThingService>();
44-
}
4539
}

src/2-Clients/AdminPanel/Pages/DemoThings/Components/CreateDemoThing.razor

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
@using CanBeYours.Application.Dtos
2-
@using CanBeYours.Application.Services.DemoThings
3-
@using CanBeYours.AdminPanel.Resources
4-
@using CodeBlock.DevKit.Web.Blazor.Components.Dialogs
5-
@using CodeBlock.DevKit.Web.Blazor.Components.Forms
6-
@using Microsoft.Extensions.Localization
7-
8-
@inject IStringLocalizer<AdminPanelResource> L
9-
@inject IDemoThingService DemoThingService
1+
102

113
<EditForm Model="Input" OnValidSubmit="HandleCreateDemoThing">
124
<DataAnnotationsValidator />

src/2-Clients/AdminPanel/Pages/DemoThings/Components/DemoThings.razor

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@using CanBeYours.Application.Dtos
2-
31
<div class="table-responsive text-nowrap">
42
<table class="table table-hover mt-3">
53
<thead>

src/2-Clients/AdminPanel/Pages/DemoThings/Components/SearchDemoThings.razor

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@using CanBeYours.Application.Dtos
2-
31
<EditForm Model="SearchDemoThingsInputDto" OnSubmit="HandleSearchDemoThings" class="row gy-2 gx-3 align-items-center">
42

53
<div class="col-12">

src/2-Clients/AdminPanel/Pages/DemoThings/Components/UpdateDemoThing.razor

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
@using CanBeYours.Application.Dtos
22
@using CanBeYours.Application.Services.DemoThings
33
@using CanBeYours.AdminPanel.Resources
4-
@using CodeBlock.DevKit.Web.Blazor.Components.Dialogs
5-
@using CodeBlock.DevKit.Web.Blazor.Components.Forms
64
@using Microsoft.Extensions.Localization
75

86
@inject IStringLocalizer<AdminPanelResource> L

src/2-Clients/AdminPanel/Pages/DemoThings/Index.razor

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
@page "/demo-things"
2-
@attribute [Authorize]
32
@implements IDisposable
43

54
<PageTitle>@AdminPanelLocalizer[AdminPanelResource.DemoThings]</PageTitle>

src/2-Clients/AdminPanel/_Imports.razor

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@using CanBeYours.AdminPanel.Pages
22
@using CanBeYours.AdminPanel.Pages.Shared
3+
@using CanBeYours.Core.Resources
34
@using CodeBlock.DevKit.Clients.AdminPanel.Pages
45
@using CodeBlock.DevKit.Clients.AdminPanel.Pages.Shared
56
@using System.Net.Http
@@ -23,7 +24,15 @@
2324
@using CanBeYours.AdminPanel.Resources
2425
@using CodeBlock.DevKit.Web.Security;
2526
@using CodeBlock.DevKit.Contracts.Models
27+
@using CanBeYours.Application.Dtos
28+
@using CanBeYours.Application.Services.DemoThings
29+
@using CanBeYours.AdminPanel.Resources
30+
31+
@using CanBeYours.AdminPanel.Pages.DemoThings.Components
32+
@using CodeBlock.DevKit.Contracts.Dtos
2633

2734
@attribute [Authorize(Policy = Policies.ADMIN_ROLE)]
2835
@inject IStringLocalizer<AdminPanelResource> AdminPanelLocalizer
36+
@inject IStringLocalizer<SharedResource> SharedLocalizer
2937
@inject IStringLocalizer<CoreResource> CoreLocalizer
38+
@inject IDemoThingService DemoThingService

src/2-Clients/Api/Controllers/DemoThingsController.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
using CanBeYours.Application.Dtos;
22
using CanBeYours.Application.Services.DemoThings;
33
using CodeBlock.DevKit.Contracts.Dtos;
4-
using CodeBlock.DevKit.Contracts.Helpers;
54
using CodeBlock.DevKit.Core.Helpers;
5+
using CodeBlock.DevKit.Web.Api.Filters;
6+
using CodeBlock.DevKit.Web.Security;
67
using Microsoft.AspNetCore.Authorization;
78
using Microsoft.AspNetCore.Mvc;
89

910
namespace CanBeYours.Api.Controllers;
1011

1112
[Tags("DemoThings")]
1213
[Route("demo-things")]
13-
[Authorize]
14+
[Authorize(Policies.ADMIN_ROLE)]
1415
public class DemoThingsController : BaseApiController
1516
{
1617
private readonly IDemoThingService _demoThingService;
@@ -66,8 +67,8 @@ public async Task<Result<SearchOutputDto<GetDemoThingDto>>> Get(
6667
Term = term,
6768
PageNumber = pageNumber,
6869
RecordsPerPage = recordsPerPage,
69-
SortOrder = sortOrder
70+
SortOrder = sortOrder,
7071
};
7172
return await _demoThingService.SearchDemoThings(dto);
7273
}
73-
}
74+
}

src/2-Clients/Api/Controllers/TestController.cs

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)