Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:add post user claim #669

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}

Loading