Browse Source

修改edit_app_device_type接口

keiSenFront 1 year ago
parent
commit
82aaebd72f
1 changed files with 5 additions and 2 deletions
  1. 5 2
      AdminController/DeviceManagementController.py

+ 5 - 2
AdminController/DeviceManagementController.py

@@ -537,6 +537,7 @@ class DeviceManagement(View):
         lang = request_dict.get('lang', None)
         name = request_dict.get('name', None)
         sort = request_dict.get('sort', None)
+        version_number = request_dict.get('version_number', None)
 
         if not all([app_device_type_id, model, type, device_name_language_id, lang, name, sort]):
             return response.json(444)
@@ -544,7 +545,8 @@ class DeviceManagement(View):
             with transaction.atomic():
                 if icon:
                     icon_path = 'https://ansjerfilemanager.s3.amazonaws.com/app/device_type_images/{}'.format(icon)
-                    AppDeviceType.objects.filter(id=app_device_type_id).update(model=model, type=type, icon=icon_path)
+                    AppDeviceType.objects.filter(id=app_device_type_id)\
+                        .update(model=model, type=type, icon=icon_path, app_version_number_id=version_number)
                     bucket_name = 'ansjerfilemanager'
                     file_key = 'app/device_type_images/{}'.format(icon)
                     s3 = AmazonS3Util(AWS_ACCESS_KEY_ID[1], AWS_SECRET_ACCESS_KEY[1], AWS_SES_ACCESS_REGION)
@@ -555,7 +557,8 @@ class DeviceManagement(View):
                         icon,
                         {'ContentType': icon.content_type, 'ACL': 'public-read'})
                 else:
-                    AppDeviceType.objects.filter(id=app_device_type_id).update(model=model, type=type)
+                    AppDeviceType.objects.filter(id=app_device_type_id)\
+                        .update(model=model, type=type, app_version_number_id=version_number)
                 DeviceNameLanguage.objects.filter(id=device_name_language_id).update(lang=lang, name=name, sort=sort)
             return response.json(0)
         except Exception as e: