Skip to content

Commit

Permalink
Fix/login service (#660)
Browse files Browse the repository at this point in the history
* feat:custom login service add environment

* feat:user service
  • Loading branch information
MayueCif authored Jul 26, 2023
1 parent b6e29fb commit 9e85d55
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,4 @@ public static class CacheKeyConsts
{
public const string ALL_THIRD_PARTY_IDP = "get_all_thirdparty_idp";
public const string USER_BY_ID = "get_user_by_id";

public static string UserKey(Guid userId)
{
return $"{USER_BY_ID}{userId}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ public class UserService : IUserService
{
readonly ICaller _caller;
readonly IUserContext _userContext;
readonly IMultilevelCacheClient _multilevelCacheClient;

public UserService(ICaller caller, IUserContext userContext, IMultilevelCacheClient multilevelCacheClient)
{
_caller = caller;
_userContext = userContext;
_multilevelCacheClient = multilevelCacheClient;
}

public async Task<UserModel> AddAsync(AddUserModel user)
Expand Down Expand Up @@ -102,8 +100,8 @@ public async Task<List<UserSimpleModel>> GetListByAccountAsync(IEnumerable<strin

public async Task<UserModel?> GetByIdAsync(Guid userId)
{
var user = await _multilevelCacheClient.GetAsync<UserModel>(CacheKeyConsts.UserKey(userId));
return user;
var user = await GetListByIdsAsync(userId);
return user.FirstOrDefault();
}

public async Task<List<UserModel>> GetListByIdsAsync(params Guid[] userIds)
Expand Down

0 comments on commit 9e85d55

Please sign in to comment.