dingxin-sms 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71eadaf01c5a9ab48cea43ba0c546329079cad30ccf8e6f411e955672a83dc28
4
- data.tar.gz: 35c6246ba4b89fec3f51e2c4342e0f9a481a431197ec46fe0e94ea3a95a84296
3
+ metadata.gz: a749a3e2bf9013f803ccc7fb5026fabe3ab0702c3618332129f816111bcbe274
4
+ data.tar.gz: de0a988ba67fae376a2b5cc906cb8d51342a37b08184f8403ee286908f23b558
5
5
  SHA512:
6
- metadata.gz: fabc3c2eea30d505b0d357e2cf94d63547b6f67f75b27c89cc40d556e27badc0eede5f499dc951a40841498695f04b6f156f0881df595cb8a6ed59391b380147
7
- data.tar.gz: f3d11077a7ae102e8d0e5163105d4c699dc866a0d06bdc8a6673dade4cbece4f23f24cd651474025d01a57f8b9d1cf3d2d488b568dc829a8d76488aa96fbf570
6
+ metadata.gz: 041e453f612f0cf8dc9956226456e84cea00aea89653359eabf85f159ff16e026fd39df3057af170ab5e5611d2b407ba6dea61d94a3f10b487dbbe906b962fbb
7
+ data.tar.gz: 2be7f8a1f549b648ac7dd896f7c7d4ae04951418475bf514642c6bb230f0e503ac394169f85f5df050f2a54907cab2f2f7c14ef3e14c2af3595f97b395142fce
data/README.md CHANGED
@@ -60,7 +60,7 @@ require 'dingxin/sms'
60
60
  可以改为 Github 安装源,例如 Rails Gemfile 文件引用可以改为下面格式,即可正确安装。
61
61
 
62
62
  ```ruby
63
- gem 'dingxin-sms', '0.0.1', git: 'https://github.com/kejincan0527/dingxin-sms.git'
63
+ gem 'dingxin-sms', '0.0.2', git: 'https://github.com/kejincan0527/dingxin-sms.git'
64
64
  ```
65
65
 
66
66
  ## Usage 使用
@@ -130,6 +130,8 @@ mobile = '15912345678'
130
130
  tpl_id = 'TP1711063'
131
131
  param = 'asin:B01E7LLKT2'
132
132
  Dingxin::Sms.send(mobile, tpl_id, param)
133
+
134
+ Dingxin::Sms.long_send(mobile, tpl_id, param) # 134字符超长短信
133
135
  ...
134
136
  ```
135
137
 
@@ -35,11 +35,26 @@ module Dingxin
35
35
  headers: { "Authorization" => "APPCODE #{configuration.app_code}" })
36
36
  end
37
37
 
38
+ # curl -i -X POST 'http://dingxin2.market.alicloudapi.com/dx/longSendSms?mobile=159XXXX9999&param=param&tpl_id=TP1802095' -H 'Authorization:APPCODE 你自己的AppCode'
39
+ def long_send(mobile, tpl_id, param)
40
+ Typhoeus.post(get_long_url({
41
+ 'mobile' => mobile,
42
+ 'tpl_id' => tpl_id,
43
+ 'param' => param
44
+ }),
45
+ headers: { "Authorization" => "APPCODE #{configuration.app_code}" })
46
+ end
47
+
38
48
  def get_url(params)
39
49
  coded_params = canonicalized_query_string(params)
40
50
  url = 'http://dingxin.market.alicloudapi.com/dx/sendSms?' + coded_params
41
51
  end
42
52
 
53
+ def get_long_url(params)
54
+ coded_params = canonicalized_query_string(params)
55
+ url = 'http://dingxin2.market.alicloudapi.com/dx/longSendSms?' + coded_params
56
+ end
57
+
43
58
  # 对字符串进行 PERCENT 编码
44
59
  # https://apidock.com/ruby/ERB/Util/url_encode
45
60
  def encode(input)
@@ -1,5 +1,5 @@
1
1
  module Dingxin
2
2
  module Sms
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dingxin-sms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wells Muker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-22 00:00:00.000000000 Z
11
+ date: 2019-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler