cd geocoder
- 加执行权限
chmod +x ./bin/migrate.sh
- 请确保
redis-server
运行 - 导入 手机号段 及 身份证号段 数据
./bin/migrate.sh
- 运行
Jetty
下
mizuno
- 打成
war
包
bundle exec warble
短信发送 调用说明
curl \
-H 'Content-Type: application/json' \
-i 'http://open.shou65.com/smssender/token?login=用户名&passwd=密码'
- 返回
{
"X-Auth-Token": "密钥"
}
- 带返回的 POST
- 群发,用 逗号 隔开,多个手机号
curl \
-X POST \
-H 'X-Auth-Token: 密钥' \
-H 'Content-Type: application/json' \
-d '{ "mobile": "手机号", "content": "短信测试" }' \
-i 'http://open.shou65.com/smssender'
- 单发,返回
{
"success": true,
"message": "短信发送成功",
"fee": "当前发送,消耗的短信条数"
}
- 群发,返回
{
"success":true,
"message":"短信队列成功。",
"pending": ["数组,未发送的手机号"],
"sent": ["数组,发送成功的手机号"],
"fail": ["数组,发送失败的手机号"],
"fee": "当前发送,消耗的短信条数"
}
curl \
-H 'X-Auth-Token: 密钥' \
-H 'Content-Type: application/json' \
-i 'http://open.shou65.com/smssender'
- 返回
{
"success": true,
"message": {
"sent": "已发送条数",
"balance": "剩余条数"
}
}
- '/api/settings/{配置名称}';
- 跳转至查看;
curl \
-X POST \
-H 'Content-Type: application/json' \
-d '[{"area_code":"021", "pinyin": "shanghai", "country": "中国", "city": "上海"},{"area_code":"0755", "pinyin": "shenzhen", "country": "中国", "city": "深圳"}]' \
-i 'http://open.shou65.com/settings/cities'
- '/api/settings/{密钥}';
curl \
-H 'Content-Type: application/json' \
-i 'http://open.shou65.com/settings/S2hmUWticlcxd1U9'
- 返回
[
{
area_code: "021",
pinyin: "shanghai",
country: "中国",
city: "上海"
},
{
area_code: "0755",
pinyin: "shenzhen",
country: "中国",
city: "深圳"
}
]
- '/api/settings/{密钥}/search/{字段}?q={关键字}';
curl \
-H 'Content-Type: application/json' \
-i 'http://open.shou65.com/settings/S2hmUWticlcxd1U9/search/pinyin?q=sh'
- 返回
[
{
area_code: "021",
pinyin: "shanghai",
country: "中国",
city: "上海"
},
{
area_code: "0755",
pinyin: "shenzhen",
country: "中国",
city: "深圳"
}
]
- POST 适合长文本
curl \
-X POST \
-H 'Content-Type: application/json' \
-d '{"text":"诺基亚已经活了150年了,还会活下去。死掉的是产品,只是换个活法而已,也许是一个新的开始。"}' \
-i 'http://open.shou65.com/analyzer'
- 返回
[
"诺基亚", "已经", "150年", "下去", "产品", "活法", "而已", "也许", "一个", "开始"
]