Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
weixin_authorize
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
weixin_authorize
Commits
7cd61b21
Commit
7cd61b21
authored
May 27, 2016
by
wikimo
Committed by
lanrion
May 27, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[wikimo] add send_mpnews_custom with media_id (#91)
parent
5c108307
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
lib/weixin_authorize/api/custom.rb
+15
-0
spec/api/custom_spec.rb
+4
-0
No files found.
lib/weixin_authorize/api/custom.rb
View file @
7cd61b21
...
...
@@ -62,6 +62,21 @@ module WeixinAuthorize
http_post
(
custom_base_url
,
message
)
end
# 根据media_id发送图文消息
# {
# "touser":"OPENID",
# "msgtype":"mpnews",
# "mpnews":
# {
# "media_id":"MEDIA_ID"
# }
# }
def
send_mpnews_custom
(
to_user
,
media_id
,
options
=
{})
mpnews_options
=
{
media_id:
media_id
}.
merge
(
options
)
message
=
default_options
(
to_user
,
"mpnews"
).
merge
({
mpnews:
mpnews_options
})
http_post
(
custom_base_url
,
message
)
end
# 发送音乐消息
# {
# "touser":"OPENID",
...
...
spec/api/custom_spec.rb
View file @
7cd61b21
...
...
@@ -44,6 +44,10 @@ describe WeixinAuthorize::Api::Custom do
pending
(
"The test must have a media_id"
)
end
it
"#send_mpnews_custom"
do
pending
(
"The test must have a media_id"
)
end
it
"#send_music_custom"
do
pending
(
"The test must have a media_id"
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment