|
@@ -33,47 +33,48 @@ class VersionManagement(View):
|
|
|
def validation(self, request_dict, request, operation):
|
|
|
language = request_dict.get('language', 'en')
|
|
|
response = ResponseObject(language, 'pc')
|
|
|
- tko = TokenObject(
|
|
|
- request.META.get('HTTP_AUTHORIZATION'),
|
|
|
- returntpye='pc')
|
|
|
- if tko.code != 0:
|
|
|
- return response.json(tko.code)
|
|
|
- response.lang = tko.lang
|
|
|
- userID = tko.userID
|
|
|
if operation == 'upLoadFile':
|
|
|
return self.upLoadFile(request, request_dict, response)
|
|
|
- elif operation == 'getEquipmentVersionList':
|
|
|
- return self.getEquipmentVersionList(request_dict, response)
|
|
|
- elif operation == 'editVersionInformation':
|
|
|
- return self.editVersionInformation(request_dict, response)
|
|
|
- elif operation == 'deleteEquipmentVersion':
|
|
|
- return self.deleteEquipmentVersion(request_dict, response)
|
|
|
- elif operation == 'getAppVersionList':
|
|
|
- return self.getAppVersionList(request_dict, response)
|
|
|
- elif operation == 'addOrEditAppInfo':
|
|
|
- return self.addOrEditAppInfo(request_dict, response)
|
|
|
- elif operation == 'deleteAppVersion':
|
|
|
- return self.deleteAppVersion(request_dict, response)
|
|
|
- elif operation == 'getAppSet':
|
|
|
- return self.getAppSet(request_dict, response)
|
|
|
- elif operation == 'editAppSet':
|
|
|
- return self.editAppSet(request_dict, response)
|
|
|
- elif operation == 'getAppRecordList':
|
|
|
- return self.getAppRecordList(request_dict, response)
|
|
|
- elif operation == 'getAppBundleIdList':
|
|
|
- return self.getAppBundleIdList(request_dict, response)
|
|
|
- elif operation == 'addOrEditAppRecord':
|
|
|
- return self.addOrEditAppRecord(request_dict, response)
|
|
|
- elif operation == 'deleteAppRecord':
|
|
|
- return self.deleteAppRecord(request_dict, response)
|
|
|
- elif operation == 'getPcInfoList':
|
|
|
- return self.getPcInfoList(request_dict, response)
|
|
|
- elif operation == 'editPcVersion':
|
|
|
- return self.editPcVersion(request_dict, response)
|
|
|
- elif operation == 'deletePcInfo':
|
|
|
- return self.deletePcInfo(request_dict, response)
|
|
|
else:
|
|
|
- return response.json(404)
|
|
|
+ tko = TokenObject(
|
|
|
+ request.META.get('HTTP_AUTHORIZATION'),
|
|
|
+ returntpye='pc')
|
|
|
+ if tko.code != 0:
|
|
|
+ return response.json(tko.code)
|
|
|
+ response.lang = tko.lang
|
|
|
+ userID = tko.userID
|
|
|
+ if operation == 'getEquipmentVersionList':
|
|
|
+ return self.getEquipmentVersionList(request_dict, response)
|
|
|
+ elif operation == 'editVersionInformation':
|
|
|
+ return self.editVersionInformation(request_dict, response)
|
|
|
+ elif operation == 'deleteEquipmentVersion':
|
|
|
+ return self.deleteEquipmentVersion(request_dict, response)
|
|
|
+ elif operation == 'getAppVersionList':
|
|
|
+ return self.getAppVersionList(request_dict, response)
|
|
|
+ elif operation == 'addOrEditAppInfo':
|
|
|
+ return self.addOrEditAppInfo(request_dict, response)
|
|
|
+ elif operation == 'deleteAppVersion':
|
|
|
+ return self.deleteAppVersion(request_dict, response)
|
|
|
+ elif operation == 'getAppSet':
|
|
|
+ return self.getAppSet(request_dict, response)
|
|
|
+ elif operation == 'editAppSet':
|
|
|
+ return self.editAppSet(request_dict, response)
|
|
|
+ elif operation == 'getAppRecordList':
|
|
|
+ return self.getAppRecordList(request_dict, response)
|
|
|
+ elif operation == 'getAppBundleIdList':
|
|
|
+ return self.getAppBundleIdList(request_dict, response)
|
|
|
+ elif operation == 'addOrEditAppRecord':
|
|
|
+ return self.addOrEditAppRecord(request_dict, response)
|
|
|
+ elif operation == 'deleteAppRecord':
|
|
|
+ return self.deleteAppRecord(request_dict, response)
|
|
|
+ elif operation == 'getPcInfoList':
|
|
|
+ return self.getPcInfoList(request_dict, response)
|
|
|
+ elif operation == 'editPcVersion':
|
|
|
+ return self.editPcVersion(request_dict, response)
|
|
|
+ elif operation == 'deletePcInfo':
|
|
|
+ return self.deletePcInfo(request_dict, response)
|
|
|
+ else:
|
|
|
+ return response.json(404)
|
|
|
|
|
|
def getEquipmentVersionList(self, request_dict, response):
|
|
|
mci = request_dict.get('mci', None)
|
|
@@ -167,11 +168,8 @@ class VersionManagement(View):
|
|
|
with open(full_name, 'wb+') as write_file:
|
|
|
for chunk in file.chunks():
|
|
|
write_file.write(chunk)
|
|
|
- LOGGER.info('上传{}成功'.format(file_name))
|
|
|
return response.json(0)
|
|
|
except Exception as e:
|
|
|
- LOGGER.info("错误行数:{errLine}".format(errLine=e.__traceback__.tb_lineno))
|
|
|
- LOGGER.info('上传异常{}'.format(e))
|
|
|
return response.json(500, repr(e))
|
|
|
|
|
|
def editVersionInformation(self, request_dict, response):
|
|
@@ -632,4 +630,4 @@ class VersionManagement(View):
|
|
|
return response.json(0)
|
|
|
except Exception as e:
|
|
|
print(e)
|
|
|
- return response.json(500, repr(e))
|
|
|
+ return response.json(500, repr(e))
|