110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
# File 'lib/maptool/release/release.rb', line 110
def send
params = {}
params["token"] = 'y2uxndvkoweyndixmdaw'
params["chatId"] = 'chat326235a84efbc799daaf5d72522cb8fd'
params["retry"] = 'false'
params["sender"] = self.sender
params["content"] = self.content
puts "\nsend 钉钉".green
puts self.content
base_path = 'http://api-kylin.intra.xiaojukeji.com/prod_feige_service'
uri = URI.parse("#{base_path}/feige/sendDingGroup")
req = Net::HTTP::Post.new(uri.path, {'Content-Type' => 'application/json'})
req.body = params.to_json
res = Net::HTTP.new(uri.host, uri.port).start{|http|
http.request(req)
}
resbody = JSON.parse(res.body)
puts resbody
if resbody["code"].to_s == "0"
puts "send succeed: #{resbody['message']}".green
else
puts "send error: #{resbody['message']}".red
end
end
|