|
@@ -32,6 +32,7 @@ namespace TEAMModelOS.Controllers.Core
|
|
[HttpPost("FindRoleByDict")]
|
|
[HttpPost("FindRoleByDict")]
|
|
public async Task<BaseJosnRPCResponse> FindRoleByDict(JosnRPCRequest<Dictionary<string, object>> request)
|
|
public async Task<BaseJosnRPCResponse> FindRoleByDict(JosnRPCRequest<Dictionary<string, object>> request)
|
|
{
|
|
{
|
|
|
|
+ request.@params.TryAdd("PartitionKey", request.lang);
|
|
JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
List<Role> roles = await _roleSeservice.FindListByDictHasAll<Role>(request.@params);
|
|
List<Role> roles = await _roleSeservice.FindListByDictHasAll<Role>(request.@params);
|
|
return builder.Data(roles).build();
|
|
return builder.Data(roles).build();
|
|
@@ -72,13 +73,16 @@ namespace TEAMModelOS.Controllers.Core
|
|
foreach (string code in rolecodes)
|
|
foreach (string code in rolecodes)
|
|
{
|
|
{
|
|
List<RoleIdentityClaimValue> claimValues= await _roleSeservice.FindListByDict<RoleIdentityClaimValue>(
|
|
List<RoleIdentityClaimValue> claimValues= await _roleSeservice.FindListByDict<RoleIdentityClaimValue>(
|
|
- new Dictionary<string, object> { { "RoleCode", code },{ "TeamModelId", Id[0]} });
|
|
|
|
|
|
+ new Dictionary<string, object> { { "RoleCode", code },{ "TeamModelId", Id[0]}, { "PartitionKey", request.lang} });
|
|
List<string> keys = new List<string>();
|
|
List<string> keys = new List<string>();
|
|
List<Dictionary<string, object>> claims = new List<Dictionary<string, object>>();
|
|
List<Dictionary<string, object>> claims = new List<Dictionary<string, object>>();
|
|
foreach (IGrouping<string, RoleIdentityClaimValue> group in claimValues.GroupBy(c =>c.GroupKey))
|
|
foreach (IGrouping<string, RoleIdentityClaimValue> group in claimValues.GroupBy(c =>c.GroupKey))
|
|
{
|
|
{
|
|
|
|
+
|
|
|
|
+ List<RoleIdentityClaimValue> claimValue = claimValues.Where(x => x.GroupKey.Equals(group.Key)).ToList();
|
|
|
|
+ claimValue= claimValue.OrderBy(s => s.ClaimOrder).ToList() ;
|
|
Dictionary<string, object> claim = new Dictionary<string, object>();
|
|
Dictionary<string, object> claim = new Dictionary<string, object>();
|
|
- claim.Add("claim", claimValues.Where(x => x.GroupKey.Equals(group.Key)).ToList());
|
|
|
|
|
|
+ claim.Add("claim", claimValue);
|
|
claim.Add("group", group.Key);
|
|
claim.Add("group", group.Key);
|
|
claims.Add(claim);
|
|
claims.Add(claim);
|
|
}
|
|
}
|