imperituroard 0.4.6 → 0.4.7

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
  SHA1:
3
- metadata.gz: a58bf2fa580d9302c52298f16753d340dd112c4f
4
- data.tar.gz: d7446a4395ebd1a5a5b0e562e12fa32891a636a6
3
+ metadata.gz: b51bce400dffd4ca919cb7295742c17015350408
4
+ data.tar.gz: 68b2e9f01ba2b35953ddf8f47a91bdeb153144b1
5
5
  SHA512:
6
- metadata.gz: 714c9ed22c6d3d3da51cc56c61d07e80c5975fcf72e845f9df96be024c05d747a3c8135275eb39552fc06d9b89757f7bde4ed343ea1b4a79ce5ecb16b01170a7
7
- data.tar.gz: bc9f2bcd2e26fc3729a966f13a45ed18eb0b20ff8eea68adda966f3c7af348c78c020c6b3be034093acbc140bef03abeeb4aae2ce2f0ef00952f19d8cd758013
6
+ metadata.gz: b660a1144c483fdf9f49cd46790e33b54d525c7a81eebe664d8dc623b8bb769ef8a0811e92de4e4e2d3d138f8ee99a585e0a75be466b80eee25f5fee1a29e291
7
+ data.tar.gz: a8f58183102edd7bbd8a003bb4b557ddc27264f7bed4a8e96e566ad1b26a17a053b95e6f048031da5ea3553dc78c41929b584ea0bf70d26b1043cb030a290cce
@@ -140,9 +140,13 @@ class IotFunctions_2
140
140
 
141
141
  #########end iot platform logic#######
142
142
 
143
- mongo_client.imei_insert_list(added_on_iot_platf)
144
- resp_out = {:code => 200, :result => "Data processed", :body => {:imei_processed => added_on_iot_platf, :error_list => not_processed_list}}
145
- else
143
+ if added_on_iot_platf.length != 0
144
+ mongo_client.imei_insert_list(added_on_iot_platf)
145
+ resp_out = {:code => 200, :result => "Data processed", :body => {:imei_processed => added_on_iot_platf, :error_list => not_processed_list}}
146
+ else
147
+ resp_out = {:code => 202, :result => "Empty list. Nothing for insertion", :body => {:imei_processed => added_on_iot_platf, :error_list => not_processed_list}}
148
+ end
149
+ else
146
150
  resp_out = {:code => 400, :result => "IOT platform credentials not found"}
147
151
  end
148
152
 
@@ -227,8 +231,12 @@ class IotFunctions_2
227
231
  resp_out = {:code => 507, :result => "Unknown SDK error"}
228
232
  end
229
233
  thr2.join
234
+
235
+ resp_out[:data][:tosoapgw] = add_functions_connector.iot_query_dev_soapgw_answer(input_json, resp_out)
236
+
230
237
  mongo_client.audit_logger("device_find", remote_ip, input_json, resp_out, real_ip)
231
238
  resp_out
239
+
232
240
  end
233
241
 
234
242
  #!3 device modify, change imei
@@ -137,4 +137,41 @@ class AdditionalFunc
137
137
  {:code=>200, :result=>"Request completed successfully", :body=>"Data checked"}
138
138
  end
139
139
 
140
+ def iot_query_dev_soapgw_answer(input_params, output_answer)
141
+
142
+ answ = {}
143
+
144
+ p output_answer
145
+
146
+ begin
147
+
148
+ if output_answer[:code]==200
149
+ dataaa = []
150
+ dataaa_failed = []
151
+
152
+ ddd = answ_dev_query_format_process(output_answer[:data])[:body]
153
+ p ddd
154
+
155
+ answ = { :code => output_answer[:code],
156
+ :result => output_answer[:result],
157
+ :data => ddd[:ok],
158
+ :error_list => ddd[:failed]
159
+ }
160
+ else
161
+ answ = { :code => output_answer[:code],
162
+ :result => output_answer[:result],
163
+ :data => [],
164
+ :error_list => input_params[:imei]
165
+ }
166
+ end
167
+ rescue
168
+ answ = { :code => 500,
169
+ :result => "Unknown error"
170
+ }
171
+ end
172
+
173
+ answ
174
+
175
+ end
176
+
140
177
  end
@@ -135,6 +135,9 @@ class InternalFunc
135
135
  end
136
136
 
137
137
 
138
+
139
+
140
+
138
141
  def test()
139
142
  p "eeeeeeeeeeeeeeeeeeeeeeee"
140
143
  end
@@ -74,7 +74,7 @@ end
74
74
  "results": [
75
75
  {
76
76
 
77
- # "bulkId": "9a410cb0-091e-41cf-a640-5d37bee14d9a",
77
+ "bulkId": "00000000-0000-0000-0000-000000000000",
78
78
  "messageId": hub_report[:report][:message_id],
79
79
  "to": hub_report[:report][:number],
80
80
  # "sentAt": "2020-05-05T20:00:00.000+0000",
@@ -1,3 +1,3 @@
1
1
  module Imperituroard
2
- VERSION = "0.4.6"
2
+ VERSION = "0.4.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imperituroard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dzmitry Buynovskiy