Exemple #1
0
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)
Exemple #2
0
def GetAllUserLoginCount():
    result = BaseModel().GetAllUserLoginCount()

    if type(result).__name__ == 'str':
        return ResultDeal(msg=result, code=-1)

    return ResultDeal(data=result)
Exemple #3
0
def ImportSql():
    result = BaseModel().ImportSql(request.files.get('document'))

    if type(result).__name__ == 'str':
        return ResultDeal(msg=result, code=-1)

    return ResultDeal(data=result)
Exemple #4
0
def GetReadmeContent():
    result = BaseModel().GetReadmeContent()

    if type(result).__name__ == 'str':
        return ResultDeal(msg=result, code=-1)

    return ResultDeal(data=result)
Exemple #5
0
def GetLoginInfo():
    result = BaseModel().GetLoginInfo(session.get('username'))

    if type(result).__name__ == 'str':
        return ResultDeal(msg=result, code=-1)

    return ResultDeal(data=result)
Exemple #6
0
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)
Exemple #7
0
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)
Exemple #8
0
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)
Exemple #9
0
def CreateDrop():
    result = BaseModel().CreateDropRequest(False)
    if type(result).__name__ == 'str':
        return ResultDeal(msg=result, code=-1)

    return ResultDeal(data=result)