|
@@ -152,7 +152,7 @@ class AlgorithmShopView(View):
|
|
if not lang:
|
|
if not lang:
|
|
return response.json(444)
|
|
return response.json(444)
|
|
# 获取应用场景列表
|
|
# 获取应用场景列表
|
|
- scenario_qs = DeviceAppScenario.objects.all().order_by('sort') \
|
|
|
|
|
|
+ scenario_qs = DeviceAppScenario.objects.filter().exclude(type=0).all().order_by('sort') \
|
|
.values('id', 'type', 'cver_url', 'banner_url')
|
|
.values('id', 'type', 'cver_url', 'banner_url')
|
|
scenario_list = []
|
|
scenario_list = []
|
|
if not scenario_qs.exists():
|
|
if not scenario_qs.exists():
|
|
@@ -176,7 +176,13 @@ class AlgorithmShopView(View):
|
|
.annotate(algorithmId=F('algorithm_type__id'), algorithmType=F('algorithm_type__type'),
|
|
.annotate(algorithmId=F('algorithm_type__id'), algorithmType=F('algorithm_type__type'),
|
|
iconUrl=F('algorithm_type__icon_url'),
|
|
iconUrl=F('algorithm_type__icon_url'),
|
|
algorithmName=F('title')).values('algorithmId', 'algorithmType', 'iconUrl', 'algorithmName')
|
|
algorithmName=F('title')).values('algorithmId', 'algorithmType', 'iconUrl', 'algorithmName')
|
|
- result_dto = {'scenarioList': scenario_list, 'scenarioUrl': ''}
|
|
|
|
|
|
+ scenario_qs = DeviceAppScenario.objects.filter(type=0) \
|
|
|
|
+ .values('cver_url', 'banner_url')
|
|
|
|
+ scenario_banner = {}
|
|
|
|
+ if scenario_qs.exists():
|
|
|
|
+ scenario_banner['cverUrl'] = scenario_qs[0]['cver_url']
|
|
|
|
+ scenario_banner['bannerUrl'] = scenario_qs[0]['banner_url']
|
|
|
|
+ result_dto = {'scenarioList': scenario_list, 'scenarioUrl': scenario_banner}
|
|
if algorithm_qs.exists():
|
|
if algorithm_qs.exists():
|
|
result_dto['iconList'] = list(algorithm_qs)
|
|
result_dto['iconList'] = list(algorithm_qs)
|
|
return response.json(0, result_dto)
|
|
return response.json(0, result_dto)
|