| 12345678910111213141516171819202122232425262728293031 |
- namespace molilian.core
- {
- /// <summary>
- /// 隐藏号判断:隐藏号命中的转链只返回 deeplink,不产生任何日志、统计、上报数据
- /// </summary>
- public static class HiddenAccountCore
- {
- public static Task<bool> IsHiddenAsync(TkChannelEnum channel, int accountId)
- {
- return IsHiddenAsync(channel.ToString(), accountId);
- }
- public static async Task<bool> IsHiddenAsync(string channel, int accountId)
- {
- if (accountId <= 0) return false;
- switch ((channel ?? string.Empty).ToLowerInvariant())
- {
- case "tb":
- var tbAccount = await TkPoolCore.ALLGetOneAsync(accountId);
- return tbAccount != null && tbAccount.is_hide;
- case "pdd":
- var pddAccounts = await PddPoolCore.AllListAsync();
- var pddAccount = pddAccounts?.FirstOrDefault(e => e.id == accountId);
- return pddAccount != null && pddAccount.is_hide;
- default:
- return false;
- }
- }
- }
- }
|