wechat 0.11.9 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +4 -372
- data/README-CN.md +8 -2
- data/README.md +8 -2
- data/bin/wechat +10 -3
- data/lib/action_controller/wechat_responder.rb +15 -23
- data/lib/generators/wechat/config_generator.rb +1 -1
- data/lib/generators/wechat/session_generator.rb +1 -1
- data/lib/generators/wechat/templates/app/models/wechat_config.rb +1 -1
- data/lib/wechat.rb +27 -12
- data/lib/wechat/api.rb +8 -6
- data/lib/wechat/api_base.rb +3 -2
- data/lib/wechat/api_loader.rb +14 -2
- data/lib/wechat/cipher.rb +3 -3
- data/lib/wechat/concern/common.rb +4 -6
- data/lib/wechat/concern/qcloud.rb +115 -0
- data/lib/wechat/controller_api.rb +3 -3
- data/lib/wechat/corp_api.rb +7 -6
- data/lib/wechat/helpers.rb +1 -7
- data/lib/wechat/http_client.rb +7 -7
- data/lib/wechat/message.rb +5 -4
- data/lib/wechat/mp_api.rb +9 -6
- data/lib/wechat/qcloud/token.rb +66 -0
- data/lib/wechat/responder.rb +13 -43
- data/lib/wechat/ticket/corp_jsapi_ticket.rb +0 -2
- data/lib/wechat/ticket/public_jsapi_ticket.rb +0 -2
- data/lib/wechat/token/corp_access_token.rb +0 -2
- data/lib/wechat/token/public_access_token.rb +0 -2
- metadata +67 -37
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 983ca9ebf1007ad2f68e079d7ed625c59a10e78198992abf84a5b9718592ff26
|
4
|
+
data.tar.gz: 976751bb11aba9a0fa30674a39eaef432eb39c177a315b396d95c458c0afde45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aeee17ba746530fbab18470172d83df90ff995ebdfa9ec92866361bbeacda03848e11a8ea278db6544ea57774513754b2dd914e7891154ca1344a03f8c5c4288
|
7
|
+
data.tar.gz: c22640b41f4d4d2d2cc01b7dd3568c76d6896f976d79f3d65c2ffb9dff975cb7ed6e0463b62b1f2991b6ec80494f96e263a3d330ee5661446dec7a075e063fc7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,376 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## v0.
|
3
|
+
## v0.13.0 (released at 3/3/2021)
|
4
4
|
|
5
|
-
*
|
5
|
+
* Support zeitwerk only and Rails 6+ only.
|
6
|
+
* Support Ruby 2.6+ only.
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
* ADD: Wechat::CorpApi.news_message_send
|
10
|
-
* FIX: Wechat API Change material/get_material. reported by @0000sir #275
|
11
|
-
|
12
|
-
## v0.11.7 (released at 11/15/2019)
|
13
|
-
|
14
|
-
* ADD: Wechat::MpApi.subscribe_message_send. by @paicha #271
|
15
|
-
* FIX: FrozenError: can't modify frozen String. by @paicha #272
|
16
|
-
* New translatecontent support.
|
17
|
-
|
18
|
-
## v0.11.6 (released at 09/02/2019)
|
19
|
-
|
20
|
-
* Fix private method `next_migration_number` introduced at #267, by @zpdsky #270
|
21
|
-
* Give more clear warning about missing Rails in console. by @emtfe #268
|
22
|
-
|
23
|
-
## v0.11.5 (released at 08/30/2019)
|
24
|
-
|
25
|
-
* Add rubocop check in CI by @hophacker #267
|
26
|
-
* Support Rails 6 and Windows at #266
|
27
|
-
|
28
|
-
## v0.11.4 (released at 08/15/2019)
|
29
|
-
|
30
|
-
* rails 6 redirect_to use allow_other_host: true by @Chen-George-Zhen #263
|
31
|
-
|
32
|
-
## v0.11.3 (released at 07/02/2019)
|
33
|
-
|
34
|
-
* New addvoicetorecofortext and queryrecoresultfortext support.
|
35
|
-
* improve existing class detect by @3014zhangshuo #261
|
36
|
-
* new wxa_get_wxacode_unlimit API for miniapp by @paicha #260
|
37
|
-
|
38
|
-
## v0.11.2 (released at 05/08/2019)
|
39
|
-
|
40
|
-
* bugfix short_url to shorturl in wechat console tool by @yuanxinyu #259
|
41
|
-
* allow a message to be sent to a party (department) by @hophacker #256
|
42
|
-
|
43
|
-
## v0.11.1 (released at 03/01/2019)
|
44
|
-
|
45
|
-
* Let Message support markdown, text included; allow textcard btntxt to be omitted by @hophacker #251
|
46
|
-
* Enterprise account add checkin api by @hophacker #254
|
47
|
-
* Suggest use secret to differentiate different acces_tokens and tickets in Enterprise account by @hophacker #255
|
48
|
-
|
49
|
-
|
50
|
-
## v0.11.0 (released at 01/22/2019)
|
51
|
-
|
52
|
-
* Support Ruby 2.6.0 official
|
53
|
-
* Bump http gem to 4.0
|
54
|
-
* New clear quota API by @3014zhangshuo #244
|
55
|
-
* Wechat::Message support textcard by @hophacker #249
|
56
|
-
* New getusersummary and getusercumulate API #247
|
57
|
-
|
58
|
-
## v0.10.3 (released at 10/07/2018)
|
59
|
-
|
60
|
-
* Fix new share problem in iOS by @killernova #242
|
61
|
-
|
62
|
-
## v0.10.2 (released at 8/27/2018)
|
63
|
-
|
64
|
-
* Fix incompatible with Rails 5.2.1 by @chloerei #239
|
65
|
-
|
66
|
-
## v0.10.1 (released at 7/1/2018)
|
67
|
-
|
68
|
-
* Allow custom_message_send using Hash as message, previous only allow Wechat::Message. by @zuoliang0 and @fogisland #234
|
69
|
-
|
70
|
-
## v0.10.0 (released at 5/31/2018)
|
71
|
-
|
72
|
-
* Support multi wechat account at wechat_responder. by @tuliren #223
|
73
|
-
* Support wechat mini program apis & signature check. by @oiahoon #225
|
74
|
-
* Support sent template message with miniprogram. by @falm #228
|
75
|
-
* Fix request_content could be nil. by @paicha #229
|
76
|
-
|
77
|
-
## v0.9.0 (released at 4/15/2018)
|
78
|
-
|
79
|
-
* Support multi wechat account dynamically loading from DB. by @tuliren #222
|
80
|
-
* user_create API for enterprise account. #206
|
81
|
-
* Will ignore template_message_send error 43004 by @insub #214
|
82
|
-
* using template with version if the migration version available by @killernova #220
|
83
|
-
* Remove Deprecation oauth2_url
|
84
|
-
* Remove Ruby 2.2 support, add Rails 5.2 and http v3 support
|
85
|
-
|
86
|
-
## v0.8.12 (released at 9/13/2017)
|
87
|
-
|
88
|
-
* Read oauth2_state from ticket store every time to avoid invalid oauth2_state by @xiewenwei #196
|
89
|
-
|
90
|
-
## v0.8.11 (released at 7/25/2017)
|
91
|
-
|
92
|
-
* oauth2 state code not refresh at the same time of jsapi tickets refresh bug, many thanks @xiewenwei #192
|
93
|
-
* Add string type scene support for qrcode_create_scene. by @libuchao #191
|
94
|
-
|
95
|
-
## v0.8.10 (released at 6/19/2017)
|
96
|
-
|
97
|
-
* fix material_delete correctly.
|
98
|
-
|
99
|
-
## v0.8.9 (released at 6/18/2017)
|
100
|
-
|
101
|
-
* wechat material_delete failed to work, thanks @Victorialice report #78
|
102
|
-
|
103
|
-
## v0.8.8 (released at 5/18/2017)
|
104
|
-
|
105
|
-
* Better support multiple account. by @xiewenwei #187
|
106
|
-
* Allow load figaro via RAILS_ENV. by @goofansu #186
|
107
|
-
|
108
|
-
## v0.8.7 (released at 4/23/2017)
|
109
|
-
|
110
|
-
* Support new wxa_get_wxacode API for miniapp.
|
111
|
-
* Add InvalidCredentialError, support audio/amr, voice/speex as file and text/plain as json. by @acenqiu #184
|
112
|
-
|
113
|
-
## v0.8.6 (released at 3/17/2017)
|
114
|
-
|
115
|
-
* Support Rails 5.1 officially.
|
116
|
-
* make sure the formfile can be created outside. by @mechiland #181
|
117
|
-
|
118
|
-
## v0.8.5 (released at 3/14/2017)
|
119
|
-
|
120
|
-
* Support mass send API #176
|
121
|
-
* Support new media_hq API
|
122
|
-
* Support new createwxaqrcode API for miniapp
|
123
|
-
* Fix wechat_responder not proper injected in rails 5 API #165
|
124
|
-
* parse response support XML return, by @zhangbin #167
|
125
|
-
* WeChat only allow 8 article per one news, by @kikyous #175
|
126
|
-
* Store token at cookies, by @jstdoit #174
|
127
|
-
|
128
|
-
## v0.8.4 (released at 1/12/2017)
|
129
|
-
|
130
|
-
* Support Ruby 2.4.0
|
131
|
-
* Add support of Enterprise RedPacket API, by @zhangbin #169
|
132
|
-
|
133
|
-
## v0.8.3 (released at 11/26/2016)
|
134
|
-
|
135
|
-
* Fix wechat template key has camelCase problem, by @RyanChenDji #159
|
136
|
-
* Fix long time of oauth2_state bug for wechat_oauth2 methods, by @IvanChou #162
|
137
|
-
|
138
|
-
## v0.8.2 (released at 11/2/2016)
|
139
|
-
|
140
|
-
* Bug which if not using multi-account but using web login.
|
141
|
-
|
142
|
-
## v0.8.1 (released at 11/2/2016)
|
143
|
-
|
144
|
-
* After allow sub controller using wechat_api, it's possible not initialise at first time. by @IvanChou #155
|
145
|
-
* Support web application login scope snsapi_login.
|
146
|
-
* Add unionid support for public account.
|
147
|
-
* Remove OpenId in Enterprise OAuth2 as it's not supported by Tecent.
|
148
|
-
|
149
|
-
## v0.8.0 (released at 10/24/2016)
|
150
|
-
|
151
|
-
* Complete support multi-wechat public account. by @xiewenwei #150
|
152
|
-
* Support loading configure value from Figaro if application.yml exist.
|
153
|
-
|
154
|
-
## v0.7.20 (released at 8/29/2016)
|
155
|
-
|
156
|
-
* Apply opt and config together when loading controller_wechat, to simplify wechat_responder params. by @bzhang443 #147
|
157
|
-
|
158
|
-
## v0.7.19 (released at 8/25/2016)
|
159
|
-
|
160
|
-
* Enterprise account now custom_image/voice/file works now. by @zymiboxpay #145
|
161
|
-
* Fix timeout setting no effective since introduct HTTP. found by @hsluo #74
|
162
|
-
|
163
|
-
## v0.7.18 (released at 8/21/2016)
|
164
|
-
|
165
|
-
* Support label_location message, similar to location event, but sent by user with Label. #144
|
166
|
-
* Add gem signature as additional security methods.
|
167
|
-
|
168
|
-
## v0.7.17 (released at 8/18/2016)
|
169
|
-
|
170
|
-
* Allow declare wechat_api at ApplicationController, but using wechat at sub controller. #104
|
171
|
-
|
172
|
-
## v0.7.16 (released at 7/27/2016)
|
173
|
-
|
174
|
-
* FIX: consider '' in params as equal with nil, in ControllerApi#wechat_public_oauth2, by @snow #135
|
175
|
-
* New tag API for public account, by @pynixwang #127
|
176
|
-
* fix SSLv3 error by use TLSv1_client, by @IvanChou #133
|
177
|
-
|
178
|
-
## v0.7.15 (released at 7/03/2016)
|
179
|
-
|
180
|
-
* RSpec testing case on Rails 5 now.
|
181
|
-
* Resolve Rails 5 ActionController::Parameters issue.
|
182
|
-
|
183
|
-
## v0.7.14 (released at 5/29/2016)
|
184
|
-
|
185
|
-
* Fix when access_token failed lead ticket can not refresh problem.
|
186
|
-
* Default duration should be 1 hours instead of 0 seconds for wechat_oauth2.
|
187
|
-
* New shorturl allowing convert from long URL to short.
|
188
|
-
|
189
|
-
## v0.7.13 (released at 5/14/2016)
|
190
|
-
|
191
|
-
* Wechat.config.oauth2_cookie_duration need convert to secondes, found by @gabrieltong #111
|
192
|
-
|
193
|
-
## v0.7.12 (released at 5/12/2016)
|
194
|
-
|
195
|
-
* Fix web_userinfo wrong URL, found by @gabrieltong #110
|
196
|
-
|
197
|
-
## v0.7.11 (released at 4/18/2016)
|
198
|
-
|
199
|
-
* To cover wrong release 0.7.10, nothing change
|
200
|
-
|
201
|
-
## v0.7.10 (released at 4/18/2016) (yanked)
|
202
|
-
|
203
|
-
## v0.7.9 (released at 4/12/2016)
|
204
|
-
|
205
|
-
* wechat_oauth2 support public account now.
|
206
|
-
* Refresh and store state on jsapi ticket, using it on oauth2_url to more secure.
|
207
|
-
* Remove extra sending payload in message template send json
|
208
|
-
* Allow setting oauth2_cookie_duration in config
|
209
|
-
|
210
|
-
## v0.7.8 (released at 3/31/2016)
|
211
|
-
|
212
|
-
* New wechat_api, similar to wechat_responder, but without messange handle DSL, support web page only wechat application
|
213
|
-
* New media_uploadimg API.
|
214
|
-
* New file type of Message.
|
215
|
-
* Improved multi account support per different controller.
|
216
|
-
|
217
|
-
## v0.7.7 (released at 3/18/2016)
|
218
|
-
|
219
|
-
* New wechat_oauth2, only support enterprise account still.
|
220
|
-
* fix 'skip_before_action :verify_authenticity_token' bug for v5.0.0.beta3 by @vkill #97
|
221
|
-
* Support Rails 3.2 again after support Rails 5.0, by @guange2015 #96
|
222
|
-
|
223
|
-
## v0.7.6 (released at 3/05/2016)
|
224
|
-
|
225
|
-
* Support wechat public account conditional menu. #95
|
226
|
-
|
227
|
-
## v0.7.5 (released at 2/21/2016)
|
228
|
-
|
229
|
-
* New wechat_config_js to simplify the Wechat jsapi config.
|
230
|
-
* Support sent shortvideo.
|
231
|
-
|
232
|
-
## v0.7.4 (released at 1/23/2016)
|
233
|
-
|
234
|
-
* Add Redis store token/ticket support, close #76, #60
|
235
|
-
* Rails 5 support without deprecate warning or other not necessory call. #82
|
236
|
-
|
237
|
-
## v0.7.3 (released at 1/19/2016)
|
238
|
-
|
239
|
-
* Allow transfer_customer_service to specific account.
|
240
|
-
* New customservice_getonlinekflist API.
|
241
|
-
* session support class WechatSession no need table_exists? methods exist.
|
242
|
-
|
243
|
-
## v0.7.2 (released at 1/18/2016)
|
244
|
-
|
245
|
-
* Optional session support by @zfben #81, #88, #91
|
246
|
-
* Replace after_wechat_response with Rails Nofications facility, by @zfben, original issue is #79
|
247
|
-
* New user_batchget API. #89
|
248
|
-
* Support Rails 3.2 again after support Rails 5.0. by @guange2015 #87
|
249
|
-
* Fetch setting from RAILS_ENV first, then fetch default. by @kikyous #85
|
250
|
-
* Warning not support on :scan with regular expression, reason see #84
|
251
|
-
|
252
|
-
## v0.7.1 (released at 1/11/2016)
|
253
|
-
|
254
|
-
* Fix after using http, upload file function break. #78
|
255
|
-
* Add callback function after_wechat_response support. by @zfben #79
|
256
|
-
* Should using department_id instead of departmentid at enterprise api: user_simplelist/user_list.
|
257
|
-
|
258
|
-
## v0.7.0 (released at 1/1/2016)
|
259
|
-
|
260
|
-
* Using [http](https://github.com/httprb/http) instead of rest-client for performance reason. (not support upload file yet)
|
261
|
-
|
262
|
-
## v0.6.10 (released at 1/17/2016)
|
263
|
-
|
264
|
-
* Support Rails 3.2 again after support Rails 5.0. by @guange2015 #87
|
265
|
-
* Fetch setting from RAILS_ENV first, then fetch default. by @kikyous #85
|
266
|
-
* Warning not support on :scan with regular expression. by @kikyous #84
|
267
|
-
|
268
|
-
## v0.6.9 (released at 1/6/2016)
|
269
|
-
|
270
|
-
* Fix token refresh bug on multi worker. #76
|
271
|
-
* Rewrite the token relative code to add more storage support in future.
|
272
|
-
|
273
|
-
## v0.6.8 (released at 12/25/2015)
|
274
|
-
|
275
|
-
* Support Rails 5.0.0.beta1.
|
276
|
-
* English README available
|
277
|
-
* Fix oauth2_url calling error, fix #75
|
278
|
-
|
279
|
-
## v0.6.7 (released at 12/18/2015)
|
280
|
-
|
281
|
-
* Add timeout configuration option, close #74
|
282
|
-
* New getuserinfo and oauth2_url to support getting FromUserName from web page.
|
283
|
-
|
284
|
-
## v0.6.6 (released at 12/15/2015)
|
285
|
-
|
286
|
-
* Add jsapi_ticket support for Enterprise Account
|
287
|
-
* Default generated WechatsController < ActionController::Base, as many Rails application may having #authenticate_user or #set_current_user in ApplicationController, so easily affect the first time using experience.
|
288
|
-
* New syntax `on :view, with: 'VIEW_URL'` support.
|
289
|
-
* New command `upload_replaceparty` which combine three sub command to make uploading department easier.
|
290
|
-
* New command `upload_replaceuser` which combine three sub command to make uploading user easier.
|
291
|
-
|
292
|
-
## v0.6.5 (released at 11/24/2015)
|
293
|
-
|
294
|
-
* Handle 48001 error if token is expire/not valid, close #71
|
295
|
-
* ApiLoader will do config reading and initialize the api instead of spreading the logic.
|
296
|
-
|
297
|
-
## v0.6.4 (released at 11/16/2015)
|
298
|
-
|
299
|
-
* Command mode now display different command set based on enterprise/public account setting
|
300
|
-
* Move config logic in command/wechat to ApiLoader class
|
301
|
-
* Unsubscribe can only reply plain text 'success' #68
|
302
|
-
* Fix 404 qrcode download problem, by @huangxiangdan #69
|
303
|
-
|
304
|
-
## v0.6.3 (released at 11/14/2015)
|
305
|
-
|
306
|
-
* Official testing and support public encrypt mode, also fix one cipher bug, many thanks to @hlltc #67
|
307
|
-
* hlltc report public account FILE_BASE no longer needs, clean code #67
|
308
|
-
* Media command line reflect recent Tecent json schema change. #67
|
309
|
-
|
310
|
-
## v0.6.2 (released at 11/05/2015)
|
311
|
-
|
312
|
-
* Tecent report location API changed, so change wechat gems also. #64
|
313
|
-
|
314
|
-
## v0.6.1 (released at 10/20/2015)
|
315
|
-
|
316
|
-
* Handle 40001, invalid credential, access_token is invalid or not latest hint # 57
|
317
|
-
* Support at Rails 4.2.1 wechat can not run #58
|
318
|
-
|
319
|
-
## v0.6.0 (released at 10/08/2015)
|
320
|
-
|
321
|
-
### Scan and Batch job are BREAK CHANGE!
|
322
|
-
|
323
|
-
* Scan 2D barcode using new syntax `on :scan, with: 'BINDING_QR_CODE' ` instead of `on :event, with: 'BINDING_QR_CODE' ` in previous version #55
|
324
|
-
Which will fix can not using `on :event, with: "scan" ` problem
|
325
|
-
* Batch job using new syntax `on :batch_job, with: 'replace_user' `
|
326
|
-
instead of previous `on :event, with: 'replace_user' `.
|
327
|
-
* Click menu support new syntax `on :click, with: 'BOOK_LUNCH' `, but `on :event, with: 'BOOK_LUNCH' ` still supported. perfer `on :click` because it running faster and more nature expression.
|
328
|
-
* Wechat::Responder using Hash for new :client and :batch_job event, avoid time consuming Array match responder
|
329
|
-
* Fix refresh token not working problem under ruby 2.0.0 #54
|
330
|
-
* New department_update, user_batchdelete, convert_to_openid API
|
331
|
-
|
332
|
-
## v0.5.0 (released at 9/25/2015)
|
333
|
-
|
334
|
-
* Only relay on activesupport on run time, so will greatly improve wechat cli startup time
|
335
|
-
* Add rails generator support `rails g wechat:install`
|
336
|
-
* Add batch job support for enterprise account like batch create user/department, both API, callback responder and CLI
|
337
|
-
* Add material management API and CLI
|
338
|
-
* Add tag API and CLI for enterprise account
|
339
|
-
* Add QR code scene function for public account
|
340
|
-
|
341
|
-
## v0.4.2 (released at 9/7/2015)
|
342
|
-
|
343
|
-
* Fix wrong number of arguments at Wechat::Responder.on by using arity #47
|
344
|
-
* Fix can not access wechat method after using instance level context.
|
345
|
-
* Fix skip_verify_ssl parameter error.
|
346
|
-
|
347
|
-
## v0.4.1 (released at 9/6/2015)
|
348
|
-
|
349
|
-
* Limit news articles collection to 10, close #5
|
350
|
-
* Resolve the conflict with gem "responders" by @seamon #45
|
351
|
-
|
352
|
-
## v0.4.0 (released at 9/5/2015)
|
353
|
-
|
354
|
-
* Enable the verify SSL for enterprise mode by default, as security is more importent than speed, but still can switch off by configure
|
355
|
-
* Support scancode_push/scancode_waitmsg event.
|
356
|
-
* New API method can get wechat server IP list
|
357
|
-
* New API to query/create department/media/material
|
358
|
-
* Fix can not read token_file in mingw bug, which introduce at #43
|
359
|
-
|
360
|
-
## v0.3.0 (released at 8/30/2015)
|
361
|
-
|
362
|
-
* New user group management API
|
363
|
-
* Allow transfer to customer service on fallback. #42
|
364
|
-
* Read and write access_token properly using file locking, #43
|
365
|
-
|
366
|
-
## v0.2.0 (released at 8/27/2015)
|
367
|
-
|
368
|
-
* Add wechat enterprise account support
|
369
|
-
* Make responder execute in action context, by @lazing #15
|
370
|
-
* jsapi_ticket support, by @feitian124 #27
|
371
|
-
* Rename gems to wechat and ambitious to being #1 gems about development wechat. thanks Xiaoning transfer this gem name.
|
372
|
-
* Original gem `wechat-rails` author skinnyworm trasfer to Eric-Guo as maintainer
|
373
|
-
|
374
|
-
## v0.1.1
|
375
|
-
|
376
|
-
* Initial release from [wechat-rails](https://github.com/skinnyworm/wechat-rails).
|
8
|
+
Previous changelog see https://github.com/Eric-Guo/wechat/blob/master/CHANGELOG_OLD.md
|
data/README-CN.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
WeChat [![Gem Version](https://badge.fury.io/rb/wechat.svg)](https://rubygems.org/gems/wechat) [![Build Status](https://travis-ci.
|
1
|
+
WeChat [![Gem Version](https://badge.fury.io/rb/wechat.svg)](https://rubygems.org/gems/wechat) [![Build Status](https://travis-ci.com/Eric-Guo/wechat.svg)](https://travis-ci.com/github/Eric-Guo/wechat) [![Maintainability](https://api.codeclimate.com/v1/badges/12885358487c13e91e00/maintainability)](https://codeclimate.com/github/Eric-Guo/wechat/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/12885358487c13e91e00/test_coverage)](https://codeclimate.com/github/Eric-Guo/wechat/test_coverage)
|
2
2
|
======
|
3
3
|
|
4
4
|
[![Join the chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Eric-Guo/wechat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
5
5
|
|
6
|
-
WeChat gem帮助开发者方便地在Rails环境中集成[微信公众平台](https://
|
6
|
+
WeChat gem帮助开发者方便地在Rails环境中集成[微信公众平台](https://developers.weixin.qq.com/doc/offiaccount/Getting_Started/Overview.html)、[企业微信](https://work.weixin.qq.com/api/doc)和[小程序](https://developers.weixin.qq.com/miniprogram/dev/framework/),包括功能:
|
7
7
|
|
8
8
|
- 微信公众平台/企业微信[发送消息](http://qydev.weixin.qq.com/wiki/index.php?title=%E5%8F%91%E9%80%81%E6%B6%88%E6%81%AF)API(命令行和Web环境都可以使用)
|
9
9
|
- [接收消息](http://qydev.weixin.qq.com/wiki/index.php?title=%E6%8E%A5%E6%94%B6%E6%B6%88%E6%81%AF%E4%B8%8E%E4%BA%8B%E4%BB%B6)(必须运行Web服务器)
|
@@ -27,12 +27,16 @@ WeChat gem帮助开发者方便地在Rails环境中集成[微信公众平台](ht
|
|
27
27
|
|
28
28
|
```
|
29
29
|
gem install "wechat"
|
30
|
+
# 如果使用 Ruby 版本小于 2.6
|
31
|
+
# gem install wechat -v 0.12.2
|
30
32
|
```
|
31
33
|
|
32
34
|
或者添加下面这行到 `Gemfile`:
|
33
35
|
|
34
36
|
```
|
35
37
|
gem 'wechat'
|
38
|
+
# 如果使用 Rails 版本小于 6
|
39
|
+
# gem 'wechat', '~> 0.12.2'
|
36
40
|
```
|
37
41
|
|
38
42
|
运行下面这行代码来安装:
|
@@ -399,6 +403,7 @@ Wechat Public Account commands:
|
|
399
403
|
wechat user_group [OPEN_ID] # 查询用户所在分组
|
400
404
|
wechat user_update_remark [OPEN_ID, REMARK] # 设置备注名
|
401
405
|
wechat users # 关注者列表
|
406
|
+
wechat wxa_msg_sec_check [CONTENT] # 检查一段文本是否含有违法违规内容。
|
402
407
|
wechat wxacode_download [WXA_CODE_PIC_PATH, PATH, WIDTH] # 下载小程序码
|
403
408
|
```
|
404
409
|
|
@@ -415,6 +420,7 @@ Wechat Enterprise Account commands:
|
|
415
420
|
wechat callbackip # 获取微信服务器IP地址
|
416
421
|
wechat clear_quota # 接口调用次数清零
|
417
422
|
wechat convert_to_openid [USER_ID] # userid转换成openid
|
423
|
+
wechat convert_to_userid [OPENID] # openid转换成userid
|
418
424
|
wechat custom_image [OPENID, IMAGE_PATH] # 发送图片客服消息
|
419
425
|
wechat custom_music [OPENID, THUMBNAIL_PATH, MUSIC_URL] # 发送音乐客服消息
|
420
426
|
wechat custom_news [OPENID, NEWS_YAML_PATH] # 发送图文客服消息
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
WeChat [![Gem Version](https://badge.fury.io/rb/wechat.svg)](https://rubygems.org/gems/wechat) [![Build Status](https://travis-ci.
|
1
|
+
WeChat [![Gem Version](https://badge.fury.io/rb/wechat.svg)](https://rubygems.org/gems/wechat) [![Build Status](https://travis-ci.com/Eric-Guo/wechat.svg)](https://travis-ci.com/github/Eric-Guo/wechat) [![Maintainability](https://api.codeclimate.com/v1/badges/12885358487c13e91e00/maintainability)](https://codeclimate.com/github/Eric-Guo/wechat/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/12885358487c13e91e00/test_coverage)](https://codeclimate.com/github/Eric-Guo/wechat/test_coverage)
|
2
2
|
======
|
3
3
|
|
4
4
|
[![Join the chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Eric-Guo/wechat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
@@ -7,7 +7,7 @@ WeChat [![Gem Version](https://badge.fury.io/rb/wechat.svg)](https://rubygems.or
|
|
7
7
|
|
8
8
|
[Wechat](http://www.wechat.com/) is a Chinese multi-purpose messaging, social media and mobile payment app developed by Tencent. It was first released in 2011, and by 2018 it was one of the world's largest standalone mobile apps by monthly active users, with over 1 billion monthly active users (902 million daily active users). (According to [wiki](https://en.wikipedia.org/wiki/WeChat))
|
9
9
|
|
10
|
-
WeChat gem helps Rails developers integrate [WeChat Official Accounts Platform](https://
|
10
|
+
WeChat gem helps Rails developers integrate [WeChat Official Accounts Platform](https://developers.weixin.qq.com/doc/offiaccount/Getting_Started/Overview.html) or [Wechat mini program](https://developers.weixin.qq.com/miniprogram/dev/framework/) easily, including features:
|
11
11
|
|
12
12
|
- [Sending message](http://qydev.weixin.qq.com/wiki/index.php?title=%E5%8F%91%E9%80%81%E6%B6%88%E6%81%AF) API(can be both accessed via console or rails server)
|
13
13
|
- [Receiving message](http://qydev.weixin.qq.com/wiki/index.php?title=%E6%8E%A5%E6%94%B6%E6%B6%88%E6%81%AF%E4%B8%8E%E4%BA%8B%E4%BB%B6)(rails server is required to be running)
|
@@ -34,12 +34,16 @@ Use `gem install`
|
|
34
34
|
|
35
35
|
```
|
36
36
|
gem install "wechat"
|
37
|
+
# If your ruby version < 2.6
|
38
|
+
# gem install wechat -v 0.12.2
|
37
39
|
```
|
38
40
|
|
39
41
|
Or add it to your app's `Gemfile`:
|
40
42
|
|
41
43
|
```
|
42
44
|
gem 'wechat'
|
45
|
+
# If your rails version < 6.0
|
46
|
+
# gem 'wechat', '~> 0.12.2'
|
43
47
|
```
|
44
48
|
|
45
49
|
Run the following command to install it:
|
@@ -430,6 +434,7 @@ Wechat Public Account commands:
|
|
430
434
|
wechat user_group [OPEN_ID] # 查询用户所在分组
|
431
435
|
wechat user_update_remark [OPEN_ID, REMARK] # 设置备注名
|
432
436
|
wechat users # 关注者列表
|
437
|
+
wechat wxa_msg_sec_check [CONTENT] # 检查一段文本是否含有违法违规内容。
|
433
438
|
wechat wxacode_download [WXA_CODE_PIC_PATH, PATH, WIDTH] # 下载小程序码
|
434
439
|
wechat clear_quota # 接口调用次数清零
|
435
440
|
```
|
@@ -447,6 +452,7 @@ Wechat Enterprise Account commands:
|
|
447
452
|
wechat callbackip # 获取微信服务器IP地址
|
448
453
|
wechat clear_quota # 接口调用次数清零
|
449
454
|
wechat convert_to_openid [USER_ID] # userid转换成openid
|
455
|
+
wechat convert_to_userid [OPENID] # openid转换成userid
|
450
456
|
wechat custom_image [OPENID, IMAGE_PATH] # 发送图片客服消息
|
451
457
|
wechat custom_music [OPENID, THUMBNAIL_PATH, MUSIC_URL] # 发送音乐客服消息
|
452
458
|
wechat custom_news [OPENID, NEWS_YAML_PATH] # 发送图文客服消息
|