初始提交
This commit is contained in:
34
Services/Hncore.Pass.Vpn/Service/WxAppUserService.cs
Normal file
34
Services/Hncore.Pass.Vpn/Service/WxAppUserService.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user