imperituroard 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e82d66d85db1bd66d2a98362544e98de744cf142
4
- data.tar.gz: 71a88db5237cc41dbc305efcfb3de6ea5158379e
3
+ metadata.gz: aed6187f630376b03b976303e1fa4f87800d036e
4
+ data.tar.gz: 94fad4b56fd4a5926d3b6433ea7da900cd4d1e20
5
5
  SHA512:
6
- metadata.gz: 7a30826bee6fcb2d3bf180bda82fa41893138b471d28f611065874f1d05ebb13bc3246f613d1b292a50aa44501f1301e6606b0f700aba0f1c195fa1f5362ceb7
7
- data.tar.gz: 85e5c0a75b626cd7eaaeda049a6ca3c2209b58b120b3930bfebaa2f74c2b4fb6300ceb6d23b10465a0dcb7088e3d302ad62b8ee56d08a66628ca4c679601d67b
6
+ metadata.gz: e445408da82e71836bb61a94c0ab26cb166e904b48b8aa03f23c0395803cfa3a2ce5026a89364bdfc88b1561c8148815465df8dfcd6313b60fe0e950baf494c8
7
+ data.tar.gz: 740a6cbee54ce5949bf0059d3847a86bb66486f43d90b8e766ddf74b362e56f70e44784b71f2bc1643b32e27e11822f33b42c3145493a312948ad61e230c0370
@@ -51,6 +51,4 @@ Gem::Specification.new do |spec|
51
51
  spec.add_dependency "simpleidn", "0.1.1"
52
52
  spec.add_dependency "net-scp", "3.0.0"
53
53
 
54
-
55
-
56
54
  end
@@ -86,6 +86,9 @@ class IotFunctions_2
86
86
 
87
87
  for ss in list_checked[:body][:exists]
88
88
  not_processed_list.append({:imei => ss, :error => "Device exists in database"})
89
+ p ss
90
+ p "ss"
91
+ p list_checked
89
92
  end
90
93
 
91
94
  for jj in list_checked[:body][:not_exists]
@@ -686,6 +689,7 @@ class IotFunctions_2
686
689
 
687
690
 
688
691
  #7 procedure for subscriber autorization
692
+ # save data to mongodb
689
693
  def autorize_subscriber_2(login, password)
690
694
  input_json = {:login => login, :password => password}
691
695
  resp_out = {}
@@ -717,6 +721,7 @@ class IotFunctions_2
717
721
  end
718
722
 
719
723
 
724
+ #8 get available profiles by login
720
725
  def get_available_prof_2(login)
721
726
 
722
727
  input_params = {:login => login}
@@ -767,7 +772,7 @@ class IotFunctions_2
767
772
  resp_out
768
773
  end
769
774
 
770
-
775
+ #9 get available device types by login
771
776
  def get_available_types_2(login)
772
777
 
773
778
  input_params = {:login => login}
@@ -824,7 +829,64 @@ class IotFunctions_2
824
829
  end
825
830
 
826
831
 
