imperituroard 0.4.5 → 0.4.6
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/internal_functions.rb +49 -37
- 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: a58bf2fa580d9302c52298f16753d340dd112c4f
|
4
|
+
data.tar.gz: d7446a4395ebd1a5a5b0e562e12fa32891a636a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 714c9ed22c6d3d3da51cc56c61d07e80c5975fcf72e845f9df96be024c05d747a3c8135275eb39552fc06d9b89757f7bde4ed343ea1b4a79ce5ecb16b01170a7
|
7
|
+
data.tar.gz: bc9f2bcd2e26fc3729a966f13a45ed18eb0b20ff8eea68adda966f3c7af348c78c020c6b3be034093acbc140bef03abeeb4aae2ce2f0ef00952f19d8cd758013
|
@@ -14,14 +14,14 @@ class InternalFunc
|
|
14
14
|
|
15
15
|
def check_pass_format(passw)
|
16
16
|
if passw!=nil && passw!=""
|
17
|
-
{:code=>200, :result=>"Request completed successfully", :body=>"Data checked"}
|
17
|
+
{:code => 200, :result => "Request completed successfully", :body => "Data checked"}
|
18
18
|
else
|
19
|
-
{:code=>500, :result=>"Request completed", :body=>"invalid password"}
|
19
|
+
{:code => 500, :result => "Request completed", :body => "invalid password"}
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
def printer_texter(text, log_level)
|
24
|
-
mess = {:datetime => datetimenow, :sdk=> "imperituroard", :sdk_version=> Imperituroard::VERSION, :message => text}
|
24
|
+
mess = {:datetime => datetimenow, :sdk => "imperituroard", :sdk_version => Imperituroard::VERSION, :message => text}
|
25
25
|
p mess
|
26
26
|
end
|
27
27
|
|
@@ -34,7 +34,6 @@ class InternalFunc
|
|
34
34
|
end
|
35
35
|
|
36
36
|
|
37
|
-
|
38
37
|
def type_id_list_transform_mongo(id_list)
|
39
38
|
res = []
|
40
39
|
for gh in id_list
|
@@ -51,8 +50,8 @@ class InternalFunc
|
|
51
50
|
output_params = {}
|
52
51
|
|
53
52
|
data = data.to_s
|
54
|
-
str_incr = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',
|
55
|
-
'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'
|
53
|
+
str_incr = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
54
|
+
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
|
56
55
|
]
|
57
56
|
d_a_t_a = data.split('')
|
58
57
|
is_string = 0
|
@@ -73,43 +72,54 @@ class InternalFunc
|
|
73
72
|
#make answer in format that soapgw receive
|
74
73
|
def iot_create_dev_soapgw_answer(input_params, output_answer)
|
75
74
|
|
75
|
+
printer_texter({:input_params => input_params, :output_answer => output_answer, :function => "iot_create_dev_soapgw_answer"}, "debug")
|
76
|
+
|
76
77
|
output_info = {}
|
77
78
|
begin
|
78
79
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
80
|
+
if output_answer[:code] != 200
|
81
|
+
deviceserr = []
|
82
|
+
failednum = input_params[:imei_list].length
|
83
|
+
for gg in input_params[:imei_list]
|
84
|
+
if gg.key?(:imei)
|
85
|
+
deviceserr.append({:failedimei => gg[:imei]})
|
86
|
+
else
|
87
|
+
deviceserr.append({:failedimei => gg["imei"]})
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
output_info = {:code => output_answer[:code],
|
92
|
+
:result => output_answer[:result],
|
93
|
+
:processednum => 0,
|
94
|
+
:failednum => failednum,
|
95
|
+
:deviceserr => deviceserr
|
96
|
+
}
|
97
|
+
|
98
|
+
else
|
99
|
+
deviceserr = []
|
100
|
+
failednum = output_answer[:body][:error_list].length
|
101
|
+
processednum = output_answer[:body][:imei_processed].length
|
102
|
+
for gg in output_answer[:body][:error_list]
|
103
|
+
if gg.key?(:imei)
|
104
|
+
deviceserr.append({:failedimei => gg[:imei]})
|
105
|
+
else
|
106
|
+
deviceserr.append({:failedimei => gg["imei"]})
|
107
|
+
end
|
108
|
+
end
|
109
|
+
output_info = {:code => output_answer[:code],
|
110
|
+
:result => output_answer[:result],
|
111
|
+
:processednum => processednum,
|
112
|
+
:failednum => failednum,
|
113
|
+
:deviceserr => deviceserr
|
114
|
+
}
|
84
115
|
end
|
85
|
-
output_info = { :code => output_answer[:code],
|
86
|
-
:result => output_answer[:result],
|
87
|
-
:processednum => 0,
|
88
|
-
:failednum => failednum,
|
89
|
-
:deviceserr => deviceserr
|
90
|
-
}
|
91
|
-
|
92
|
-
else
|
93
|
-
deviceserr = []
|
94
|
-
failednum = output_answer[:body][:error_list].length
|
95
|
-
processednum = output_answer[:body][:imei_processed].length
|
96
|
-
for gg in output_answer[:body][:error_list]
|
97
|
-
deviceserr.append({:failedimei => gg["imei"]})
|
98
|
-
end
|
99
|
-
output_info = { :code => output_answer[:code],
|
100
|
-
:result => output_answer[:result],
|
101
|
-
:processednum => processednum,
|
102
|
-
:failednum => failednum,
|
103
|
-
:deviceserr => deviceserr
|
104
|
-
}
|
105
|
-
end
|
106
116
|
|
107
117
|
rescue
|
108
|
-
output_info = {
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
118
|
+
output_info = {:code => 500,
|
119
|
+
:result => "iot_create_dev_soapgw_answer: Unknown SDK error",
|
120
|
+
:processednum => 0,
|
121
|
+
:failednum => 0,
|
122
|
+
:deviceserr => []
|
113
123
|
}
|
114
124
|
end
|
115
125
|
|
@@ -119,6 +129,8 @@ class InternalFunc
|
|
119
129
|
# :failednum => :integer,
|
120
130
|
# :deviceserr => [{:failedimei=>:integer}]
|
121
131
|
# }
|
132
|
+
|
133
|
+
printer_texter(output_info, "debug")
|
122
134
|
output_info
|
123
135
|
end
|
124
136
|
|