lhj-tools 0.1.74 → 0.1.75

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f86764f14d88348e59221a4e339765a6ec4488a815d179a710d15e7c415471a1
4
- data.tar.gz: 9f5635a3e149ce527aea1c298fa7a39316c446e75aaed941d23c6010ce0896de
3
+ metadata.gz: 7dc72ca4edb2bdcb5abd9ced2b89e97843bbd4393527e28be7b0c750d3f00be7
4
+ data.tar.gz: 88b0b3444ba3c78ce03bb2bdcb32eef0fa77ea23eec27f41225ea1a7df9a6aa1
5
5
  SHA512:
6
- metadata.gz: 144bfb6d35d9190b81ed1715dd518c2b707971815a3412f279f673faffb4c6dd36768c05c86da1249d9eed7328620a0588fe62a3753b249fd9fd8625726bb0d3
7
- data.tar.gz: 6d875c726247374420c5b2856614283a817078e073517a3dc5849b7a9258567eefffc9df76f3d54ec58836f647ef922ea6169c5fe9211d53630ab39a2fe78570
6
+ metadata.gz: 27eb16b78e42d2ea284b68cf6678949367a489a15e9fb6961b8b0d3debe74e30daa76f96079416a7f00530c72c183b1ef842882e04bfb4ecbe4a1a974ba1e37a
7
+ data.tar.gz: 6426a55e2043d21cfcd35d49b05400db2485e6433982d98348db95ef98f3d6bbce210a020d509cc9a1efe1a7fdf843be857279bc0dc72f0e8eaba490a9772304
@@ -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, api_id: api_id }
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(template_vars)
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, template_vars, '-')
137
+ output = Lhj::ErbTemplateHelper.render(template, temp_vars, '-')
134
138
  Lhj::Dingtalk.post_message_robot(robot_url, '生成代码', output)
135
139
  end
136
140
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lhj
4
4
  module Tools
5
- VERSION = "0.1.74"
5
+ VERSION = "0.1.75"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lhj-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.74
4
+ version: 0.1.75
5
5
  platform: ruby
6
6
  authors:
7
7
  - lihaijian