lib/imperituroard/projects/iot/add_functions.rb in imperituroard-0.4.6 vs lib/imperituroard/projects/iot/add_functions.rb in imperituroard-0.4.7

- old
+ new

@@ -135,6 +135,43 @@ def check_input_6(login, imei_list) {:code=>200, :result=>"Request completed successfully", :body=>"Data checked"} end + def iot_query_dev_soapgw_answer(input_params, output_answer) + + answ = {} + + p output_answer + + begin + + if output_answer[:code]==200 + dataaa = [] + dataaa_failed = [] + + ddd = answ_dev_query_format_process(output_answer[:data])[:body] + p ddd + + answ = { :code => output_answer[:code], + :result => output_answer[:result], + :data => ddd[:ok], + :error_list => ddd[:failed] + } + else + answ = { :code => output_answer[:code], + :result => output_answer[:result], + :data => [], + :error_list => input_params[:imei] + } + end + rescue + answ = { :code => 500, + :result => "Unknown error" + } + end + + answ + + end + end \ No newline at end of file