自定义函数-Fx.location

2020-12-28 17:16:17 739 本站

      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地区码
typecountry:国家 province:省 city:市 district:区

     data返回值类型:String(返回国家省市区的名字,查询不到返回空)

     例:

String label = Fx.location.findCountryAreaLabel("249","province")

3、根据地区省市中文,查询地区码-findCountryAreaCode

     定义:Fx.location.findCountryAreaCode(<String label>,<String type>)

参数说明
code地区省市中文
typecountry:国家 province:省 city:市 district:区

     data返回值类型:String(返回国家省市区的地区码,查询不到返回空)

     例:

String provinceCode = Fx.location.findCountryAreaCode("黑龙江","province")



内容来源于互联网,如有侵权,请联系客服删除处理。
在线咨询 拨打电话