lhj-tools 0.1.95 → 0.1.97
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lhj/command/yapi.rb +8 -5
- data/lib/lhj/helper/dingtalk_helper.rb +34 -20
- data/lib/lhj/helper/pgyer_helper.rb +1 -1
- data/lib/lhj/tools/version.rb +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: 3141a25ce2e0c2b88124dd148417f856317982f1f4da81b9bd43c90ee858b820
|
4
|
+
data.tar.gz: 70f7ffc027cbcb03cb1c4b613a2e132cd46e57dbd2833d36ff88aacc395ed636
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab33b726b8306c881f3ecbced49a801d1d217cb7a340d88b759e82a4d283f2c18f0db89584296edb8e00ca9abb3c8d212ea82d1ee3cf423b56637b507fa9ba14
|
7
|
+
data.tar.gz: b172f1fbe29b4475b777a30dd646d0e01bf83015406cfeb22a161010edb2f62a299cee0db36a7a3a2ee9e4ab40b3583f2a5317da749ef0d1b96bc826b837ff4b
|
data/lib/lhj/command/yapi.rb
CHANGED
@@ -148,10 +148,10 @@ module Lhj
|
|
148
148
|
end
|
149
149
|
|
150
150
|
def push_to_git
|
151
|
-
Actions.sh('git checkout master')
|
152
|
-
Actions.sh('git add .')
|
153
|
-
Actions.sh("git commit -m 'generate yapi code'")
|
154
|
-
Actions.sh('git push')
|
151
|
+
Actions.sh('git checkout master', log: false)
|
152
|
+
Actions.sh('git add .', log: false)
|
153
|
+
Actions.sh("git commit -m 'generate yapi code'", log: false)
|
154
|
+
Actions.sh('git push', log: false)
|
155
155
|
end
|
156
156
|
|
157
157
|
def notify_robot(upload_info, interface_info, project_info)
|
@@ -169,7 +169,10 @@ module Lhj
|
|
169
169
|
})
|
170
170
|
template = Lhj::ErbTemplateHelper.load('oc_code_notify')
|
171
171
|
output = Lhj::ErbTemplateHelper.render(template, temp_vars, '-')
|
172
|
-
|
172
|
+
btn_array = [
|
173
|
+
{ 'title' => '查看Yapi', 'actionURL' => api_url }
|
174
|
+
]
|
175
|
+
Lhj::Dingtalk.post_card_message_robot(robot_url, 'yapi generate', output, btn_array)
|
173
176
|
end
|
174
177
|
|
175
178
|
def interface_url_str
|
@@ -7,39 +7,39 @@ module Lhj
|
|
7
7
|
|
8
8
|
def self.post_message(title, message)
|
9
9
|
robot_url = Lhj::DingTalkConfig.dingtalk_robot
|
10
|
-
|
10
|
+
post_message_robot(robot_url, title, message)
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.post_message_robot(robot_url, title, message)
|
14
|
+
http_body = markdown_body_message(title, message)
|
11
15
|
http_post(robot_url, http_body)
|
12
|
-
post_branch_message(http_body)
|
13
16
|
end
|
14
17
|
|
15
18
|
def self.post_card_message(title, message, btns)
|
16
19
|
robot_url = Lhj::DingTalkConfig.dingtalk_robot
|
17
|
-
|
18
|
-
http_post(robot_url, http_body)
|
20
|
+
post_card_message_robot(robot_url, title, message, btns)
|
19
21
|
end
|
20
22
|
|
21
|
-
def self.
|
22
|
-
|
23
|
-
|
24
|
-
branch_robot_key = branch_map[branch_name] if branch_map && branch_name
|
25
|
-
branch_robot_url = Lhj::DingTalkConfig.config[branch_robot_key] if branch_robot_key
|
26
|
-
http_post(branch_robot_url, http_body) if branch_robot_url
|
23
|
+
def self.post_card_message_robot(robot_url, title, message, btns)
|
24
|
+
http_body = action_card_body_message(title, message, btns, :vertical)
|
25
|
+
http_post(robot_url, http_body)
|
27
26
|
end
|
28
27
|
|
29
|
-
def self.
|
30
|
-
|
28
|
+
def self.post_single_card_message(title, message, single_title, single_url)
|
29
|
+
robot_url = Lhj::DingTalkConfig.dingtalk_robot
|
30
|
+
post_single_card_message_robot(robot_url, title, message, single_title, single_url)
|
31
31
|
end
|
32
32
|
|
33
|
-
def self.
|
34
|
-
http_body =
|
35
|
-
|
33
|
+
def self.post_single_card_message_robot(robot_url, title, message, single_title, single_url)
|
34
|
+
http_body = single_action_card_body_message(title, message, single_title, single_url)
|
35
|
+
http_post(robot_url, http_body)
|
36
36
|
end
|
37
37
|
|
38
|
-
def self.
|
39
|
-
http_body = action_card_body_message(title, message, btns, :vertical)
|
38
|
+
def self.http_post(robot_url, http_body)
|
40
39
|
Net::HTTP.post(URI(robot_url), http_body, 'Content-Type' => 'application/json')
|
41
40
|
end
|
42
41
|
|
42
|
+
# deprecation warnings used: markdown_body_message method
|
43
43
|
def self.http_body_message(title, message)
|
44
44
|
markdown_body_message(title, message)
|
45
45
|
end
|
@@ -63,9 +63,23 @@ module Lhj
|
|
63
63
|
}.to_json
|
64
64
|
end
|
65
65
|
|
66
|
-
def self.
|
67
|
-
|
68
|
-
|
66
|
+
def self.single_action_card_body_message(title, message, single_title, single_url)
|
67
|
+
{
|
68
|
+
'msgtype' => 'actionCard',
|
69
|
+
'actionCard' => { 'title' => title,
|
70
|
+
'text' => message,
|
71
|
+
'btnOrientation' => '0',
|
72
|
+
'singleTitle' => single_title,
|
73
|
+
'singleURL' => single_url }
|
74
|
+
}.to_json
|
75
|
+
end
|
76
|
+
|
77
|
+
# links: [{'title'=>'this is ...', 'messageURL'=>'https://www.dingtalk.com', 'picURL'=>'https://xx.png'}]
|
78
|
+
def self.feed_card_body_message(links)
|
79
|
+
{
|
80
|
+
'msgtype' => 'feedCard',
|
81
|
+
'feedCard' => links
|
82
|
+
}.to_json
|
69
83
|
end
|
70
84
|
end
|
71
85
|
end
|
data/lib/lhj/tools/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lhj-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.97
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lihaijian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xcodeproj
|