mirror of
https://git.oceanpay.cc/danial/kami_itunes_june.git
synced 2025-12-18 22:31:24 +00:00
35 lines
779 B
C#
35 lines
779 B
C#
using System.Collections.Generic;
|
|
using System.Net;
|
|
using System.Web.Script.Serialization;
|
|
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 new JavaScriptSerializer().Deserialize<List<NationalList>>(nationJson);
|
|
}
|
|
return new List<NationalList>();
|
|
}
|
|
}
|
|
}
|