blsm-mp-wx 0.2.4 → 0.2.5

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
  SHA1:
3
- metadata.gz: 9b1e280500c9517d27b7a84c8795028f0c622e76
4
- data.tar.gz: 97567fef806c56123168565da3ff045ccdc8f50b
3
+ metadata.gz: d532da95333cb9b16e81c75aa30ded8535a6e4e5
4
+ data.tar.gz: 3122e86cdde819a1d7de049046ad5e1ab5b287ce
5
5
  SHA512:
6
- metadata.gz: 2f1fbe6f0b605f0372c0e6e9010f6dbaa45db5f85d2d53c0b51e3302a24e7688d1ec65d82c7639ef3b3fb8b1f8d357669dbd1ba502e030f097b03c9f4d216661
7
- data.tar.gz: e372200ca0b8f0b20cb9cdc13cddbc368f0222427b17fef11998d7f7a212066270772e68ef303c878cca720b1c2b36ad08b52d8d798a22a85e1f47429170d8fc
6
+ metadata.gz: ea4c084a5cf429a75916462f6d91d6550f90bb15bebb12148453bdc07adba244f2101a0bf1697169afb38f451d70248648a5ca293c3c4b3daa76a9d5586936ba
7
+ data.tar.gz: 2c515815789144da68cb6685b99a20d4e1a80136dbe3917ef68fe05108e961312db169a75e48bca2d5b2e3ec761812ff202afbf9d67e7cdbf9545caf47ff7941
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- blsm-mp-wx (0.2.3)
4
+ blsm-mp-wx (0.2.5)
5
5
 
6
6
  GEM
7
7
  remote: https://ruby.taobao.org/
@@ -117,4 +117,4 @@ DEPENDENCIES
117
117
  rspec (~> 3.2)
118
118
 
119
119
  BUNDLED WITH
120
- 1.10.3
120
+ 1.11.2
@@ -1,3 +1,3 @@
1
1
  module BlsmMpWx
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
data/lib/blsm-mp-wx.rb CHANGED
@@ -20,7 +20,7 @@ module BlsmMpWx
20
20
  attr_accessor :APP_ID
21
21
  attr_accessor :APP_ID_2
22
22
 
23
- MP_MSG_TYPES = %w(new_order balance score_change distribute custom split_order order todo) #微信公众号消息类型
23
+ # MP_MSG_TYPES = %w(new_order balance score_change account_change distribute custom split_order order todo) #微信公众号消息类型
24
24
 
25
25
  #根据app_id获取access_token
26
26
  #系统会根据当前的access_token即过期时间,自动更新并返回
@@ -218,30 +218,30 @@ module BlsmMpWx
218
218
  # new_order => content: {touser:'openid',order_id:''} 系统自动优先使用模板消息发送通知
219
219
  # balance => content: {touser:'openid',clearing_id} 系统自动优先使用模板消息发送通知
220
220
  # score_change => content: {touser:'',change:5,total:25,content:'邀请他人。。。。'}
221
- def create_msg(app_id=nil, openid, content, msg_name)
221
+ def create_msg(app_id=nil, openid, content, msg_name, template_msg=false)
222
222
  app_id ||= self.APP_ID
223
223
  return nil unless openid
224
224
  return nil unless content[:touser]==openid
225
- return nil unless MP_MSG_TYPES.include?(msg_name)
225
+ # return nil unless MP_MSG_TYPES.include?(msg_name)
226
226
  VdMpMsg.create({
227
227
  app_id: app_id,
228
228
  openid: openid,
229
229
  content: content.to_json,
230
230
  msg_name: msg_name,
231
- template_msg: MP_MSG_TYPES.include?(msg_name),
231
+ template_msg: template_msg,
232
232
  status: 'none'
233
233
  })
234
234
  end
235
235
 
236
236
 
237
- def create_msg!(app_id=nil, openid, content, msg_name)
237
+ def create_msg!(app_id=nil, openid, content, msg_name, template_msg=false)
238
238
  app_id ||= self.APP_ID
239
239
  VdMpMsg.create!({
240
240
  app_id: app_id,
241
241
  openid: openid,
242
242
  content: content.to_json,
243
243
  msg_name: msg_name,
244
- template_msg: MP_MSG_TYPES.include?(msg_name),
244
+ template_msg: template_msg,
245
245
  status: 'none'
246
246
  })
247
247
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blsm-mp-wx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - saxer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-15 00:00:00.000000000 Z
11
+ date: 2016-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -136,7 +136,7 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0.9'
139
- description: 包括access_token、js_api_ticket的获取,发送消息,模板消息,生成二维码,获取用户信息等。
139
+ description: "包括access_token、js_api_ticket的获取,发送消息,模板消息,生成二维码,获取用户信息等。"
140
140
  email:
141
141
  - 15201280641@qq.com
142
142
  executables: []
@@ -178,8 +178,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  version: '0'
179
179
  requirements: []
180
180
  rubyforge_project:
181
- rubygems_version: 2.4.6
181
+ rubygems_version: 2.4.3
182
182
  signing_key:
183
183
  specification_version: 4
184
- summary: 首趣微店微信公众号基本模块
184
+ summary: "首趣微店微信公众号基本模块"
185
185
  test_files: []