|
@@ -64,9 +64,13 @@ class VoicePromptView(View):
|
|
|
uid = request_dict.get('uid', None)
|
|
|
channel = request_dict.get('channel', None)
|
|
|
type = request_dict.get('type', None)
|
|
|
+ algorithm_type = request_dict.get('algorithmType', None)
|
|
|
|
|
|
if upload_type and uid and channel:
|
|
|
- count = VoicePromptModel.objects.filter(uid=uid, channel=channel, type=type).count()
|
|
|
+ vp_qs = VoicePromptModel.objects.filter(uid=uid, channel=channel, type=type)
|
|
|
+ if algorithm_type:
|
|
|
+ vp_qs.filter(algorithm_type=int(algorithm_type))
|
|
|
+ count = vp_qs.count()
|
|
|
if count >= 3:
|
|
|
return response.json(201)
|
|
|
|
|
@@ -88,6 +92,7 @@ class VoicePromptView(View):
|
|
|
lang = request_dict.get('lang', '')
|
|
|
uid = request_dict.get('uid', None)
|
|
|
channel = request_dict.get('channel', None)
|
|
|
+ algorithm_type = request_dict.get('algorithmType', None)
|
|
|
|
|
|
if filename and title and type and uid and channel:
|
|
|
voice_prompt = VoicePromptModel()
|
|
@@ -99,6 +104,8 @@ class VoicePromptView(View):
|
|
|
voice_prompt.uid = uid
|
|
|
voice_prompt.channel = channel
|
|
|
voice_prompt.add_time = int(time.time())
|
|
|
+ if algorithm_type:
|
|
|
+ voice_prompt.algorithm_type = int(algorithm_type)
|
|
|
voice_prompt.save()
|
|
|
|
|
|
res = {
|
|
@@ -145,7 +152,6 @@ class VoicePromptView(View):
|
|
|
elif ids:
|
|
|
voice_qs = VoicePromptModel.objects.filter(id__in=ids.split(','))
|
|
|
|
|
|
-
|
|
|
if not voice_qs.exists():
|
|
|
return response.json(14)
|
|
|
|
|
@@ -171,11 +177,16 @@ class VoicePromptView(View):
|
|
|
lang = request_dict.get('lang', None)
|
|
|
uid = request_dict.get('uid', None)
|
|
|
channel = request_dict.get('channel', None)
|
|
|
+ # 个性语音增加算法类型区分默认0兼容老版本
|
|
|
+ algorithm_type = int(request_dict.get('algorithmType', 0))
|
|
|
|
|
|
if uid and channel and lang:
|
|
|
- voice_qs = VoicePromptModel.objects.filter(uid=uid, channel=channel, classification=1)
|
|
|
- system_qs = VoicePromptModel.objects.filter(classification=0, language=lang, status=1)
|
|
|
- channel_qs = UidChannelSetModel.objects.filter(uid__uid=uid, channel=channel)
|
|
|
+ voice_qs = VoicePromptModel.objects.filter(uid=uid, channel=channel, classification=1,
|
|
|
+ algorithm_type=algorithm_type)
|
|
|
+ system_qs = VoicePromptModel.objects.filter(classification=0, language=lang, status=1,
|
|
|
+ algorithm_type=algorithm_type)
|
|
|
+ channel_qs = UidChannelSetModel.objects.filter(uid__uid=uid, channel=channel,
|
|
|
+ algorithm_type=algorithm_type)
|
|
|
|
|
|
res = {
|
|
|
'enter_voice': {},
|
|
@@ -373,7 +384,3 @@ class VoicePromptView(View):
|
|
|
return response.json(0)
|
|
|
else:
|
|
|
return response.json(444)
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|