def AgainCreateDrop(): result = BaseModel().CreateDropRequest( True, get_auth_token(session.get('admin'))) if type(result).__name__ == 'str': return ResultDeal(msg=result, code=-1) return ResultDeal(data=result)
def GetAllUserLoginCount(): result = BaseModel().GetAllUserLoginCount() if type(result).__name__ == 'str': return ResultDeal(msg=result, code=-1) return ResultDeal(data=result)
def ImportSql(): result = BaseModel().ImportSql(request.files.get('document')) if type(result).__name__ == 'str': return ResultDeal(msg=result, code=-1) return ResultDeal(data=result)
def GetReadmeContent(): result = BaseModel().GetReadmeContent() if type(result).__name__ == 'str': return ResultDeal(msg=result, code=-1) return ResultDeal(data=result)
def GetLoginInfo(): result = BaseModel().GetLoginInfo(session.get('username')) if type(result).__name__ == 'str': return ResultDeal(msg=result, code=-1) return ResultDeal(data=result)
def GetLoginInfo(): result = BaseModel().GetLoginInfo(request.form.get('admin_id'), request.form.get('time')) if type(result).__name__ == 'str': return ResultDeal(msg=result, code=-1) return ResultDeal(data=result)
def ImportSql(): file = request.files.get('document') if not file: return ResultDeal(msg=u'请选择上传文件', code=-1) result = BaseModel().ImportSql(file) if type(result).__name__ == 'str': return ResultDeal(msg=result, code=-1) return ResultDeal(data=result)
def ExportSql(): result = BaseModel().ExportSql(int(request.form.get('type'))) if type(result).__name__ == 'str': return ResultDeal(msg=result, code=-1) if os.path.exists(result['path']): res = make_response(readFile(result['path'], 'rb')) res.headers['Content-Type'] = 'application/octet-stream' res.headers['filename'] = result['name'] res.headers['Content-Disposition'] = 'attachment; filename=' + result['name'] return res else: abort(404)
def CreateDrop(): result = BaseModel().CreateDropRequest(False) if type(result).__name__ == 'str': return ResultDeal(msg=result, code=-1) return ResultDeal(data=result)