Skip to content

Commit f3f67ba

Browse files
authored
feat:add post user claim (#669)
1 parent b83ab5b commit f3f67ba

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright (c) MASA Stack All rights reserved.
2+
// Licensed under the MIT License. See LICENSE.txt in the project root for license information.
3+
4+
namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model;
5+
6+
public class UserClaimValuesModel
7+
{
8+
public Guid UserId { get; set; }
9+
10+
public Dictionary<string, string> ClaimValues { get; set; } = new();
11+
}

src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ public interface IUserService
107107

108108
Task UnbindRolesAsync(UnbindUserRolesModel model);
109109

110-
Task<Dictionary<string, string>> GetGetClaimValuesAsync(Guid userId);
110+
Task<Dictionary<string, string>> GetClaimValuesAsync(Guid userId);
111+
112+
Task AddClaimValuesAsync(UserClaimValuesModel userClaimValuesModel);
111113
}
112114

src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/UserService.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,16 @@ public Task UnbindRolesAsync(UnbindUserRolesModel model)
370370
return _caller.PostAsync(requestUri, model);
371371
}
372372

373-
public async Task<Dictionary<string, string>> GetGetClaimValuesAsync(Guid userId)
373+
public async Task<Dictionary<string, string>> GetClaimValuesAsync(Guid userId)
374374
{
375-
var requestUri = $"api/user/ClaimValues/{userId}";
375+
var requestUri = $"api/user/claim-values/{userId}";
376376
return await _caller.GetAsync<Dictionary<string, string>>(requestUri) ?? new();
377377
}
378+
379+
public Task AddClaimValuesAsync(UserClaimValuesModel userClaimValuesModel)
380+
{
381+
var requestUri = $"api/user/claim-values";
382+
return _caller.PostAsync(requestUri, userClaimValuesModel);
383+
}
378384
}
379385

0 commit comments

Comments
 (0)