Forráskód Böngészése

算法资源增加资源字段

zhangdongming 1 éve
szülő
commit
f350bc97e5

+ 4 - 2
Controller/AlgorithmShop/AlgorithmShopController.py

@@ -322,7 +322,8 @@ class AlgorithmShopView(View):
                 .values('algorithm_type__id', 'algorithm_type__type',
                         'algorithm_type__icon_url',
                         'title', 'subtitle', 'algorithm_type__image_url',
-                        'algorithm_type__basic_function', 'concerning')
+                        'algorithm_type__basic_function', 'concerning',
+                        'algorithm_type__resource')
             algorithm_list = []
             if not algorithm_qs.exists():
                 return response.json(0, algorithm_list)
@@ -340,7 +341,8 @@ class AlgorithmShopView(View):
                     'subtitle': item['subtitle'],
                     'setting': setting,
                     'basicFunction': item['algorithm_type__basic_function'],
-                    'concerning': item['concerning']
+                    'concerning': item['concerning'],
+                    'resource': item['algorithm_type__resource']
                 })
             return response.json(0, algorithm_list)
         except Exception as e:

+ 2 - 1
Model/models.py

@@ -3084,7 +3084,7 @@ class DeviceAlgorithmScenario(models.Model):
 class DeviceAlgorithmType(models.Model):
     id = models.AutoField(primary_key=True)
     # 0:移动侦测,1:人形检测,2:挥手识别,3:人脸检测,4:异声感知,5:车辆检测,7:宠物检测,6:哭声检测,8:徘徊检测
-    # 9:区域闯入,10:区域闯出,11:长时间无人检测,12:往来检测,13:云相册,14:火焰检测
+    # 9:区域闯入,10:区域闯出,11:长时间无人检测,12:往来检测,13:云相册,14:火焰检测,15:婴儿遮面
     type = models.SmallIntegerField(default=0, verbose_name='算法类型')
     memory = models.CharField(max_length=32, default='', verbose_name='所需内存')
     down_count = models.IntegerField(default=0, verbose_name='下载次数')
@@ -3098,6 +3098,7 @@ class DeviceAlgorithmType(models.Model):
     image_url = models.CharField(max_length=255, default='', verbose_name='图片地址')
     details_img_url = models.CharField(max_length=255, default='', verbose_name='详情图')
     icon_url = models.CharField(max_length=255, default='', verbose_name='图标地址')
+    resource = models.CharField(max_length=255, default='', verbose_name='算法资源')
     created_time = models.IntegerField(default=0, verbose_name='创建时间')
 
     class Meta: