crm.core/code/Crm.Core.External.Domain/Config/WeworkConfig.cs

28 lines
723 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Crm.Core.External.Domain.Config
{
public class WeworkConfig
{
public List<WhiteItem>? WhiteList { get; set; }
public bool IsWhite(string? userId, string? corpId)
{
if (WhiteList == null || !WhiteList.Any()) return true;
if (string.IsNullOrEmpty(userId) || string.IsNullOrEmpty(corpId)) return false;
return WhiteList.Any(x => x.UserId.Equals(userId) && x.CorpId.Equals(corpId));
}
}
public class WhiteItem
{
public string UserId { get; set; }
public string CorpId { get; set; }
}
}