Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sms
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
gems
sms
Commits
622dbf2c
Commit
622dbf2c
authored
Apr 07, 2017
by
lra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sms 0.1.2升级
parent
4d46899c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
2 deletions
+48
-2
lib/sms.rb
+22
-0
lib/sms/taobao.rb
+25
-1
lib/sms/version.rb
+1
-1
No files found.
lib/sms.rb
View file @
622dbf2c
...
@@ -129,6 +129,28 @@ class SmsSender
...
@@ -129,6 +129,28 @@ class SmsSender
[]
[]
end
end
# Example:
# sms_sender = SmsSender.new
# sms_sender.dingtalk_call_set_user_list({
# session: "xxxx",
# staff_id_list: ["xxxx"]
# })
def
dingtalk_call_user
(
opts
=
{})
@source
.
dingtalk_call_user
(
opts
)
end
# Example:
# sms_sender = SmsSender.new
# sms_sender.dingtalk_call_user({
# staff_id: "xxxx",
# session: "xxxx",
# authed_corp_id: "xxxx",
# authed_staff_id: "xxxx"
# })
def
dingtalk_call_set_user_list
(
opts
)
@source
.
dingtalk_call_set_user_list
(
opts
)
end
protected
protected
def
backend
(
translations
)
def
backend
(
translations
)
...
...
lib/sms/taobao.rb
View file @
622dbf2c
...
@@ -10,6 +10,8 @@ module Sms
...
@@ -10,6 +10,8 @@ module Sms
:template_code
,
:param
,
:template_code
,
:param
,
:custom_params
,
:request_params
:custom_params
,
:request_params
attr_accessor
:staff_id
,
:session
,
:authed_corp_id
,
:authed_staff_id
,
:staff_id_list
def
initialize
(
options
=
{})
def
initialize
(
options
=
{})
options
.
each
{
|
k
,
v
|
options
.
each
{
|
k
,
v
|
next
unless
respond_to?
(
k
)
next
unless
respond_to?
(
k
)
...
@@ -73,8 +75,30 @@ module Sms
...
@@ -73,8 +75,30 @@ module Sms
post
post
end
end
def
dingtalk_call_set_user_list
(
opts
=
{})
self
.
custom_params
=
{
method:
' dingtalk.isv.call.setuserlist'
,
session:
session
,
staff_id_list:
staff_id_list
}.
merge
(
opts
)
post
end
def
dingtalk_call_user
(
opts
=
{})
self
.
custom_params
=
{
method:
'dingtalk.isv.call.calluser'
,
staff_id:
staff_id
,
session:
session
,
authed_corp_id:
authed_corp_id
,
authed_staff_id:
authed_staff_id
}.
merge
(
opts
)
post
end
def
post
def
post
res
=
Net
::
HTTP
.
post_form
(
URI
.
parse
(
'http
://gw.api
.taobao.com/router/rest'
),
extend_params
)
res
=
Net
::
HTTP
.
post_form
(
URI
.
parse
(
'http
s://eco
.taobao.com/router/rest'
),
extend_params
)
puts
"
#{
request_params
[
:method
]
}
request params:
#{
request_params
.
inspect
}
"
puts
"
#{
request_params
[
:method
]
}
request params:
#{
request_params
.
inspect
}
"
data
=
res
.
body
data
=
res
.
body
...
...
lib/sms/version.rb
View file @
622dbf2c
module
Sms
module
Sms
VERSION
=
"0.1.
1
"
VERSION
=
"0.1.
2
"
end
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