Class: PushV3Client
- Inherits:
-
Object
show all
- Includes:
- CommonHelper
- Defined in:
- lib/mobpush/client/push/push_v3_client.rb
Class Attribute Summary collapse
Instance Method Summary
collapse
-
#cancelPushTask(workId) ⇒ Object
-
#getPushByBatchId(batchId) ⇒ Object
-
#getPushByWorkno(workno) ⇒ Object
-
#pushAll(workNo, title, content) ⇒ Object
-
#pushByAlias(workNo, title, content, *alia) ⇒ Object
-
#pushByAreas(workNo, title, content, pushAreas) ⇒ Object
-
#pushByRids(workNo, title, content, *rids) ⇒ Object
-
#pushByTags(workNo, title, content, *tags) ⇒ Object
-
#pushTaskV3(push) ⇒ Object
-
#pushTaskV3ByBuilder(builder) ⇒ Object
-
#recallPushTask(workId) ⇒ Object
-
#replacePushTask(workId, content) ⇒ Object
#hash2os, #os2hash, #sanitze_hash
Class Attribute Details
.CANCEL_TASK_URI ⇒ Object
Returns the value of attribute CANCEL_TASK_URI.
16
17
18
|
# File 'lib/mobpush/client/push/push_v3_client.rb', line 16
def CANCEL_TASK_URI
@CANCEL_TASK_URI
end
|
.GET_BY_WORKID_URI ⇒ Object
Returns the value of attribute GET_BY_WORKID_URI.
16
17
18
|
# File 'lib/mobpush/client/push/push_v3_client.rb', line 16
def GET_BY_WORKID_URI
@GET_BY_WORKID_URI
end
|
.GET_BY_WORKNO_URI ⇒ Object
Returns the value of attribute GET_BY_WORKNO_URI.
16
17
18
|
# File 'lib/mobpush/client/push/push_v3_client.rb', line 16
def GET_BY_WORKNO_URI
@GET_BY_WORKNO_URI
end
|
.PUSH_URI ⇒ Object
Returns the value of attribute PUSH_URI.
16
17
18
|
# File 'lib/mobpush/client/push/push_v3_client.rb', line 16
def PUSH_URI
@PUSH_URI
end
|
.RECALL_TASK_URI ⇒ Object
Returns the value of attribute RECALL_TASK_URI.
16
17
18
|
# File 'lib/mobpush/client/push/push_v3_client.rb', line 16
def RECALL_TASK_URI
@RECALL_TASK_URI
end
|
.REPLACE_TASK_URI ⇒ Object
Returns the value of attribute REPLACE_TASK_URI.
16
17
18
|
# File 'lib/mobpush/client/push/push_v3_client.rb', line 16
def REPLACE_TASK_URI
@REPLACE_TASK_URI
end
|
Instance Method Details
#cancelPushTask(workId) ⇒ Object
51
52
53
54
|
# File 'lib/mobpush/client/push/push_v3_client.rb', line 51
def cancelPushTask(workId)
params = {:batchId => workId}
MobHTTP.post(MobPushConfig.baseUrl + PushV3Client.CANCEL_TASK_URI, nil, params)
end
|
#getPushByBatchId(batchId) ⇒ Object
66
67
68
69
|
# File 'lib/mobpush/client/push/push_v3_client.rb', line 66
def getPushByBatchId(batchId)
params = {:workId => batchId}
MobHTTP.post(MobPushConfig.baseUrl + PushV3Client.GET_BY_WORKID_URI, nil, params)
end
|
#getPushByWorkno(workno) ⇒ Object
71
72
73
74
|
# File 'lib/mobpush/client/push/push_v3_client.rb', line 71
def getPushByWorkno(workno)
params = {:workno => workno}
MobHTTP.post(MobPushConfig.baseUrl + PushV3Client.GET_BY_WORKNO_URI, nil, params)
end
|
#pushAll(workNo, title, content) ⇒ Object
31
32
33
|
# File 'lib/mobpush/client/push/push_v3_client.rb', line 31
def pushAll(workNo, title, content)
pushTaskV3ByBuilder(PushWorkBuilder.new(workNo, title, content).targetAll())
end
|
#pushByAlias(workNo, title, content, *alia) ⇒ Object
35
36
37
|
# File 'lib/mobpush/client/push/push_v3_client.rb', line 35
def pushByAlias(workNo, title, content, *alia)
pushTaskV3ByBuilder(PushWorkBuilder.new(workNo, title, content).targetAlias(alia))
end
|
#pushByAreas(workNo, title, content, pushAreas) ⇒ Object
47
48
49
|
# File 'lib/mobpush/client/push/push_v3_client.rb', line 47
def pushByAreas(workNo, title, content, pushAreas)
pushTaskV3ByBuilder(PushWorkBuilder.new(workNo, title, content).targetAreas(pushAreas))
end
|
#pushByRids(workNo, title, content, *rids) ⇒ Object
43
44
45
|
# File 'lib/mobpush/client/push/push_v3_client.rb', line 43
def pushByRids(workNo, title, content, *rids)
pushTaskV3ByBuilder(PushWorkBuilder.new(workNo, title, content).targetRids(rids))
end
|
39
40
41
|
# File 'lib/mobpush/client/push/push_v3_client.rb', line 39
def pushByTags(workNo, title, content, *tags)
pushTaskV3ByBuilder(PushWorkBuilder.new(workNo, title, content).targetTags(tags))
end
|
#pushTaskV3(push) ⇒ Object
22
23
24
25
|
# File 'lib/mobpush/client/push/push_v3_client.rb', line 22
def pushTaskV3(push)
url = MobPushConfig.baseUrl + PushV3Client.PUSH_URI
MobHTTP.post(url, nil, os2hash(push))
end
|
#pushTaskV3ByBuilder(builder) ⇒ Object
27
28
29
|
# File 'lib/mobpush/client/push/push_v3_client.rb', line 27
def pushTaskV3ByBuilder(builder)
pushTaskV3(builder.build())
end
|
#recallPushTask(workId) ⇒ Object
61
62
63
64
|
# File 'lib/mobpush/client/push/push_v3_client.rb', line 61
def recallPushTask(workId)
params = {:batchId => workId}
MobHTTP.post(MobPushConfig.baseUrl + PushV3Client.RECALL_TASK_URI, nil, params)
end
|
#replacePushTask(workId, content) ⇒ Object
56
57
58
59
|
# File 'lib/mobpush/client/push/push_v3_client.rb', line 56
def replacePushTask(workId, content)
params = {:batchId => workId, :content => content}
MobHTTP.post(MobPushConfig.baseUrl + PushV3Client.REPLACE_TASK_URI, nil, params)
end
|