Skip to content
This repository was archived by the owner on Aug 1, 2021. It is now read-only.

Commit 3c8e5c5

Browse files
committed
rename
1 parent acf6cfd commit 3c8e5c5

75 files changed

Lines changed: 565 additions & 232 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Backend/Jp.Application/AutoMapper/ViewModelToDomainMappingProfile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using Jp.Application.ViewModels.RoleViewModels;
88
using Jp.Application.ViewModels.UserViewModels;
99
using Jp.Domain.Commands.ApiResource;
10-
using Jp.Domain.Commands.Client;
10+
using Jp.Domain.Commands.Clients;
1111
using Jp.Domain.Commands.IdentityResource;
1212
using Jp.Domain.Commands.PersistedGrant;
1313
using Jp.Domain.Commands.Role;

src/Backend/Jp.Application/Services/ClientAppService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using Jp.Application.Interfaces;
99
using Jp.Application.ViewModels;
1010
using Jp.Application.ViewModels.ClientsViewModels;
11-
using Jp.Domain.Commands.Client;
11+
using Jp.Domain.Commands.Clients;
1212
using Jp.Domain.Core.Bus;
1313
using Jp.Domain.Interfaces;
1414

src/Backend/Jp.Application/ViewModels/ClientsViewModels/SaveClientViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System.ComponentModel.DataAnnotations;
2-
using Jp.Domain.Commands.Client;
2+
using Jp.Domain.Commands.Clients;
33

44
namespace Jp.Application.ViewModels.ClientsViewModels
55
{

src/Backend/Jp.Domain/CommandHandlers/ClientCommandHandler.cs

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using IdentityServer4.EntityFramework.Entities;
22
using IdentityServer4.EntityFramework.Mappers;
3-
using Jp.Domain.Commands.Client;
43
using Jp.Domain.Core.Bus;
54
using Jp.Domain.Core.Notifications;
65
using Jp.Domain.Events.Client;
@@ -11,6 +10,7 @@
1110
using System.Linq;
1211
using System.Threading;
1312
using System.Threading.Tasks;
13+
using Jp.Domain.Commands.Clients;
1414

1515
namespace Jp.Domain.CommandHandlers
1616
{
@@ -144,14 +144,7 @@ public async Task<bool> Handle(SaveClientSecretCommand request, CancellationToke
144144
return false;
145145
}
146146

147-
var secret = new ClientSecret
148-
{
149-
Client = savedClient,
150-
Description = request.Description,
151-
Expiration = request.Expiration,
152-
Type = request.Type,
153-
Value = request.GetValue()
154-
};
147+
var secret = request.ToEntity(savedClient);
155148

156149
_clientSecretRepository.Add(secret);
157150

@@ -208,13 +201,8 @@ public async Task<bool> Handle(SaveClientPropertyCommand request, CancellationTo
208201
await Bus.RaiseEvent(new DomainNotification("1", "Client not found"));
209202
return false;
210203
}
211-
212-
var property = new ClientProperty()
213-
{
214-
Client = savedClient,
215-
Value = request.Value,
216-
Key = request.Key
217-
};
204+
var property = request.ToEntiyTy(savedClient);
205+
218206

219207
_clientPropertyRepository.Add(property);
220208

@@ -273,12 +261,7 @@ public async Task<bool> Handle(SaveClientClaimCommand request, CancellationToken
273261
return false;
274262
}
275263

276-
var property = new ClientClaim()
277-
{
278-
Client = savedClient,
279-
Value = request.Value,
280-
Type = request.Type
281-
};
264+
var property = request.ToEntity(savedClient);
282265

283266
_clientClaimRepository.Add(property);
284267

@@ -336,6 +319,7 @@ public async Task<bool> Handle(CopyClientCommand request, CancellationToken canc
336319
}
337320

338321
var copyOf = savedClient.ToModel();
322+
339323
copyOf.ClientId = $"copy-of-{copyOf.ClientId}-{Guid.NewGuid().ToString().Replace("-", string.Empty)}";
340324
copyOf.ClientSecrets = new List<IdentityServer4.Models.Secret>();
341325
copyOf.ClientName = "Copy of " + copyOf.ClientName;

src/Backend/Jp.Domain/Commands/ApiResource/RemoveApiScopeCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Jp.Domain.Commands.Client;
1+
using Jp.Domain.Commands.Clients;
22
using Jp.Domain.Validations.ApiResource;
33

44
namespace Jp.Domain.Commands.ApiResource

src/Backend/Jp.Domain/Commands/ApiResource/RemoveApiSecretCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Jp.Domain.Commands.Client;
1+
using Jp.Domain.Commands.Clients;
22
using Jp.Domain.Validations.ApiResource;
33

44
namespace Jp.Domain.Commands.ApiResource

src/Backend/Jp.Domain/Commands/ApiResource/SaveApiScopeCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System.Collections.Generic;
2-
using Jp.Domain.Commands.Client;
2+
using Jp.Domain.Commands.Clients;
33
using Jp.Domain.Validations.ApiResource;
44

55
namespace Jp.Domain.Commands.ApiResource

src/Backend/Jp.Domain/Commands/ApiResource/SaveApiSecretCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22
using IdentityModel;
3-
using Jp.Domain.Commands.Client;
3+
using Jp.Domain.Commands.Clients;
44
using Jp.Domain.Validations.ApiResource;
55

66
namespace Jp.Domain.Commands.ApiResource

src/Backend/Jp.Domain/Commands/Client/ApiScopeCommand.cs renamed to src/Backend/Jp.Domain/Commands/Clients/ApiScopeCommand.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.Collections.Generic;
32
using Jp.Domain.Core.Commands;
43

5-
namespace Jp.Domain.Commands.Client
4+
namespace Jp.Domain.Commands.Clients
65
{
76
public abstract class ApiScopeCommand : Command
87
{

src/Backend/Jp.Domain/Commands/Client/ApiSecretCommand.cs renamed to src/Backend/Jp.Domain/Commands/Clients/ApiSecretCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using Jp.Domain.Core.Commands;
33

4-
namespace Jp.Domain.Commands.Client
4+
namespace Jp.Domain.Commands.Clients
55
{
66
public abstract class ApiSecretCommand : Command
77
{

0 commit comments

Comments
 (0)