Module: Wechat::Api::Public::Material
- Included in:
- Wechat::Api::Public
- Defined in:
- app/apis/wechat/api/public/material.rb
Constant Summary collapse
- BASE =
'https://api.weixin.qq.com/cgi-bin/'
Instance Method Summary collapse
- #customservice_getonlinekflist ⇒ Object
- #material(media_id) ⇒ Object
- #material_add(type, file) ⇒ Object
- #material_add_news(*news) ⇒ Object
- #material_count ⇒ Object
- #material_delete(media_id) ⇒ Object
- #material_list(type = 'news', offset = 0, count = 20) ⇒ Object
- #media(media_id) ⇒ Object
- #media_create(type, file) ⇒ Object
- #media_hq(media_id) ⇒ Object
- #message_custom_send(message) ⇒ Object
- #message_custom_typing(openid, command = 'Typing') ⇒ Object
Instance Method Details
#customservice_getonlinekflist ⇒ Object
49 50 51 |
# File 'app/apis/wechat/api/public/material.rb', line 49 def customservice_getonlinekflist get 'customservice/getonlinekflist', base: BASE end |
#material(media_id) ⇒ Object
17 18 19 |
# File 'app/apis/wechat/api/public/material.rb', line 17 def material(media_id) get 'material/get', params: { media_id: media_id }, as: :file, base: BASE end |
#material_add(type, file) ⇒ Object
29 30 31 |
# File 'app/apis/wechat/api/public/material.rb', line 29 def material_add(type, file) post_file 'material/add_material', file, params: { type: type }, base: BASE end |
#material_add_news(*news) ⇒ Object
33 34 35 |
# File 'app/apis/wechat/api/public/material.rb', line 33 def material_add_news(*news) post 'material/add_news', articles: news, base: BASE end |
#material_count ⇒ Object
21 22 23 |
# File 'app/apis/wechat/api/public/material.rb', line 21 def material_count get 'material/get_materialcount', base: BASE end |
#material_delete(media_id) ⇒ Object
37 38 39 |
# File 'app/apis/wechat/api/public/material.rb', line 37 def material_delete(media_id) post 'material/del_material', media_id: media_id, base: BASE end |
#material_list(type = 'news', offset = 0, count = 20) ⇒ Object
25 26 27 |
# File 'app/apis/wechat/api/public/material.rb', line 25 def material_list(type = 'news', offset = 0, count = 20) post 'material/batchget_material', type: type, offset: offset, count: count, base: BASE end |
#media(media_id) ⇒ Object
5 6 7 |
# File 'app/apis/wechat/api/public/material.rb', line 5 def media(media_id) get 'media/get', params: { media_id: media_id }, as: :file, base: BASE end |
#media_create(type, file) ⇒ Object
13 14 15 |
# File 'app/apis/wechat/api/public/material.rb', line 13 def media_create(type, file) post_file 'media/upload', file, params: { type: type }, base: BASE end |
#media_hq(media_id) ⇒ Object
9 10 11 |
# File 'app/apis/wechat/api/public/material.rb', line 9 def media_hq(media_id) get 'media/get/jssdk', params: { media_id: media_id }, as: :file, base: BASE end |
#message_custom_send(message) ⇒ Object
41 42 43 |
# File 'app/apis/wechat/api/public/material.rb', line 41 def () post 'message/custom/send', **, base: BASE end |
#message_custom_typing(openid, command = 'Typing') ⇒ Object
45 46 47 |
# File 'app/apis/wechat/api/public/material.rb', line 45 def (openid, command = 'Typing') post 'message/custom/typing', touser: openid, command: command, base: BASE end |