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

修复个性语音根据语言查询返回空数据问题

zhangdongming 2 жил өмнө
parent
commit
a43b59e273

+ 6 - 1
Controller/VoicePromptController.py

@@ -173,7 +173,7 @@ class VoicePromptView(View):
             return response.json(444)
             return response.json(444)
 
 
     def do_query(self, request_dict, response):
     def do_query(self, request_dict, response):
-        lang = request_dict.get('lang', None)
+        lang = request_dict.get('lang', 'en')
         uid = request_dict.get('uid', None)
         uid = request_dict.get('uid', None)
         channel = request_dict.get('channel', None)
         channel = request_dict.get('channel', None)
         # 个性语音增加算法类型区分默认0兼容老版本
         # 个性语音增加算法类型区分默认0兼容老版本
@@ -184,6 +184,9 @@ class VoicePromptView(View):
                                                        algorithm_type=algorithm_type)
                                                        algorithm_type=algorithm_type)
             system_qs = VoicePromptModel.objects.filter(classification=0, language=lang, status=1,
             system_qs = VoicePromptModel.objects.filter(classification=0, language=lang, status=1,
                                                         algorithm_type=algorithm_type)
                                                         algorithm_type=algorithm_type)
+            if not system_qs.exists() and lang != 'en':
+                system_qs = VoicePromptModel.objects.filter(classification=0, language='en', status=1,
+                                                            algorithm_type=algorithm_type)
             channel_qs = UidChannelSetModel.objects.filter(uid__uid=uid, channel=channel,
             channel_qs = UidChannelSetModel.objects.filter(uid__uid=uid, channel=channel,
                                                            algorithm_type=algorithm_type)
                                                            algorithm_type=algorithm_type)
 
 
@@ -270,6 +273,8 @@ class VoicePromptView(View):
             return response.json(444)
             return response.json(444)
 
 
     def admin_get_upload_url(self, userID, request_dict, response):
     def admin_get_upload_url(self, userID, request_dict, response):
+        print(CommonService.createOrderID())
+        return response.json(0)
         own_perm = ModelService.check_perm(userID, 10)
         own_perm = ModelService.check_perm(userID, 10)
         if not own_perm:
         if not own_perm:
             return response.json(404)
             return response.json(404)