添加项目文件。

This commit is contained in:
sunxiaolong
2024-07-22 00:43:14 +08:00
parent 420acddc53
commit f87e90f55a
218 changed files with 90102 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
namespace AppleBatch_June.Interfaces
{
public interface IAccountDisabled
{
bool accountCheck(string account, string pwd, string notityKey);
}
}

View File

@@ -0,0 +1,43 @@
using System;
using AppleBatch_June.AppleWebServace;
using AppleBatch_June.ExecuteTasks;
using AppleBatch_June.Model;
using AppleBatch_June.Utils;
namespace AppleBatch_June.Interfaces
{
public class WebAccountDisabled : IAccountDisabled
{
private Action<string, DisplyType, string> action;
private Action<string, DisplyType, string> applyAtion;
private bool _openVpn;
public ITaskRunState taskState;
public WebAccountDisabled(bool openVpn, Action<string, DisplyType, string> _action, Action<string, DisplyType, string> _applyAtion, ITaskRunState _taskState)
{
taskState = _taskState ?? throw new Exception("任务运行状态不能是空的");
_openVpn = openVpn;
action = _action;
applyAtion = _applyAtion;
}
public bool accountCheck(string account, string pwd, string notityKey)
{
if (AppSysConfig.webProtocolS2k)
{
return new AppleReportaproblemWeb(_openVpn, action, applyAtion, taskState)
{
ProxyIp = ProxyAccountCache.getProxyAccountIP(account)
}.checkDisable(account, pwd, notityKey);
}
AppleManageWebUtlis appleManageWebUtlis = new AppleManageWebUtlis(action, applyAtion, taskState);
appleManageWebUtlis.ProxyIp = ProxyAccountCache.getProxyAccountIP(account);
bool result = appleManageWebUtlis.checkDisable(_openVpn, account, pwd, notityKey);
appleManageWebUtlis.reportSingOut();
return result;
}
}
}

View File

@@ -0,0 +1,61 @@
using System;
using AppleBatch_June.ExecuteTasks;
using AppleBatch_June.Model;
using AppleBatch_June.Utils;
namespace AppleBatch_June.Interfaces
{
public class iTunesAccountDisabled : IAccountDisabled
{
private Action<string, DisplyType, string> action;
private Action<string, DisplyType, string> applyAtion;
public ITaskRunState taskState;
private bool openVpn { get; set; }
public iTunesAccountDisabled(bool _openVpn, Action<string, DisplyType, string> _action, Action<string, DisplyType, string> _applyAtion, ITaskRunState _taskState)
{
taskState = _taskState ?? throw new Exception("任务运行状态不能是空的");
openVpn = _openVpn;
action = _action;
applyAtion = _applyAtion;
}
public bool accountCheck(string account, string pwd, string notityKey)
{
ItunesUtlis itunesUtlis = new ItunesUtlis(taskState, notityKey, action, openVpn);
string msgReust = "";
if (string.IsNullOrEmpty(itunesUtlis.ProxyIp))
{
itunesUtlis.ProxyIp = ProxyAccountCache.getProxyAccountIP(account);
}
AppleItunesLogin appleItunesLogin = null;
appleItunesLogin = ((!AppSysConfig.iTunesisRemoteLogin) ? itunesUtlis.appleLogin(account, pwd, 1, ref msgReust, out var _) : itunesUtlis.remoteAppleLogin(account, pwd, ref msgReust));
if (appleItunesLogin == null)
{
action?.Invoke(notityKey, DisplyType.xinxi, msgReust);
return false;
}
action?.Invoke(notityKey, DisplyType.area, appleItunesLogin.Area.ToString());
action?.Invoke(notityKey, DisplyType.xinxi, "登录完成,正在检测");
DisplyState displyState = ((!(appleItunesLogin.isDisabledAccount.ToLower() == "true")) ? DisplyState.None : DisplyState.Disply);
action?.Invoke(notityKey, DisplyType.xinxi, "查询完成");
switch (displyState)
{
default:
return false;
case DisplyState.Disply:
applyAtion?.Invoke(notityKey, DisplyType.forbidden, "禁用");
return true;
case DisplyState.None:
applyAtion?.Invoke(notityKey, DisplyType.normal, "正常");
return true;
case DisplyState.Unknown:
action?.Invoke(notityKey, DisplyType.xinxi, "未知异常,请重新检测");
return true;
}
}
}
}