lib/lhj/command/yapi.rb in lhj-tools-0.1.11 vs lib/lhj/command/yapi.rb in lhj-tools-0.1.12
- old
+ new
@@ -57,11 +57,15 @@
end
def process(config_file)
load_config(config_file)
res_body = req_api_model
- return unless res_body && res_body['errcode'].to_i.zero? && !res_body.empty?
+ unless res_body['errcode'].to_i.zero?
+ puts '请修改 ~/.lhj/yapi.yml文件的对应的__wpkreporterwid_,_yapi_token,_yapi_uid这三个值'.red
+ return
+ end
+ return unless res_body && !res_body.empty?
# 1.print request result
print_res_body_model(res_body)
# 2.print request json body
print_req_body_model(res_body)
@@ -320,9 +324,11 @@
puts_h "///#{des} #{h['example']}"
puts_h "@property (nonatomic, copy) NSString *#{h['name']};"
end
puts_h '@end'
puts "\n\n"
+
+ @param_model_name = 'MLParamModel' if @param_model_name.empty?
end
def print_http_method(data)
return unless data