aliyun-rails 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8fc1dbec7b764f807056f0f18e0f1f39bf8e2cc22292bd22d9c961d1a5946bea
4
- data.tar.gz: 33574a813a8df2ef5bfd073fb0de6741edf2850690bce64f5941b5ed0b228adf
3
+ metadata.gz: add5b748d6ea374d744363efa78050f60a3bd35f468a899b5ae8dfba75b65776
4
+ data.tar.gz: 68082b8b4b235d2b629186baebc0cc16f551abb2a6e450e3df59d2b5fa7fe3a0
5
5
  SHA512:
6
- metadata.gz: 19c2df4717e7c95c83348b31ab98b8fa6225e8d0c67e44367071c778615a681284fd6aba5393e8b92630d4ca8236c957521046fa7a6011885a2104727ed55554
7
- data.tar.gz: c387845817a3214c0576fda0b0d367d03c0fdad3b3d09eda8507a6e658ee36333f1c5623cc5b575be62f1ee305f03caec35b0613581f0f6ea6cb2e91e19630b7
6
+ metadata.gz: 27fb3cc8491a59d769ef0c52ad9583926806362aaf6280585ab898279024c457124e5b24af4ed4f1168848a004a3d5991ec40ef6b7763915d602d8557c454813
7
+ data.tar.gz: e21e261ef6659c4fc26aef50678e57e77d7aafc5f793ce8eed26157fc8ea810eca1cf4b53db58f85619a10937489cb30878c154c4a2d04d7fe36ac0a5ce66c0b
@@ -2,12 +2,16 @@
2
2
 
3
3
  require_relative "rails/version"
4
4
 
5
+ require "aliyun/rails/version"
5
6
  require "aliyun/rails/connector/roa_client"
6
7
  require "aliyun/rails/connector/rpc_client"
8
+ require "aliyun/rails/dysms"
9
+ require "aliyun/rails/dyvms"
7
10
 
8
11
  module Aliyun
9
12
  module Rails
10
13
  class Error < StandardError; end
14
+
11
15
  # Your code goes here...
12
16
  end
13
17
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "faraday"
2
4
  require "securerandom"
3
5
  require "active_support/all"
@@ -14,7 +16,6 @@ module Aliyun
14
16
  module Rails
15
17
  module Connector
16
18
  class ROAClient
17
-
18
19
  attr_accessor :endpoint, :api_version, :access_key_id,
19
20
  :access_key_secret, :security_token, :hostname, :opts
20
21
 
@@ -161,7 +162,6 @@ module Aliyun
161
162
  super("#{message} host_id: #{host_id}, request_id: #{request_id}")
162
163
  end
163
164
  end
164
-
165
165
  end
166
166
  end
167
167
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "set"
2
4
  require "openssl"
3
5
  require "faraday"
@@ -17,7 +19,6 @@ module Aliyun
17
19
 
18
20
  # 对象初始化属性
19
21
  def initialize(config = configure, verbose = false)
20
-
21
22
  validate config
22
23
 
23
24
  self.endpoint = config[:endpoint]
@@ -1,26 +1,28 @@
1
- module Aliyun::Rails
2
- class Dysms < Aliyun::Rails::Connector::RPCClient
1
+ # frozen_string_literal: true
3
2
 
4
- # 本产品(Dysmsapi/2017-05-25)的OpenAPI采用RPC签名风格,签名细节参见签名机制说明。
5
- # 我们已经为开发者封装了常见编程语言的SDK,开发者可通过下载SDK直接调用本产品OpenAPI而无需关心技术细节。
6
- def initialize(config, verbose = nil)
3
+ module Aliyun
4
+ module Rails
5
+ class Dysms < Aliyun::Rails::Connector::RPCClient
6
+ # 本产品(Dysmsapi/2017-05-25)的OpenAPI采用RPC签名风格,签名细节参见签名机制说明。
7
+ # 我们已经为开发者封装了常见编程语言的SDK,开发者可通过下载SDK直接调用本产品OpenAPI而无需关心技术细节。
8
+ def initialize(config, verbose = nil)
9
+ config["endpoint"] = "http://dysmsapi.aliyuncs.com"
10
+ config["api_version"] = "2017-05-25"
7
11
 
