Commit 622dbf2c by lra

sms 0.1.2升级

parent 4d46899c
...@@ -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)
......
...@@ -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('https://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
......
module Sms module Sms
VERSION = "0.1.1" VERSION = "0.1.2"
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment