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

Commit 7c91912

Browse files
committed
Restful API respecting HTTP Verbs
1 parent 79f201b commit 7c91912

86 files changed

Lines changed: 1021 additions & 1035 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/Interfaces/IClientAppService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public interface IClientAppService : IDisposable
1111
{
1212
Task<IEnumerable<ClientListViewModel>> GetClients();
1313
Task<Client> GetClientDetails(string clientId);
14-
Task Update(ClientViewModel client);
14+
Task Update(string id, Client client);
1515
Task<IEnumerable<SecretViewModel>> GetSecrets(string clientId);
1616
Task RemoveSecret(RemoveClientSecretViewModel model);
1717
Task SaveSecret(SaveClientSecretViewModel model);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ public async Task<Client> GetClientDetails(string clientId)
5555
return _mapper.Map<Client>(resultado);
5656
}
5757

58-
public Task Update(ClientViewModel client)
58+
public Task Update(string id, Client client)
5959
{
60-
var updateClientCommand = _mapper.Map<UpdateClientCommand>(client);
60+
var updateClientCommand = new UpdateClientCommand(client, id);
6161
return Bus.SendCommand(updateClientCommand);
6262
}
6363

src/Backend/Jp.Application/ViewModels/UserViewModels/AdminChangePasswordViewodel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
using System.ComponentModel.DataAnnotations;
1+
using Newtonsoft.Json;
2+
using System.ComponentModel.DataAnnotations;
23

34
namespace Jp.Application.ViewModels.UserViewModels
45
{
56
public class AdminChangePasswordViewodel
67
{
7-
[Required]
8-
[Display(Name = "Username")]
8+
[JsonIgnore]
99
public string Username { get; set; }
1010

1111
[Required]

src/Backend/Jp.Application/ViewModels/UserViewModels/ConfirmEmailViewModel.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
using System.ComponentModel.DataAnnotations;
1+
using Newtonsoft.Json;
2+
using System.ComponentModel.DataAnnotations;
23

34
namespace Jp.Application.ViewModels.UserViewModels
45
{
56
public class ConfirmEmailViewModel
67
{
7-
[Required]
8+
[JsonIgnore]
89
[EmailAddress]
910
public string Email { get; set; }
1011
[Required]

src/Backend/Jp.Application/ViewModels/UserViewModels/ForgotPasswordViewModel.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ namespace Jp.Application.ViewModels.UserViewModels
44
{
55
public class ForgotPasswordViewModel
66
{
7+
public ForgotPasswordViewModel(string username)
8+
{
9+
UsernameOrEmail = username;
10+
}
11+
712
[Required]
813
public string UsernameOrEmail { get; set; }
914
}

src/Backend/Jp.Application/ViewModels/UserViewModels/RegisterUserViewModel.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,17 @@ public class RegisterUserViewModel
4343

4444
[Display(Name = "ProviderId")]
4545
public string ProviderId { get; set; }
46+
47+
public bool ContainsFederationGateway()
48+
{
49+
return !string.IsNullOrEmpty(Provider) && !string.IsNullOrEmpty(ProviderId);
50+
51+
}
52+
53+
public void ClearSensitiveData()
54+
{
55+
Password = null;
56+
ConfirmPassword = null;
57+
}
4658
}
4759
}

src/Backend/Jp.Application/ViewModels/UserViewModels/RemoveAccountViewModel.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ namespace Jp.Application.ViewModels.UserViewModels
44
{
55
public class RemoveAccountViewModel
66
{
7+
public RemoveAccountViewModel(Guid id)
8+
{
9+
Id = id;
10+
}
11+
712
public Guid? Id { get; set; }
813
}
914
}

src/Backend/Jp.Application/ViewModels/UserViewModels/RemoveUserClaimViewModel.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ namespace Jp.Application.ViewModels.UserViewModels
44
{
55
public class RemoveUserClaimViewModel
66
{
7+
public RemoveUserClaimViewModel(string type, string value)
8+
{
9+
Type = type;
10+
Value = value;
11+
}
12+
713
[Required]
814
public string Type { get; set; }
915
[Required]

src/Backend/Jp.Application/ViewModels/UserViewModels/RemoveUserLoginViewModel.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ namespace Jp.Application.ViewModels.UserViewModels
44
{
55
public class RemoveUserLoginViewModel
66
{
7+
public RemoveUserLoginViewModel(string username, string loginProvider, string providerKey)
8+
{
9+
Username = username;
10+
LoginProvider = loginProvider;
11+
ProviderKey = providerKey;
12+
}
13+
714
[Required]
815
public string Username { get; set; }
916
[Required]
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
using System;
2-
using System.ComponentModel.DataAnnotations;
1+
using System.ComponentModel.DataAnnotations;
32

43
namespace Jp.Application.ViewModels.UserViewModels
54
{
65
public class RemoveUserRoleViewModel
76
{
7+
public RemoveUserRoleViewModel(string username, string role)
8+
{
9+
Username = username;
10+
Role = role;
11+
}
12+
813
[Required]
914
public string Role { get; set; }
1015
[Required]
1116
public string Username { get; set; }
1217

13-
public Guid UserId { get; set; }
1418
}
1519
}

0 commit comments

Comments
 (0)