Files
juipnet/Services/Hncore.Pass.Vpn/Service/WxAppUserService.cs
“wanyongkang” b562aba2b1 忽略dll文件git
2023-07-29 10:19:42 +08:00

34 lines
1.2 KiB
C#

using Hncore.Infrastructure.Service;
using Hncore.Pass.Vpn.Domain;
using Hncore.Wx.Open;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Hncore.Pass.Vpn.Service
{
public partial class WxAppUserService : ServiceBase<WxAppUserEntity>
{
WxAppService m_WxAppService;
public WxAppUserService(WxAppService _WxAppService, CourseContext dbContext, IHttpContextAccessor httpContextAccessor) : base(dbContext, httpContextAccessor)
{
m_WxAppService = _WxAppService;
}
public async Task<List<WxAppUserEntity>> GetWxUsers(List<int> UserId)
{
return await this.Query(m => UserId.Contains(m.UserId)).ToListAsync();
}
public async Task<WxAppUserEntity> GetWxUser(string appId, int userId)
{
return await this.Query(m => m.Appid == appId && m.UserId == userId).FirstOrDefaultAsync();
}
public async Task<WxAppUserEntity> GetWxUser(string appId, string openId)
{
return await this.Query(m => m.Appid == appId && m.Openid == openId).FirstOrDefaultAsync();
}
}
}