ali_dayu 0.1.0 → 0.1.2

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
  SHA1:
3
- metadata.gz: 3b0d84da374371e4362eeec0942941d9d3a2b870
4
- data.tar.gz: 4c80110502d6bbd09811695794c9943c0e12fb34
3
+ metadata.gz: fc34750edc96f796dfd3056debf04feb2ddee680
4
+ data.tar.gz: a03241394364c68a0a607898e9f433c9568b51fc
5
5
  SHA512:
6
- metadata.gz: 850253d507f50a356fb7e4cb5df7310d2354ebf57953e397a82d6c155d604c9e6263337e3dfbbcbaa350a35078edc072205ce3b4aa06379009dd5a08a98f3bc4
7
- data.tar.gz: ac2e1a96d2d6006443250eb2037a8f48fac4c75216455bd9fe22c7721431b58d8a02a9f2ad4b1bfb2a46b3397e99e78bdf10d1f9ced1e01dee944604c22ffd52
6
+ metadata.gz: 7a1bf5dad0fc17e01dd04230e9c65807a3afd4fd795d0f854d95e1fb8d1f44049928dab6099a13b9c90c9b5991e4682d54a2cf3f145c94a58ea2b500e2700fec
7
+ data.tar.gz: 5c80a8b94d0e321419ac90d3049374422a95e6a224fbc7f506998d0630d288806d98d5b639610276cd90d8536c0f4d987c173a9531d81ebc1fe67829d5b0a4d9
data/README.md CHANGED
@@ -1,39 +1,54 @@
1
- # AliDayu
1
+ # ali_dayu 简介
2
2
 
3
- 阿里大鱼的短信、语音发送
3
+ * 支持阿里大鱼的短信发送: `alibaba.aliqin.fc.sms.num.send`
4
+ * 支持阿里大鱼文本转语音: `alibaba.aliqin.fc.tts.num.singlecall`
4
5
 
5
- ## Installation
6
+ # ali_dayu 安装
6
7
 
7
- Add this line to your application's Gemfile:
8
-
9
- ```ruby
10
- gem 'ali_dayu'
11
- ```
12
-
13
- And then execute:
8
+ $ gem install ali_dayu
14
9
 
15
- $ bundle
10
+ # ali_dayu 使用
11
+ #### 生成配置文件
12
+ 1.执行 `rails g ali_dayu` 生成配置文件 `config/initialiers/ali_dayu.rb`
16
13
 
17
- Or install it yourself as:
14
+ 2.替换 `app_key`、`app_secret`、`post_url`
18
15
 
19
- $ gem install ali_dayu
16
+ ```
17
+ AliDayu.app_key = "YOUR_APP_KEY"
18
+ AliDayu.app_secret = "YOUR_APP_SECRET"
19
+ AliDayu.post_url = "YOUR_POST_URL"
20
+ ```
20
21
 
21
- ## Usage
22
+ #### 发送验证码
23
+ 1.短信
22
24
 
25
+ ```
26
+ AliDayu.sms_send('18600251122', {code: '123456', product: ''}, 'SMS_11585207', '进货宝')
27
+ AliDayu.sms_send('18600251122', {code: '123456', product: ''}, 'SMS_11585207', '进货宝', '', {})
28
+ ```
23
29
 
24
- AliDayu.app_key = "23492851"
25
- AliDayu.app_secret = "913d361c4d210badaaa759d2bddc8e0c"
26
- AliDayu.post_url = "http://gw.api.taobao.com/router/rest"
27
- #AliDayu.sms_send('18600256695', {code: '123456', product: '进货宝'}, 'SMS_22585207', '进货宝')
28
- AliDayu.voice_send('18600256695', {product: '进货宝', code: '123456'}, 'TTS_22585215', '051482043260')
30
+ * 第一个参数:短信接收号码,多个号码以英文逗号分隔
31
+ * 第二个参数:短信模板变量
32
+ * 第三个参数:短信模板ID
33
+ * 第四个参数:短信签名
34
+ * 第五个参数:公共回传参数,可为空
35
+ * 第六个参数:配置`app_key`、`app_secret`、`post_url`,可为空(默认使用配置文件中的设置)。此选项可满足一个项目中使用多个阿里大于应用(app_key)
29
36
 
30
- ## Development
37
+ 2.语音
31
38
 
32
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
39
+ ```
40
+ AliDayu.voice_send('18600251122', {product: '', code: '123456'}, 'TTS_22511215', '051482043260')
41
+ AliDayu.voice_send('18600251122', {product: '', code: '123456'}, 'TTS_22511215', '051482043260', '', {})
42
+ ```
33
43
 
34
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
44
+ * 第一个参数:语音接收号码
45
+ * 第二个参数:文本转语音(TTS)模板变量
46
+ * 第三个参数:语音(TTS)模板ID
47
+ * 第四个参数:被叫号显
48
+ * 第五个参数:公共回传参数,可为空
49
+ * 第六个参数:配置`app_key`、`app_secret`、`post_url`,可为空(默认使用配置文件中的设置)。此选项可满足一个项目中使用多个阿里大于应用(app_key)
35
50
 
36
- ## Contributing
51
+ # Contributing
37
52
 
38
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ali_dayu.
53
+ Bug reports and pull requests are welcome on GitHub at https://github.com/WindStill/ali_dayu.
39
54
 
@@ -1,3 +1,3 @@
1
1
  module AliDayu
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -0,0 +1,10 @@
1
+ require 'rails/generators'
2
+ class AliDayuGenerator < Rails::Generators::Base
3
+
4
+ source_root File.expand_path('../templates', __FILE__)
5
+
6
+ def install
7
+ template "ali_dayu_setup.rb", "config/initializers/ali_dayu.rb"
8
+ end
9
+
10
+ end
@@ -0,0 +1,10 @@
1
+ # ali_dayu config
2
+
3
+ AliDayu.app_key = "YOUR_APP_KEY"
4
+ AliDayu.app_secret = "YOUR_APP_SECRET"
5
+ AliDayu.post_url = "YOUR_POST_URL"
6
+
7
+ # demo
8
+ #AliDayu.app_key = "23451281"
9
+ #AliDayu.app_secret = "111d361c4d222badaaa759d2bddc8888"
10
+ #AliDayu.post_url = "http://gw.api.taobao.com/router/rest"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ali_dayu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - windstill
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-27 00:00:00.000000000 Z
11
+ date: 2016-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -73,6 +73,8 @@ files:
73
73
  - lib/ali_dayu/sms.rb
74
74
  - lib/ali_dayu/version.rb
75
75
  - lib/ali_dayu/voice.rb
76
+ - lib/generators/ali_dayu_generator.rb
77
+ - lib/generators/templates/ali_dayu_setup.rb
76
78
  homepage: https://github.com/WindStill/ali_dayu
77
79
  licenses:
78
80
  - MIT