imperituroard 0.4.6 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/imperituroard/projects/iot.rb +11 -3
- data/lib/imperituroard/projects/iot/add_functions.rb +37 -0
- data/lib/imperituroard/projects/iot/internal_functions.rb +3 -0
- data/lib/imperituroard/projects/mhub/subs/dabrab/dabrab_proced.rb +1 -1
- data/lib/imperituroard/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b51bce400dffd4ca919cb7295742c17015350408
|
4
|
+
data.tar.gz: 68b2e9f01ba2b35953ddf8f47a91bdeb153144b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
144
|
-
|
145
|
-
|
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
|
@@ -74,7 +74,7 @@ end
|
|
74
74
|
"results": [
|
75
75
|
{
|
76
76
|
|
77
|
-
|
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",
|