-
背景
-
针对目前国内疫情情况,公司要求开发员工进出中高风险地区实时上报功能。苦于找不到政府数据接口API。在git上找到一份python的接口。作者也提供了github的接口,但是由于被墙,所以很不稳定。就改写了一版C#版本。
-
接口地址
-
网址:中高风险地区接口
-
接口参数说明
-
JSON格式的配置内容:
-
"RiskAreaConfig": { "Appid": "NcApplication", "Key": "3C502C97ABDA40D0A60FBEE50FAAD1DA", "Token": "23y0ufFl5YxIyGrI8hWRUZmKkvtSjLQA", "Nonce": "123456789abcdefg", "Preix_Header": "zdww", "BodyRandom_1": "fTN2pfuisxTavbTuYVSsNJHetwq5bJvC", "BodyRandom_2": "QkjjtiLM2dCratiA" }
-
接口返回类型
-
`public class ResponseRiskModel
{
[JsonProperty(“data”)]
public RiskLayout RiskAreaData { get; set; }
[JsonProperty(“code”)]
public int Code { get; set; }
[JsonProperty(“msg”)]
public string Msg { get; set; }
}public class RiskLayout
{
[JsonProperty(“end_update_time”)]
public string LastUpdateTime { get; set; }
[JsonProperty(“hcount”)]
public int HCount { get; set; }
[JsonProperty(“mcount”)]
public int MCount { get; set; }
[JsonProperty(“lcount”)]
public int LCount { get; set; }
[JsonProperty(“highlist”)]
public List HighList { get; set; }
[JsonProperty(“middlelist”)]
public List MiddleList { get; set; }
[JsonProperty(“lowlist”)]
public List LowList { get; set; }
}public class AddressInfo
{
[JsonProperty(“type”)]
public string AddressType { get; set; }
[JsonProperty(“province”)]
public string Province { get; set; }
[JsonProperty(“city”)]
public string City { get; set; }
[JsonProperty(“county”)]
public string County { get; set; }
[JsonProperty(“area_name”)]
public string AreaName { get; set; }
[JsonProperty(“communitys”)]
public List Communitys { get; set; }
}` -
接口Demo(C#版本)
-
-
引用:
疫情低中高风险地区实时API
于 2022-10-06 11:39:18 首次发布