fuzzyroutesearch接口
URL: |
http:// <BusServer-URL> / fuzzyroutesearch |
父资源: |
BusServer |
[ 服务说明 ]
fuzzyroutesearch 接口用于根据用户输入的字符串模糊搜索公交线路,并以分页的形式将结果返回。
[ 参数说明 ]
[ 请求接口参数 ]
参数 | 参数说明 |
---|---|
searchstr |
 参数是否必须:是  参数含义:模糊字符串 |
start |
 参数是否必须:是  参数含义:获取记录的起始位置,值>=1 |
limit |
 参数是否必须:是  参数含义:从起始位置开始要返回的记录条数 |
[ 返回结果参数 ]
参数 | 参数说明 | |
state | 参数含义:状态,true 表示成功,false 表示失败 | |
total | 参数含义:匹配公交路线的总数目 | |
array | id | 参数含义:公交路线的ID 编号 |
name | 参数含义:公交路线的名称 |
[ 示例 ]
fuzzyroutesearch请求接口示例:
http://127.0.0.1:8099/newmap/rest/services/公交/changzhibus/BusServer/fuzzyroutesearch?searchstr=3 路&start=1&limit=4&format=json
[ 返回结果 ]
fuzzyroutesearch操作成功时的返回结果示例 :
{"state":true,"total":10,"array":[{"id":18,"name":"23 路( 上行)"},{"id":19,"name":"23 路(下
行)"},{"id":20,"name":"303 路(上行)"},{"id":21,"name":"303 路(下行)"}]}
fuzzyroutesearch操作失败时的返回结果示例 :
{
"state":false,"describe":"Missing 'start'Parameter"}
"state":false,"describe":"Missing 'start'Parameter"}