yol_qy_weixin 0.0.5 → 0.0.9
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 +4 -4
- data/.gitignore +3 -0
- data/Gemfile.lock +4 -4
- data/README.md +6 -0
- data/lib/yol_qy_weixin/client.rb +3 -1
- data/lib/yol_qy_weixin/connections/department.rb +17 -0
- data/lib/yol_qy_weixin/connections/message.rb +15 -0
- data/lib/yol_qy_weixin/connections/user.rb +8 -0
- data/lib/yol_qy_weixin/version.rb +1 -1
- metadata +4 -4
- data/.DS_Store +0 -0
- data/lib/.DS_Store +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb09b9a9748608f4ca2d341df3e8185053e5a32066883519491ed40303d9b85b
|
4
|
+
data.tar.gz: 3bb68cdbaade60cad11f9bff244264c1d34bca59c198d7696ed3a3d1e894d544
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 023f2b2b97019f38dbfe74f9416d275390acaee9656b8359de50fa3d5ff2165510a72b6ae1ece9a8c42f417b247c7fb743f7f69f8d0f1eebc711d4e54b850d17
|
7
|
+
data.tar.gz: f9ede1ef6063e9c8e1f3e674ecdde784b50539cd4ef3e0a1239daaf8df562d1a5a2b18d1a920bcc0b71c711023349b1978913d247241224a47a793e99f729c2e
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
yol_qy_weixin (0.0.
|
4
|
+
yol_qy_weixin (0.0.9)
|
5
5
|
multi_xml
|
6
6
|
nokogiri
|
7
7
|
roxml
|
@@ -15,12 +15,12 @@ GEM
|
|
15
15
|
minitest (~> 5.1)
|
16
16
|
tzinfo (~> 1.1)
|
17
17
|
zeitwerk (~> 2.2, >= 2.2.2)
|
18
|
-
concurrent-ruby (1.1.
|
19
|
-
i18n (1.8.
|
18
|
+
concurrent-ruby (1.1.9)
|
19
|
+
i18n (1.8.10)
|
20
20
|
concurrent-ruby (~> 1.0)
|
21
21
|
minitest (5.14.4)
|
22
22
|
multi_xml (0.6.0)
|
23
|
-
nokogiri (1.11.
|
23
|
+
nokogiri (1.11.7-x86_64-darwin)
|
24
24
|
racc (~> 1.4)
|
25
25
|
racc (1.5.2)
|
26
26
|
rake (13.0.1)
|
data/README.md
CHANGED
@@ -116,6 +116,12 @@ access_token = QyWexinClient.get_user_id(code)
|
|
116
116
|
# 返回参考企业微信官方文档:https://open.work.weixin.qq.com/api/doc/90000/90135/91707
|
117
117
|
```
|
118
118
|
|
119
|
+
## 发送信息
|
120
|
+
|
121
|
+
```ruby
|
122
|
+
# 获取成员信息
|
123
|
+
access_token = QyWexinClient.send_message(body)
|
124
|
+
# body内容可参考:https://work.weixin.qq.com/api/doc/90001/90143/90372#%E5%9B%BE%E6%96%87%E6%B6%88%E6%81%AF
|
119
125
|
|
120
126
|
---
|
121
127
|
|
data/lib/yol_qy_weixin/client.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
module YolQyWeixin
|
2
|
+
module Connection
|
3
|
+
module Department
|
4
|
+
def department_list(department_id=0)
|
5
|
+
http_get(department_list_url(department_id))
|
6
|
+
end
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def department_list_url(department_id)
|
13
|
+
"https://qyapi.weixin.qq.com/cgi-bin/department/list?access_token=#{get_access_token}&id=#{department_id}"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module YolQyWeixin
|
2
|
+
module Connection
|
3
|
+
module Message
|
4
|
+
def send_message(body)
|
5
|
+
http_post(send_url, body)
|
6
|
+
end
|
7
|
+
|
8
|
+
private
|
9
|
+
|
10
|
+
def send_url
|
11
|
+
"https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=#{get_access_token}"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -1,6 +1,10 @@
|
|
1
1
|
module YolQyWeixin
|
2
2
|
module Connection
|
3
3
|
module User
|
4
|
+
def get_users_by_department(department_id, fetch_child=0)
|
5
|
+
http_get(get_users_by_department_url(department_id, fetch_child))
|
6
|
+
end
|
7
|
+
|
4
8
|
def get_user_id(code)
|
5
9
|
http_get(user_info_url(open_id))
|
6
10
|
end
|
@@ -11,6 +15,10 @@ module YolQyWeixin
|
|
11
15
|
|
12
16
|
private
|
13
17
|
|
18
|
+
def get_users_by_department_url(department_id, fetch_child)
|
19
|
+
"https://qyapi.weixin.qq.com/cgi-bin/user/simplelist?access_token=#{get_access_token}&department_id=#{department_id}&fetch_child=#{fetch_child}"
|
20
|
+
end
|
21
|
+
|
14
22
|
def user_id_url(code)
|
15
23
|
"https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token=#{get_access_token}&code=#{code}"
|
16
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- luojie2019
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -87,18 +87,18 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
-
- ".DS_Store"
|
91
90
|
- ".gitignore"
|
92
91
|
- Gemfile
|
93
92
|
- Gemfile.lock
|
94
93
|
- LICENSE.txt
|
95
94
|
- README.md
|
96
95
|
- Rakefile
|
97
|
-
- lib/.DS_Store
|
98
96
|
- lib/yol_qy_weixin.rb
|
99
97
|
- lib/yol_qy_weixin/client.rb
|
100
98
|
- lib/yol_qy_weixin/connection.rb
|
101
99
|
- lib/yol_qy_weixin/connections/base.rb
|
100
|
+
- lib/yol_qy_weixin/connections/department.rb
|
101
|
+
- lib/yol_qy_weixin/connections/message.rb
|
102
102
|
- lib/yol_qy_weixin/connections/qrcode.rb
|
103
103
|
- lib/yol_qy_weixin/connections/template.rb
|
104
104
|
- lib/yol_qy_weixin/connections/user.rb
|
data/.DS_Store
DELETED
Binary file
|
data/lib/.DS_Store
DELETED
Binary file
|