最近在公司大佬的带领下自己写了个api
全国城市联动Api
请求全国所有省份/GET
https://api.xiaohuwei.cn/test.php?type=province
{
"pid": "10120",//用来获取所有湖北省的市级单位
"id": "101200101",
"city": "武汉",//省会
"en": "wuhan",
"province": "湖北"//省名
},
...
获取湖北省所有市级单位/GET
https://api.xiaohuwei.cn/test.php?type=city&pid=10120
{
"pid": "10120",
"id": "101200101",//用来获取市级单位下的所有县级单位
"city": "武汉",
"en": "wuhan"
},
{
"pid": "10120",
"id": "101200201",
"city": "襄阳",
"en": "xiangyang"
},
{
"pid": "10120",
"id": "101200301",
"city": "鄂州",
"en": "ezhou"
},
...
获取武汉市所有县级单位/GET
https://api.xiaohuwei.cn/test.php?type=county&id=101200101
{
"pid": "10120",
"id": "101200101",
"city": "武汉",
"en": "wuhan"
},
{
"pid": "10120",
"id": "101200102",
"city": "蔡甸",
"en": "caidian"
},
{
"pid": "10120",
"id": "101200103",
"city": "黄陂",
"en": "huangpi"
},
...
直接丢数据库出来吧。减少你服务器压力。@(哈哈)
不需要数据库 Json文件就可以
这是马上要就业的节奏了~
早工作了啊@(滑稽)