Fx.location:和查询归属地有关的API
1、查询单个号码归属地-findByMobile
定义:Fx.location.findByMobile(<String mobile>)
data返回值类型:Map
例:
def(Boolean error,Map result,String errroMessage) = Fx.location.findByMobile("11111111111") //返回值新增两个参数 //province_code String 类型,省份的地区码 //city_code String 类型,市的地区码
2、根据地区码,查询地区省市中文-findCountryAreaLabel
定义:Fx.location.findCountryAreaLabel(<String code>,<String type>)
参数 | 说明 |
---|---|
code | 地区码 |
type | country:国家 province:省 city:市 district:区 |
data返回值类型:String(返回国家省市区的名字,查询不到返回空)
例:
String label = Fx.location.findCountryAreaLabel("249","province")
3、根据地区省市中文,查询地区码-findCountryAreaCode
定义:Fx.location.findCountryAreaCode(<String label>,<String type>)
参数 | 说明 | |
---|---|---|
code | 地区省市中文 | |
type | country:国家 province:省 city:市 district:区 |
data返回值类型:String(返回国家省市区的地区码,查询不到返回空)
例:
String provinceCode = Fx.location.findCountryAreaCode("黑龙江","province")