POST /service/{serviceId}/{clientServiceId}/push 对特定ClientService进行推送 传入参数:JSON 参数示例:
// push ding to all
{
"audience" : "all",
"type": "DING"
}
//type :0:需要客户端输入,1:需要客户端选择,2:无需客户端输入,3无需客户端参数并且已关注 | |
[ | |
{ | |
"id": "2406", | |
"title": "微信热榜", | |
"description": "热门微信文章分类看", | |
"create_time": 1416303843211, | |
"type": 1, | |
"service_options": [ | |
{ |
//服务名显示:note_name > client_name > service_name | |
[ | |
{ | |
"id": "be49bbc5-01bb-4478-a8de-af06e40c617b", | |
"client_name": "深圳2明天下雨提醒", | |
"service_name": "明天下雨提醒", | |
"service_id": "2798", | |
"has_ding": false, | |
"tag": "wpmg62o52fbp0dg2n035vhib", | |
"client_fields": { |
// push ding to all | |
{ | |
"audience" : "all", | |
"type": "DING" | |
} | |
// push text by push token | |
{ | |
"audience" : { | |
"push_token":["4df99d44-23d0-454a-b7c6-d734da0aa8e7", "4df99d44-23d0-454a-b7c6-d734da0aa8e7"] | |
}, |
{ | |
"data": "{\"date\":\"1\",\"status\":\"下雨\"}", | |
"action": "ACTION_CLIENT_SERVICE_CREATE", | |
"sid": "0556", | |
"cid": "bc6e20b4-a0f0-494f-8564-dc2490432e4e" | |
} |
[ | |
{ | |
"id": "7b1f13a4-d6b0-4a4a-8bdb-bbb9a1f33313", | |
"service_id": "2351", | |
"client_id": "5f1e998c-436b-4231-be26-b71f40b9d006", | |
"type": "ARTICLE", | |
"date": "14/09/17 10:24", | |
"title": "深圳明天下雨", | |
"summary": "每天深圳有大到暴雨转狂暴雨,风太大,带伞也没有,所以无须带雨伞。", | |
"cover_pic": "http://a.36krcnd.com/photo/2014/4c096554b77e6d8a2b9f7c754322edc3.jpg", |
### Client Field Type Design | |
### DingDang Redis Design | |
Redis Key | Type | Value | Value Example | |
----|----|---- | |
service:{sid}|hash|Service Object | {"name": "明天下雨提醒我", "category": "天气", ...} | |
client.service.id:{sid}:${data}|string|ClientService's id | UUID - "klfdfd-fdsafdafdasfdas" | |
client.service:{cid}|hash|ClientService Object | {"data":"data string", "parentId":"0542", ...} | |
client.service.follower:{cid}|set|ClientService's id set |UUID - "abcd-efdasdasdasdasdasd" | |
user:{uid}|hash|User Object | {"id":"UUID", "password":"123123123", ...} |
//无客户端参数 | |
{ | |
"title": "明天下雨提醒", | |
"description": "明天下雨提醒, 我会提醒你", | |
"category_id": "1", | |
"notify_url": "http://127.0.0.1:9999" | |
} | |
//客户端参数 | |
{{ | |
"title": "明天下雨提醒", |
{ | |
"id": "be49bbc5-01bb-4478-a8de-af06e40c617b", | |
"service_name": "明天下雨提醒", | |
"service_id": "2798", | |
"service_description": "明天下雨提醒, 我会提醒你", | |
"tag": "wpmg62o52fbp0dg2n035vhib", | |
"client_fields": { | |
"location": "深圳2" | |
}, | |
"category": { |