easy_wechat 0.1.2 → 0.1.3

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: 3d8066f4397a6645cdae6c9bc9dc2ae40784fe181cfaaef40a6319ce5e78cac3
4
- data.tar.gz: 64b7c2dbe69defa80b0b1cbb762d0a2cb6c0cb1ba579b2ffb3f738d31c05e08d
3
+ metadata.gz: d5cb4283e2aa2451356d46392ba3260585b49bcb4a57d2e9cbb78964754335e2
4
+ data.tar.gz: f684c3d9b9809e1f5d504989e6ccb98110b9dacb05debbfe3d9f9d328d187dea
5
5
  SHA512:
6
- metadata.gz: 695251db24a4baf01027b369165a8d6dbb18c054594f330c4ff8950c52b2330ac669a18c5ebf65068a13ee6a36c36f128508c990c399c990b5bf88032bd0b03c
7
- data.tar.gz: e2297653663ddf218abbbf69ce0c13a5a9c95b13a4fcb4829ccd20dd8d650814da287078bc70242183d12671ae0fa9d29f120b5f9f85ed36c654ad16adaaf7a8
6
+ metadata.gz: b95b94c2179eeb420fcc7bcbb4f90851d9b589d47a73da60c31b1dbb6eb5b96dc53b82d8ac205faeba0f716ec1fa8771d0245ce05ef67d62f50e445c7d53ac42
7
+ data.tar.gz: b3fb434e830ef7035120a683094fe0ac9a345774db32447e58f2db72ee05a766648f6ed472461864192410e24eb7bb04b79f0bccbe15b71b00f7af12e0e72153
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- easy_wechat (0.1.2)
4
+ easy_wechat (0.1.3)
5
5
  activesupport
6
6
  http-form_data
7
7
  httpx
data/README.md CHANGED
@@ -23,6 +23,8 @@ Or install it yourself as:
23
23
  ## Usage
24
24
 
25
25
  ```
26
+ rails g easy_wechat:install
27
+
26
28
  EasyWechat.configure do |config|
27
29
  config.appid = ENV.fetch("APPID") || ""
28
30
  config.app_secret = ENV.fetch("APP_SECRET") || ""
@@ -37,6 +39,11 @@ client.get_user_summary(begin_date, end_date)
37
39
  client.get_user_cumulate(begin_date, end_date)
38
40
  ```
39
41
 
42
+ ## FAQ
43
+ 1. 微信api,请求方式有问题,也会报错,所以要注意请求方式
44
+ 2. 先搞清楚你的appid对应的公众号是什么,并且搞清楚你是什么类型的,查看接口权限是否获得,否则有可能会有类似48001的权限未开通错误
45
+ 3. 调用api之前,请确保ip已经加入到服务器白名单
46
+
40
47
  ## Development
41
48
 
42
49
  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.
@@ -1,3 +1,3 @@
1
1
  module EasyWechat
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -0,0 +1,20 @@
1
+ module EasyWechat
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+ desc "EasyWechat installation: initializer"
5
+ source_root File.expand_path("../../templates", __FILE__)
6
+
7
+ def install
8
+ puts "==> generate initializer file ..."
9
+ copy_initializer
10
+ puts "Done!"
11
+ end
12
+
13
+ private
14
+
15
+ def copy_initializer
16
+ template "initializer.rb", "config/initializers/easy_wechat.rb"
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,4 @@
1
+ EasyWechat.configure do |config|
2
+ # config.appid = ENV.fetch("APPID") || ""
3
+ # config.app_secret = ENV.fetch("APP_SECRET") || ""
4
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_wechat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - 42up
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-09 00:00:00.000000000 Z
11
+ date: 2021-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpx
@@ -130,6 +130,8 @@ files:
130
130
  - lib/easy_wechat/client.rb
131
131
  - lib/easy_wechat/configuration.rb
132
132
  - lib/easy_wechat/version.rb
133
+ - lib/generators/easy_wechat/install_generator.rb
134
+ - lib/generators/templates/initializer.rb
133
135
  homepage: https://github.com/42up/easy_wechat
134
136
  licenses:
135
137
  - MIT