yol_qy_weixin 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +17 -35
- data/lib/yol_qy_weixin/version.rb +1 -1
- data/yol_qy_weixin.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec8f687f096c1a595ec1f92c3457d79e32767fb1f643ff7452d03ca42fa57f08
|
4
|
+
data.tar.gz: ff87635fed7356fb2ece92d5106890858abdb3981ec8ee55cc91ed601e73215e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e5b7a876d6589eadc3e5b5f629287b342cc87639baf48986adfe72e2975ab91e7a894f82e8b6e6f9e0da6dbcecaa1b27aed29b77bfe9f56ec3857ffeea95f78
|
7
|
+
data.tar.gz: 53529d9af3cec7a146f2d34ebf8c886e10ee92572a2bb2398d88497f1b2e45c8631e483dea939aa8c5382ef768338b7809bd31d64169d688b3b6d3af0a1e3106
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -53,6 +53,8 @@ production:
|
|
53
53
|
secret: <%= ENV.fetch('QY_WEIXIN_SECRET') { '2**'' } %>
|
54
54
|
```
|
55
55
|
|
56
|
+
**说明:考虑access_token需要缓存,redis配置请参考官方文档 https://github.com/redis/redis-rb/blob/master/README.md**
|
57
|
+
|
56
58
|
## 读取配置
|
57
59
|
```ruby
|
58
60
|
# 读取qy_weixin.yml配置
|
@@ -73,20 +75,19 @@ corpid = WeixinSetting.corpid
|
|
73
75
|
corp_secret = WeixinSetting.secret
|
74
76
|
```
|
75
77
|
|
76
|
-
**说明:redis配置请参考官方文档https://github.com/redis/redis-rb/blob/master/README.md**
|
77
|
-
|
78
78
|
## 实例对象
|
79
79
|
|
80
80
|
```ruby
|
81
81
|
# 目录 file: your_project/config/initializers/qy_weixin.rb
|
82
82
|
|
83
83
|
QyWexinClient = YolQyWeixin::Client.new(
|
84
|
-
|
85
|
-
|
86
|
-
|
84
|
+
corpid: qy_weixin_config["corpid"],
|
85
|
+
secret: qy_weixin_config["secret"],
|
86
|
+
redis: RedisClient
|
87
87
|
)
|
88
88
|
```
|
89
89
|
|
90
|
+
**说明:RedisClient为redis实例,如果没有配置可传nil,建议使用redis,考虑到access_token获取次数限制;**
|
90
91
|
|
91
92
|
# 基本用法
|
92
93
|
|
@@ -94,51 +95,32 @@ QyWexinClient = YolQyWeixin::Client.new(
|
|
94
95
|
|
95
96
|
```ruby
|
96
97
|
access_token = QyWexinClient.get_access_token
|
97
|
-
#
|
98
|
+
# 返回参考企业微信官方文档:https://work.weixin.qq.com/api/doc/90000/90135/91039
|
98
99
|
```
|
99
100
|
|
100
101
|
## 部门
|
101
102
|
|
102
103
|
```ruby
|
103
|
-
|
104
|
-
group_client.department.update(id, name, parent_id, order=nil)
|
105
|
-
group_client.department.delete(id)
|
106
|
-
group_client.department.list
|
104
|
+
待补充,有需要可提issue到git:https://github.com/luojie2019/yol_qy_weixin.git
|
107
105
|
```
|
108
106
|
|
109
107
|
## 成员
|
110
108
|
|
111
109
|
```ruby
|
112
|
-
#
|
113
|
-
|
114
|
-
|
115
|
-
# 更新成员
|
116
|
-
group_client.user.update(user_id, options={})
|
117
|
-
|
118
|
-
# 删除成员
|
119
|
-
group_client.user.delete(user_id)
|
120
|
-
|
121
|
-
# 批量删除成员
|
122
|
-
group_client.user.batch_delete(user_ids)
|
110
|
+
# 获取成员信息
|
111
|
+
access_token = QyWexinClient.get_user_info(open_id)
|
112
|
+
# 返回参考企业微信官方文档:https://open.work.weixin.qq.com/api/doc/90000/90135/90196
|
123
113
|
|
124
|
-
#
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
group_client.user.simple_list(department_id, fetch_child=nil, status=nil)
|
114
|
+
# 获取反问用户信息
|
115
|
+
access_token = QyWexinClient.get_user_id(code)
|
116
|
+
# 返回参考企业微信官方文档:https://open.work.weixin.qq.com/api/doc/90000/90135/91707
|
117
|
+
```
|
129
118
|
|
130
|
-
# 获取部门成员(详情)
|
131
|
-
group_client.user.full_list(department_id, fetch_child=nil, status=nil)
|
132
119
|
|
133
|
-
|
134
|
-
group_client.user.send_invitation(user_id, tips=nil)
|
120
|
+
---
|
135
121
|
|
136
|
-
# userid转换成openid接口(企业支付需要使用到)
|
137
|
-
group_client.covert_to_open_id(user_id, agent_id="")
|
138
122
|
|
139
|
-
|
140
|
-
group_client.covert_to_user_id(open_id)
|
141
|
-
```
|
123
|
+
后续功能实现还待优化,有需要可提issue到git:https://github.com/luojie2019/yol_qy_weixin.git
|
142
124
|
|
143
125
|
## 标签
|
144
126
|
|
data/yol_qy_weixin.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["luojie@yolanda.hk"]
|
11
11
|
spec.summary = %q{Shop middleware for Weixin.}
|
12
12
|
spec.description = ""
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/luojie2019/yol_qy_weixin"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yol_qy_weixin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- luojie2019
|
@@ -109,7 +109,7 @@ files:
|
|
109
109
|
- lib/yol_qy_weixin/models/message.rb
|
110
110
|
- lib/yol_qy_weixin/version.rb
|
111
111
|
- yol_qy_weixin.gemspec
|
112
|
-
homepage:
|
112
|
+
homepage: https://github.com/luojie2019/yol_qy_weixin
|
113
113
|
licenses:
|
114
114
|
- MIT
|
115
115
|
metadata: {}
|