文 档 中 心 / Document Center
搜索 管理中心
壹川接口文档V3
添加新地区信息
更新时间:2018-04-16 16:39:57   更新人员:叶洋   文档状态:完成 #154    测试接口
摘要
添加新地区信息
  1. 接口基本信息
    接口名称:添加一个地区信息
    请求方法:POST
    接口地址:district
    登录验证:是
  2. 请求参数
    参数名 参数 数据类型 是否必须 示例值 说明
    pid 上级地区id int 是
    level 地区级别 string 是 返回值有:country国,provice省,city市,district区,street街
    fullname 地区全名 string 是
    name 地区简称 string 是 地区简称
    adcode 地区代码 string 否 110000 与高德地图地区代码匹配
    citycode 城市代码 string 否 010 与高德地图城市代码匹配
    zipcode 邮编 string 否 邮编
  3. 响应数据参数
    参数名 参数 数据类型 示例值 说明
    id ID int 存储在系统中的ID值
    pid 上级id int 其上级区划id
    sort 显示排序值 int 显示排序值,从小往大排
    center_lng 区域中心经度 float 中心经度值
    center_lat 区域中心纬度 float 中心坐标上的纬度值
    adcode 地区代码 string 对应高德的地区代码,该值不唯一
    citycode 城市代码 string 对应高德citycode
    zipcode 邮编 string 邮编
    level 地区级别 string 返回值有:country国,provice省,city市,district区,street街
    firstword 名称拼音首字母 string 指的是简称的
    name 简称 string 地区简称,如『四川省』简称『四川』
    fullname 全称 string 地区全称
  4. 请求示例
    请求例子:
     
    apirq('district', {
        method: "post",
        data: {
            "pid": 2048,
            "level": "street",
            "fullname": "测试添加地区",
            "name": "测加地址"
        }
    }) 
    
    返回数据结果:
     
    {
        "code": 0,
        "msg": "数据添加成功!",
        "time": "1523867945",
        "data": {
            "id": 45645,
            "pid": 2048,
            "sort": 0,
            "center_lng": null,
            "center_lat": null,
            "adcode": "",
            "citycode": "",
            "zipcode": "",
            "level": "street",
            "firstword": null,
            "name": "测加地址",
            "fullname": "测试添加地区"
        }
    } 
    
本书创建于 2018-03-30 12:03:13 ?如有疑问,请联系技术人员