Эх сурвалжийг харах

Merge branch 'test' into pzb

chenjunkai 6 жил өмнө
parent
commit
ce8dcf5a48

+ 23 - 0
Ansjer/mqtt/mqtt_client.py

@@ -11,6 +11,29 @@
 @file: mqtt_client.py
 @file: mqtt_client.py
 @Contact: chanjunkai@163.com
 @Contact: chanjunkai@163.com
 """
 """
+
+# encoding: utf-8
+
+
+import paho.mqtt.client as mqtt
+
+
+def on_connect(client, userdata, flags, rc):
+    print("Connected with result code "+str(rc))
+    client.subscribe("chat")
+
+
+def on_message(client, userdata, msg):
+    print(msg.topic+" " + ":" + str(msg.payload))
+
+client = mqtt.Client()
+client.on_connect = on_connect
+client.on_message = on_message
+client.connect("192.168.136.45", 1883, 60)
+client.loop_forever()
+
+
+exit()
 import paho.mqtt.client as mqtt
 import paho.mqtt.client as mqtt
 
 
 HOST = "192.168.136.45"
 HOST = "192.168.136.45"

+ 3 - 1
Controller/AppInfo.py

@@ -78,7 +78,9 @@ class AppInfo(View):
                                          'app_type': app_info.app_type,
                                          'app_type': app_info.app_type,
                                          'downloadLink': app_info.downloadLink,
                                          'downloadLink': app_info.downloadLink,
                                          'id': app_info.id,
                                          'id': app_info.id,
-                                         'bundleVersion': app_info.bundleVersion})
+                                         'bundleVersion': app_info.bundleVersion,
+                                         'minAppversion':app_info.minAppversion
+                                         })
         else:
         else:
             return response.json(444, 'app_type,appBundleId')
             return response.json(444, 'app_type,appBundleId')