chenjunkai 6 years ago
parent
commit
1c68fad2a8
2 changed files with 0 additions and 28 deletions
  1. 0 2
      Ansjer/urls.py
  2. 0 26
      Controller/OTAEquipment.py

+ 0 - 2
Ansjer/urls.py

@@ -118,8 +118,6 @@ urlpatterns = [
     url(r'^vodBucket/(?P<operation>.*)$', VodBucket.VodBucketView.as_view()),
     url(r'^UIDBucket/(?P<operation>.*)$', VodBucket.UidBucketView.as_view()),
     url(r'^EquipmentVersion/(?P<operation>.*)$', EquipmentOTA.EquipmentVersionView.as_view()),
-    
-    url(r'^dll/otaPack', OTAEquipment.ddlOTAInterface),
 
     url(r'^deviceShare/(?P<operation>.*)$', DeviceShare.DeviceShareView.as_view()),
     url(r'^appVer/views$', AppInfo.AppVersionView.as_view()),

+ 0 - 26
Controller/OTAEquipment.py

@@ -563,30 +563,4 @@ def downloadOTAInterface(request, fullPath, *callback_args, **callback_kwargs):
     else:
         return res.json(444, 'fullPath')
 
-# ota包下载
-@csrf_exempt
-def ddlOTAInterface(request, *callback_args, **callback_kwargs):
-    res = ResponseObject()
-    print('fullPath:')
-    fullPath = 'static/otapack/DVR/en/V1.6.1.21AX1610010480000600000280001A.tar.gz'
-    if fullPath:
-        if os.path.isfile(fullPath):
-            try:
-                wrapper = FileWrapper(open(fullPath, 'rb'))
-                response = HttpResponse(wrapper, content_type="application/octet-stream")
-                response['Content-Length'] = os.path.getsize(fullPath)
-                response['Content-Disposition'] = 'attachment; filename=%s' % os.path.basename(fullPath)
-                response['Content-MD5'] = getMD5orSHA265(fullPath)
-                # 校验文件md5值
-                response['Content-SHA265'] = getMD5orSHA265(fullPath, 'SHA265')
-                response['Content-CRC32'] = getMD5orSHA265(fullPath, 'CRC32')
-                response['Content-Error'] = res.formal(0)
-                return response
-            except Exception as e:
-                return res.json(906, repr(e))
-        else:
-            return res.json(907)
-    else:
-        return res.json(444, 'fullPath')
-