mirror of
https://git.oceanpay.cc/danial/kami_itunes_june.git
synced 2025-12-18 14:13:32 +00:00
添加项目文件。
This commit is contained in:
7
AppleBatch_June.Interfaces/IAccountDisabled.cs
Normal file
7
AppleBatch_June.Interfaces/IAccountDisabled.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace AppleBatch_June.Interfaces
|
||||
{
|
||||
public interface IAccountDisabled
|
||||
{
|
||||
bool accountCheck(string account, string pwd, string notityKey);
|
||||
}
|
||||
}
|
||||
43
AppleBatch_June.Interfaces/WebAccountDisabled.cs
Normal file
43
AppleBatch_June.Interfaces/WebAccountDisabled.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
61
AppleBatch_June.Interfaces/iTunesAccountDisabled.cs
Normal file
61
AppleBatch_June.Interfaces/iTunesAccountDisabled.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user