lhj-tools 0.1.74 → 0.1.75
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 -4
- data/lib/lhj/tools/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7dc72ca4edb2bdcb5abd9ced2b89e97843bbd4393527e28be7b0c750d3f00be7
|
4
|
+
data.tar.gz: 88b0b3444ba3c78ce03bb2bdcb32eef0fa77ea23eec27f41225ea1a7df9a6aa1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27eb16b78e42d2ea284b68cf6678949367a489a15e9fb6961b8b0d3debe74e30daa76f96079416a7f00530c72c183b1ef842882e04bfb4ecbe4a1a974ba1e37a
|
7
|
+
data.tar.gz: 6426a55e2043d21cfcd35d49b05400db2485e6433982d98348db95ef98f3d6bbce210a020d509cc9a1efe1a7fdf843be857279bc0dc72f0e8eaba490a9772304
|
data/lib/lhj/command/yapi.rb
CHANGED
@@ -75,7 +75,7 @@ module Lhj
|
|
75
75
|
# 6.push to git
|
76
76
|
push_to_git if @sync
|
77
77
|
# 7.notify robot
|
78
|
-
notify_robot(file_map) if @notify
|
78
|
+
notify_robot(file_map, res_body, project_info) if @notify
|
79
79
|
end
|
80
80
|
|
81
81
|
def puts_h(str)
|
@@ -117,7 +117,7 @@ module Lhj
|
|
117
117
|
File.write(m_file, @m_file_array.join("\n")) if @m_file_array.count.positive?
|
118
118
|
File.write(service_file, service_code) if service_code
|
119
119
|
puts "\n\n生成文件成功!所在路径:\n#{File.expand_path(h_file)} \n#{File.expand_path(m_file)}".green
|
120
|
-
{ h_file: h_file, m_file: m_file, s_file: service_file
|
120
|
+
{ h_file: h_file, m_file: m_file, s_file: service_file }
|
121
121
|
end
|
122
122
|
|
123
123
|
def push_to_git
|
@@ -127,10 +127,14 @@ module Lhj
|
|
127
127
|
Actions.sh('git push')
|
128
128
|
end
|
129
129
|
|
130
|
-
def notify_robot(
|
130
|
+
def notify_robot(file_info, interface_info, project_info)
|
131
|
+
temp_vars = file_info.merge({
|
132
|
+
api_id: api_id,
|
133
|
+
interface_url: "#{project_info['data']['basepath']}#{interface_info['data']['path']}"
|
134
|
+
})
|
131
135
|
robot_url = 'https://oapi.dingtalk.com/robot/send?access_token=fe879fd3e7a3b5e59d5719b2384845b7884901919be5a78fe443cbf777869807'
|
132
136
|
template = Lhj::ErbTemplateHelper.load('oc_code_notify')
|
133
|
-
output = Lhj::ErbTemplateHelper.render(template,
|
137
|
+
output = Lhj::ErbTemplateHelper.render(template, temp_vars, '-')
|
134
138
|
Lhj::Dingtalk.post_message_robot(robot_url, '生成代码', output)
|
135
139
|
end
|
136
140
|
|
data/lib/lhj/tools/version.rb
CHANGED