827
- #10 get info for device type
832
+ #10 get available device types by login and profile. procedure update
833
+ def get_available_types2_2(login, profile)
834
+
835
+ input_params = {:login => login}
836
+ resp_out = {}
837
+
838
+ begin
839
+ data_processed = []
840
+ data_soapgw = []
841
+ login_info = mongo_client.get_login_inf2_select(login)
842
+ if login_info[:code]==200
843
+
844
+ permit_profiles = login_info[:body]["permit_profiles"]
845
+ permit_types = login_info[:body]["permit_types"]
846
+
847
+ data_from_mongo = mongo_client.get_type_list_by_id(permit_types)
848
+
849
+ for ff in data_from_mongo
850
+ data_processed.append({:type_id => ff["type_id"],
851
+ :description => ff["description"],
852
+ :note => ff["note"],
853
+ :form => ff["form"],
854
+ :ManufacturerID => ff["ManufacturerID"],
855
+ :ManufacturerNAME => ff["ManufacturerNAME"],
856
+ :device_type => ff["device_type"],
857
+ :model => ff["model"],
858
+ :info => ff["info"]
859
+ })
860
+ data_soapgw.append({:name => ff["model"], :form => ff["form"], :description => ff["description"], :type_id => ff["type_id"]})
861
+ end
862
+
863
+ tosoapgw = {:code => 200,
864
+ :result => "Request completed successfully",
865
+ :types => data_soapgw
866
+ }
867
+
868
+ resp_out = {:code => 200, :result => "Request completed successfully", :body => {:data => data_processed, :tosoapgw => tosoapgw}}
869
+ else
870
+ tosoapgw = {:code => login_info[:code],
871
+ :result => login_info[:result],
872
+ :types => data_soapgw
873
+ }
874
+ resp_out = {:code => login_info[:code], :result => login_info[:result], :body => {:tosoapgw => tosoapgw}}
875
+ end
876
+
877
+ rescue
878
+ tosoapgw = {:code => 507,
879
+ :result => "Unknown SDK error",
880
+ :types => data_soapgw
881
+ }
882
+ resp_out = {:code => 507, :result => "Unknown SDK error", :body => {:tosoapgw => tosoapgw}}
883
+ end
884
+ mongo_client.audit_logger("get_available_types_2", remote_ip, input_params, resp_out, real_ip)
885
+ resp_out
886
+ end
887
+
888
+
889
+ #11 get info for device type
828
890
  def get_info_data_type_2(type)
829
891
 
830
892
  input_params = {:type => type}
@@ -854,7 +916,7 @@ class IotFunctions_2
854
916
  end
855
917
 
856
918
 
857
- #11 get info for profile
919
+ #12 get info for profile
858
920
  def get_info_data_profile_2(profile)
859
921
 
860
922
  input_params = {:profile => profile}
@@ -23,9 +23,10 @@ class MhubFunctions_2
23
23
  :dabrab_connecter,
24
24
  :static_callback,
25
25
  :crm_connector,
26
- :telegram_connector
26
+ :telegram_connector,
27
+ :sms_alphaname
27
28
 
28
- def initialize(sk_url_simple, sk_login, sk_password, telegram_api_url, telegram_chat_id, sk_url_broadcast, static_callback, crm_callback_url, crm_login, crm_password)
29
+ def initialize(sk_url_simple, sk_login, sk_password, telegram_api_url, telegram_chat_id, sk_url_broadcast, static_callback, crm_callback_url, crm_login, crm_password, sms_alphaname)
29
30
  @sk_url = sk_url_simple
30
31
  @sk_login = sk_login
31
32
  @sk_password = sk_password
@@ -36,6 +37,7 @@ class MhubFunctions_2
36
37
  @telegram_connector = Telegram_2.new(telegram_api_url, telegram_chat_id)
37
38
  @static_callback = static_callback
38
39
  @crm_connector = Crm_2.new(crm_callback_url, crm_login, crm_password, telegram_api_url, telegram_chat_id)
40
+ @sms_alphaname = sms_alphaname
39
41
  end
40
42
 
41
43
 
@@ -91,13 +93,13 @@ class MhubFunctions_2
91
93
  msisdn2 = dabrab_connecter.num_formatter(params["destinations"], params["notifyUrl"].split(":")[2])
92
94
 
93
95
  if null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
94
- hub_resp = mhub_connector.sk_send_sms_list(msisdn2, static_callback, params["sms"]["text"], "TEST")
96
+ hub_resp = mhub_connector.sk_send_sms_list(msisdn2, static_callback, params["sms"]["text"], sms_alphaname)
95
97
  elsif !null_statement.include?(params["viber"]) && null_statement.include?(params["sms"])
96
98
  hub_resp = mhub_connector.sk_send_viber_list(msisdn2, static_callback, params["viber"]["text"])
