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

添加根据uid查询设备初始化字符接口

locky 4 жил өмнө
parent
commit
6983bf9354

+ 16 - 0
Controller/UIDController.py

@@ -66,6 +66,8 @@ class UIDView(View):
             return self.do_history(token.userID, request_dict, response)
         elif operation == 'statistics':
             return self.do_admin_statistics(token.userID, request_dict, response)
+        elif operation == 'query_init_string':
+            return self.query_init_string(token.userID, request_dict, response)
         else:
             return response.json(309)
 
@@ -487,3 +489,17 @@ class UIDView(View):
 
         return response.json(0, res)
 
+    def query_init_string(self, userID, request_dict, response):
+        uid = request_dict.get('uid', None)
+        if not uid:
+            return response.json(444)
+        uid_qs = UIDModel.objects.filter(uid=uid).values('platform', 'init_string', 'init_string_app')
+        if not uid_qs.exists():
+            return response.json(173)
+        res = {
+            'platform': uid_qs[0]['platform'],
+            'init_string': uid_qs[0]['init_string'],
+            'init_string_app': uid_qs[0]['init_string_app'],
+        }
+        return response.json(0, res)
+