Merge pull request #724 from Qtoss-AI/master

Remove AffiliateId
This commit is contained in:
Haiping 2024-11-05 03:06:02 +00:00 committed by GitHub
commit d1ec74fab4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 12 deletions

View file

@ -13,8 +13,6 @@ public interface IUserIdentity
/// </summary>
string UserLanguage { get; }
string? Phone { get; }
string? AffiliateId { get; }
string? EmployeeId { get; }
string Type { get; }
string Role { get; }
string? RegionCode { get; }

View file

@ -31,7 +31,7 @@ public class DistributedLocker
}
}
public async Task<T> Lock<T>(string resource, Func<T> action, int timeoutInSeconds = 30)
public async Task Lock(string resource, Action action, int timeoutInSeconds = 30)
{
await ConnectToRedis();
@ -45,7 +45,7 @@ public class DistributedLocker
Serilog.Log.Logger.Error($"Acquire lock for {resource} failed due to after {timeout}s timeout.");
}
return action();
action();
}
}

View file

@ -70,18 +70,15 @@ public class UserIdentity : IUserIdentity
[JsonPropertyName("phone")]
public string? Phone => _claims?.FirstOrDefault(x => x.Type == "phone")?.Value;
[JsonPropertyName("affiliateId")]
public string? AffiliateId => _claims?.FirstOrDefault(x => x.Type == "affiliateId")?.Value;
[JsonPropertyName("employeeId")]
public string? EmployeeId => _claims?.FirstOrDefault(x => x.Type == "employeeId")?.Value;
[JsonPropertyName("type")]
public string? Type => _claims?.FirstOrDefault(x => x.Type == "type")?.Value;
[JsonPropertyName("role")]
public string? Role => _claims?.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value;
[JsonPropertyName("regionCode")]
public string? RegionCode => _claims?.FirstOrDefault(x => x.Type == "regionCode")?.Value;
/// <summary>
/// US, CA, etc.
/// </summary>
[JsonPropertyName("region_code")]
public string? RegionCode => _claims?.FirstOrDefault(x => x.Type == "region_code")?.Value;
}