8
- config["endpoint"] = "http://dysmsapi.aliyuncs.com"
9
- config["api_version"] = "2017-05-25"
12
+ super
13
+ end
10
14
 
11
- super
12
- end
13
-
14
- # 发送短信,发送前要申请短信签名和短信模板,并确保签名和模板已审核通过。
15
- def send_sms(phone_numbers, template_code, template_param, sign_name = "")
16
- params = {
17
- PhoneNumbers: phone_numbers,
18
- SignName: sign_name,
19
- TemplateCode: template_code,
20
- TemplateParam: template_param.to_json
21
- }
22
- opts = { method: "POST", timeout: 15000 }
23
- request(action: "SendSms", params: params, opts: opts)
15
+ # 发送短信,发送前要申请短信签名和短信模板,并确保签名和模板已审核通过。
16
+ def send_sms(phone_numbers, template_code, template_param, sign_name = "")
17
+ params = {
18
+ PhoneNumbers: phone_numbers,
19
+ SignName: sign_name,
20
+ TemplateCode: template_code,
21
+ TemplateParam: template_param.to_json
22
+ }
23
+ opts = { method: "POST", timeout: 15000 }
24
+ request(action: "SendSms", params: params, opts: opts)
25
+ end
24
26
  end
25
27
  end
26
28
  end
@@ -1,26 +1,28 @@
1
- module Aliyun::Rails
2
- class Dysms < Aliyun::Rails::Connector::RPCClient
1
+ # frozen_string_literal: true
3
2
 
4
- # 本产品(Dyvmsapi/2017-05-25)的OpenAPI采用RPC签名风格,签名细节参见签名机制说明。
5
- # 我们已经为开发者封装了常见编程语言的SDK,开发者可通过下载SDK直接调用本产品OpenAPI而无需关心技术细节。
6
- def initialize(config, verbose = nil)
3
+ module Aliyun
4
+ module Rails
5
+ class Dysms < Aliyun::Rails::Connector::RPCClient
6
+ # 本产品(Dyvmsapi/2017-05-25)的OpenAPI采用RPC签名风格,签名细节参见签名机制说明。
7
+ # 我们已经为开发者封装了常见编程语言的SDK,开发者可通过下载SDK直接调用本产品OpenAPI而无需关心技术细节。
8
+ def initialize(config, verbose = nil)
9
+ config["endpoint"] = "http://dyvmsapi.aliyuncs.com"
10
+ config["api_version"] = "2017-05-25"
7
11
 
8
- config["endpoint"] = "http://dyvmsapi.aliyuncs.com"
9
- config["api_version"] = "2017-05-25"
12
+ super
13
+ end
10
14
 
11
- super
12
- end
13
-
14
- # 调用SingleCallByTts接口向指定号码发送语音验证码和带参数变量的语音通知
15
- def single_call_by_tts(called_show_number, called_number, tts_code, tts_param)
16
- params = {
17
- CalledShowNumber: called_show_number,
18
- CalledNumber: called_number,
19
- TtsCode: tts_code,
20
- TtsParam: tts_param.to_json
21
- }
22
- opts = { method: "POST", timeout: 15000 }
23
- request(action: "SendSms", params: params, opts: opts)
15
+ # 调用SingleCallByTts接口向指定号码发送语音验证码和带参数变量的语音通知
16
+ def single_call_by_tts(called_show_number, called_number, tts_code, tts_param)
17
+ params = {
18
+ CalledShowNumber: called_show_number,
19
+ CalledNumber: called_number,
20
+ TtsCode: tts_code,
21
+ TtsParam: tts_param.to_json
22
+ }
23
+ opts = { method: "POST", timeout: 15000 }
24
+ request(action: "SendSms", params: params, opts: opts)
25
+ end
24
26
  end
25
27
  end
26
28
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Aliyun
4
4
  module Rails
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  DEFAULT_UA = "AlibabaCloud (#{Gem::Platform.local.os}; " +
7
7
  "#{Gem::Platform.local.cpu}) Ruby/#{RUBY_VERSION} Core/#{VERSION}"
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aliyun-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - WENWU.YAN