Skip to content

Instantly share code, notes, and snippets.

@xiezefan
xiezefan / gist:7aa41f5abdb52c62d3c5
Last active August 29, 2015 14:06
API /service 返回JSON示例
//type :0:需要客户端输入,1:需要客户端选择,2:无需客户端输入,3无需客户端参数并且已关注
[
{
"id": "2406",
"title": "微信热榜",
"description": "热门微信文章分类看",
"create_time": 1416303843211,
"type": 1,
"service_options": [
{
@xiezefan
xiezefan / 新增LBS标示
Last active August 29, 2015 14:06
API /user/followed 返回JSON示例
//服务名显示: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": {
@xiezefan
xiezefan / gist:e74a877df7c36a1fe5ca
Last active August 29, 2015 14:06
POST /service/{serviceId}/{clientServiceId}/push 对特定ClientService进行推送
// 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"
}
@xiezefan
xiezefan / gist:79f0db653e3951835351
Created September 16, 2014 04:11
Dingdang Developer API Doc

Dingdang Developer API Doc

POST /service/{serviceId}/{clientServiceId}/push 对特定ClientService进行推送 传入参数:JSON 参数示例:

// push ding to all
{
   "audience" : "all",
   "type": "DING"
}
@xiezefan
xiezefan / gist:f8ecd568eb275fc39eb3
Created September 17, 2014 02:27
Message推送历史JSON
[
{
"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",
@xiezefan
xiezefan / Client Field Type Design
Last active August 29, 2015 14:06
Client Field Type Design
### Client Field Type Design
@xiezefan
xiezefan / gist:bf27dd9cb634d002fcd1
Created September 17, 2014 02:35
DingDang Redis 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", ...}
@xiezefan
xiezefan / gist:53c4c21b1fdf6b8938d6
Last active August 29, 2015 14:06
创建服务JSON 结构
//无客户端参数
{
"title": "明天下雨提醒",
"description": "明天下雨提醒, 我会提醒你",
"category_id": "1",
"notify_url": "http://127.0.0.1:9999"
}
//客户端参数
{{
"title": "明天下雨提醒",
@xiezefan
xiezefan / gist:037fb067625a69a857ff
Last active August 29, 2015 14:06
API Service Follow Response
{
"id": "be49bbc5-01bb-4478-a8de-af06e40c617b",
"service_name": "明天下雨提醒",
"service_id": "2798",
"service_description": "明天下雨提醒, 我会提醒你",
"tag": "wpmg62o52fbp0dg2n035vhib",
"client_fields": {
"location": "深圳2"
},
"category": {