97
99
  elsif !null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
98
100
  p "vibersms"
99
101
  p msisdn2
100
- hub_resp = mhub_connector.sk_send_viber_sms_list(msisdn2, static_callback, params["sms"]["text"], params["viber"]["text"], "TEST")
102
+ hub_resp = mhub_connector.sk_send_viber_sms_list(msisdn2, static_callback, params["sms"]["text"], params["viber"]["text"], sms_alphaname)
101
103
  else
102
104
  output_params = {"code": 502, "result": "Invalid input data st2", "body": {"answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
103
105
  end
@@ -1,3 +1,3 @@
1
1
  module Imperituroard
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
data/lib/imperituroard.rb CHANGED
@@ -272,7 +272,7 @@ class Mhub_2
272
272
  :static_callback,
273
273
  :crm_connector
274
274
 
275
- def initialize(sk_url_simple, sk_login, sk_password, telegram_api_url, telegram_chat_id, sk_url_broadcast, static_callback, crm_callback_url, crm_login, crm_password)
275
+ def initialize(sk_url_simple, sk_login, sk_password, telegram_api_url, telegram_chat_id, sk_url_broadcast, static_callback, crm_callback_url, crm_login, crm_password, sms_alphaname)
276
276
  @sk_url = sk_url_simple
277
277
  @sk_login = sk_login
278
278
  @sk_password = sk_password
@@ -280,13 +280,11 @@ class Mhub_2
280
280
  @mhub_connector = Sksk_2.new(sk_url_simple, sk_login, sk_password, sk_url_broadcast, telegram_api_url, telegram_chat_id)
281
281
  @internal_func = InternalFunc.new
282
282
  @dabrab_connecter = Dabrab.new
283
-
284
283
  @static_callback = static_callback
285
284
  @crm_connector = Crm_2.new(crm_callback_url, crm_login, crm_password, telegram_api_url, telegram_chat_id)
286
- @mhub_connector = MhubFunctions_2.new(sk_url_simple, sk_login, sk_password, telegram_api_url, telegram_chat_id, sk_url_broadcast, static_callback, crm_callback_url, crm_login, crm_password)
285
+ @mhub_connector = MhubFunctions_2.new(sk_url_simple, sk_login, sk_password, telegram_api_url, telegram_chat_id, sk_url_broadcast, static_callback, crm_callback_url, crm_login, crm_password, sms_alphaname)
287
286
  end
288
287
 
289
-
290
288
  #{"destinations"=>[{"to"=>{"phoneNumber"=>"375297116638", "emailAddress"=>nil}}],
291
289
  # "scenarioKey"=>"1", "viber"=>nil, "sms"=>{"text"=>"карточка готова"},
292
290
  # "sendAt"=>"2019-08-15T08:40:00.000", "notifyUrl"=>"https://bpmonline.bankdabrabyt.by:444/0/ServiceModel/ScGetReports.svc/GetReports",
@@ -296,18 +294,14 @@ class Mhub_2
296
294
  # "notifyUrl"=>"https://bpmonline.bankdabrabyt.by:444/0/ServiceModel/ScGetReports.svc/GetReports",
297
295
  # "notifyContentType"=>"application/json"}}
298
296
 
299
-
300
297
  def get_send_message(params, ip_src, ip_real, ip_vip)
301
298
  mhub_connector.get_send_message_2(params, ip_src, ip_real, ip_vip)
302
299
  end
303
300
 
304
-
305
301
  def recieve_delivery_report(params, ip_src, ip_real, ip_vip)
306
302
  mhub_connector.rec_deliv_report_2(params, ip_src, ip_real, ip_vip)
307
303
  end
308
304
 
309
-
310
-
311
305
  end
312
306
 
313
307
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imperituroard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dzmitry Buynovskiy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-15 00:00:00.000000000 Z
11
+ date: 2020-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler