lib/lhj/command/yapi.rb in lhj-tools-0.1.96 vs lib/lhj/command/yapi.rb in lhj-tools-0.1.97

- old
+ new

@@ -146,14 +146,14 @@ req_mock_file: "#{sub_folder_name}/#{model_pre}#{name}Mock.m" } end def push_to_git - Actions.sh('git checkout master') - Actions.sh('git add .') - Actions.sh("git commit -m 'generate yapi code'") - Actions.sh('git push') + Actions.sh('git checkout master', log: false) + Actions.sh('git add .', log: false) + Actions.sh("git commit -m 'generate yapi code'", log: false) + Actions.sh('git push', log: false) end def notify_robot(upload_info, interface_info, project_info) i_url = "#{project_info['data']['basepath']}#{interface_info['data']['path']}" username = interface_info['data']['username'] @@ -167,10 +167,13 @@ interface_url: i_url, api_url: api_url }) template = Lhj::ErbTemplateHelper.load('oc_code_notify') output = Lhj::ErbTemplateHelper.render(template, temp_vars, '-') - Lhj::Dingtalk.post_message_robot(robot_url, 'yapi generate', output) + btn_array = [ + { 'title' => '查看Yapi', 'actionURL' => api_url } + ] + Lhj::Dingtalk.post_card_message_robot(robot_url, 'yapi generate', output, btn_array) end def interface_url_str "#{@config_base_url}/#{API_INTERFACE_URL}#{api_id}" end