feat: 完成微信小程序消息推送

This commit is contained in:
橙子
2024-11-09 19:05:42 +08:00
parent 3fbaffe9a2
commit 83fb93da11
10 changed files with 213 additions and 10 deletions

View File

@@ -5,6 +5,6 @@ namespace Yi.Framework.Rbac.Application.Contracts.IServices;
public interface IAuthService
{
Task<AuthOutputDto?> TryGetByOpenIdAsync(string openId, string authType);
Task<AuthOutputDto?> TryGetAuthInfoAsync(string? openId, string authType, Guid? userId = null);
Task<AuthOutputDto> CreateAsync(AuthCreateOrUpdateInputDto input);
}

View File

@@ -113,9 +113,11 @@ namespace Yi.Framework.Rbac.Application.Services.Authentication
return (await GetListAsync(input)).Items;
}
public async Task<AuthOutputDto?> TryGetByOpenIdAsync(string openId, string authType)
public async Task<AuthOutputDto?> TryGetAuthInfoAsync(string? openId, string authType,Guid? userId=null)
{
var entity = await _repository._DbQueryable.Where(x => x.OpenId == openId)
var entity = await _repository._DbQueryable
.WhereIF(openId is not null, x => x.OpenId == openId)
.WhereIF(userId is not null,x => x.UserId == userId)
.Where(x => x.AuthType == authType)
.FirstAsync();
var output = await MapToGetOutputDtoAsync(entity);