Files
kami_itunes_june/AppleBatch_June.Domain/NationalData.cs
danial cb905409f8 Refactor AppleBatch_June project:
- Removed DotRas library dependency in RasTools.cs, providing empty implementations for Connect and Disconnect methods.
- Updated context menu implementation in ReddemHelp.cs to use ToolStripMenuItem and ContextMenuStrip.
- Replaced caching mechanism in SiteHelper.cs with a custom dictionary-based implementation, removing reliance on HttpRuntime.Cache.
- Switched from JavaScriptSerializer to Newtonsoft.Json for JSON serialization/deserialization in multiple files (Tools.cs, addMaterial.cs).
- Added WebHeaderCollection property to HttpItem.cs for better header management.
- Deleted obsolete AssemblyInfo.cs file.
- Introduced apple_balance_query.py for querying Apple ID balance via Privacy Center, implementing authentication and balance retrieval logic.
2025-11-10 17:38:18 +08:00

35 lines
754 B
C#

using System.Collections.Generic;
using System.Net;
using Newtonsoft.Json;
using AppleBatch_June.Model;
using DotNet.Utilities;
namespace AppleBatch_June.Domain
{
public class NationalData
{
private static string nationJson = string.Empty;
public List<NationalList> getMation()
{
if (nationJson == string.Empty)
{
HttpResult html = new HttpHelper().GetHtml(new HttpItem
{
URL = "https://teluns-api.oss-cn-shenzhen.aliyuncs.com/nation.json",
Timeout = 8000
});
if (html.StatusCode == HttpStatusCode.OK)
{
nationJson = html.Html;
}
}
if (nationJson != string.Empty)
{
return JsonConvert.DeserializeObject<List<NationalList>>(nationJson);
}
return new List<NationalList>();
}
}
}