Skip to content

Commit

Permalink
feat:add post user claim
Browse files Browse the repository at this point in the history
  • Loading branch information
MayueCif committed Aug 25, 2023
1 parent b83ab5b commit 7470a9d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright (c) MASA Stack All rights reserved.
// Licensed under the MIT License. See LICENSE.txt in the project root for license information.

namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model;

public class UserClaimValuesModel
{
public Guid UserId { get; set; }

public Dictionary<string, string> ClaimValues { get; set; } = new();
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ public interface IUserService

Task UnbindRolesAsync(UnbindUserRolesModel model);

Task<Dictionary<string, string>> GetGetClaimValuesAsync(Guid userId);
Task<Dictionary<string, string>> GetClaimValuesAsync(Guid userId);

Task AddClaimValuesAsync(UserClaimValuesModel userClaimValuesModel);
}

Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,16 @@ public Task UnbindRolesAsync(UnbindUserRolesModel model)
return _caller.PostAsync(requestUri, model);
}

public async Task<Dictionary<string, string>> GetGetClaimValuesAsync(Guid userId)
public async Task<Dictionary<string, string>> GetClaimValuesAsync(Guid userId)
{
var requestUri = $"api/user/ClaimValues/{userId}";
var requestUri = $"api/user/claim-values/{userId}";
return await _caller.GetAsync<Dictionary<string, string>>(requestUri) ?? new();
}

public Task AddClaimValuesAsync(UserClaimValuesModel userClaimValuesModel)
{
var requestUri = $"api/user/claim-values";
return _caller.PostAsync(requestUri, userClaimValuesModel);
}
}

0 comments on commit 7470a9d

Please sign in to comment.