Exemple #1
0
def deleteType():
    data = json.loads(request.get_data().decode('utf-8'))
    idList = data.get('idList')
    redisDB.deleteType(data.get('name'), data.get('value'))
    redisDB.setString('updateTime', data.get('updateTime'))
    for item in idList:
        redisDB.deleteData(item)
        redisDB.deleteType('idList', item)
    return '删除结束'
Exemple #2
0
def rewrite():
    redisDB.clearAll()
    data = json.loads(request.get_data().decode('utf-8'))
    updateTime = data.get('updatetime')
    members = data.get('members')
    types = data.get('types')
    incomes = data.get('incomes')
    loglist = data.get('loglist')
    redisDB.setString('updateTime', updateTime)
    redisDB.addType('members', *members)
    redisDB.addType('types', *types)
    redisDB.addType('incomes', *incomes)
    for item in loglist:
        redisDB.addType('idList', item['id'])
        redisDB.addNewLog(item['id'], item)
    return ''
Exemple #3
0
def editLog():
    data = json.loads(request.get_data().decode('utf-8'))
    redisDB.setString('updateTime', data.get('updateTime'))
    redisDB.addNewLog(data.get('id'), data.get('log'))
    return '编辑完成'
Exemple #4
0
def addNewLog():
    data = json.loads(request.get_data().decode('utf-8'))
    redisDB.setString('updateTime', data.get('id'))
    redisDB.addType('idList', data.get('id'))
    redisDB.addNewLog(data.get('id'), data.get('log'))
    return '新纪录添加成功'
Exemple #5
0
def deleteLog():
    data = json.loads(request.get_data().decode('utf-8'))
    redisDB.setString('updateTime', data.get('updateTime'))
    redisDB.deleteData(data.get('id'))
    redisDB.deleteType('idList', data.get('id'))
    return '删除成功'
Exemple #6
0
def addType():
    data = json.loads(request.get_data().decode('utf-8'))
    redisDB.setString('updateTime', data.get('updatetime'))
    redisDB.addType(data.get('name'), *data.get('data'))
    return data.get('name') + '添加成功'