Exemple #1
0
def fetchHot():
    archive_ret = archive_model.fetchHotList()
    arctype_ret = arctype_model.fetchHotList()
    data = dict(
        hot_archive = archive_ret,
        hot_arctype = arctype_ret
    )
    return respData(data=data)
Exemple #2
0
def postComment():
    data = dict(
        pid = get_argument('reply_id'),
        type = get_argument('reply_type'),
        username = get_argument('username', required=True),
        email = get_argument('email', required=True),
        content = get_argument('content', required=True)
    )
    ret = comment_model.create(data)
    return respData(**ret)
Exemple #3
0
def postComment():
    postData = dict(pid=get_argument('reply_id'),
                    type=get_argument('reply_type'),
                    username=get_argument('reply_username'),
                    content=get_argument('reply_content'))

    putData = dict(id=get_argument('id'),
                   status=get_argument('status'),
                   content=get_argument('content'))
    ret = comment_model.create(postData, putData, isAdmin=True)
    return respData(**ret)
Exemple #4
0
def putUser(uuid):
    user_data = dict(nickname=get_argument('nickname'),
                     email=get_argument('email'),
                     mobile=get_argument('mobile'),
                     status=get_argument('status'))
    up = None

    avatar = request.files.get('avatar') or get_argument('avatar')
    if not isinstance(avatar, str):
        up = upload(avatar)
    if up: avatar = up.file_name
    user_info_data = dict(avatar=avatar,
                          sex=get_argument('sex'),
                          qq=get_argument('qq'),
                          birthday=get_argument('birthday'),
                          info=get_argument('info'))

    ret = user_model.edit(user_data, user_info_data, uuid, up)
    return respData(**ret)
Exemple #5
0
def put():
    data, up = makeData()
    uuid = get_argument('id', type=int)
    ret = archive_model.edit(data, up, uuid)
    return respData(**ret)
Exemple #6
0
def remove():
    uuid = get_argument('id')
    ret = archive_model.remove(uuid)
    return respData(**ret)
Exemple #7
0
def fetchDataBases():
    ret = database_model.fetchData()
    return respData(**ret)
Exemple #8
0
def backupRecovery(timestamp):
    ret = database_model.dbRecovery(timestamp)
    return respData(**ret)
Exemple #9
0
def dbBackup():
    table_list = get_argument('table_list')
    ret = database_model.dbBackup(table_list)
    return respData(**ret)
Exemple #10
0
def fetchOptions():
    ret = arctype_model.fetchOptions()
    return respData(**ret)
Exemple #11
0
def refStatus():
    status = get_argument('status')
    uuid = get_argument('id')
    ret = comment_model.editStatus(uuid, status)
    return respData(**ret)
Exemple #12
0
def removeGuestBookComment():
    uuid = get_argument('id')
    ret = comment_model.remove(uuid)
    return respData(**ret)
Exemple #13
0
def removeArchiveComment():
    uuid = get_argument('id')
    ret = comment_model.remove(uuid)
    return respData(**ret)
Exemple #14
0
def fetchComment(uuid):
    ret = comment_model.fetchData(uuid)
    return respData(**ret)
Exemple #15
0
def fetchLoginLog():
    start = request.args.get('start', type=int)
    length = request.args.get('length', type=int)
    ret = login_log_model.fetchList(start, length)
    return respData(**ret)
Exemple #16
0
def removeModel():
    pk = get_argument('id')
    ret = arctype_mod_model.remove(pk)
    return respData(**ret)
Exemple #17
0
def remove():
    uuid = get_argument('id', default=0)
    logger.debug(uuid)
    ret = arctype_model.remove(uuid)
    return respData(**ret)
Exemple #18
0
def fetchList():
    start = request.args.get('start', type=int)
    length = request.args.get('length', type=int)
    ret = comment_model.fetchList(start, length, guestbook=False)
    return respData(**ret)
Exemple #19
0
def fetchData(uuid):
    ret = arctype_model.fetchData(uuid)
    logger.debug(ret)
    return respData(**ret)
Exemple #20
0
def post():
    post_data, up = makeData()

    ret = arctype_model.create(post_data, up)
    return respData(**ret)
Exemple #21
0
def fetchBackup():
    ret = database_model.fetchBackup()
    return respData(**ret)
Exemple #22
0
def put():
    data, up = makeData()
    ret = arctype_model.edit(data, up)
    return respData(**ret)
Exemple #23
0
def removeBackup():
    timestamp = get_argument('id')
    ret = database_model.removeBackup(timestamp)
    return respData(**ret)
Exemple #24
0
def fetchModelList():
    start = request.args.get('start', type=int)
    length = request.args.get('length', type=int)

    ret = arctype_mod_model.fetchList(start, length)
    return respData(**ret)
Exemple #25
0
def index():
    start = request.args.get('start', type=int)
    length = request.args.get('length', type=int)
    ret = archive_model.fetchList(start, length)
    return respData(**ret)
Exemple #26
0
def fetchModel(mid):
    ret = arctype_mod_model.fetchData(mid)
    return respData(**ret)
Exemple #27
0
def post():
    post_data, up = makeData()
    ret = archive_model.create(data=post_data, up=up)
    return respData(**ret)
Exemple #28
0
def putModel(mid):
    data = makeModelData()
    ret = arctype_mod_model.edit(data, mid)
    return respData(**ret)
Exemple #29
0
def fetchData(uuid):
    ret = archive_model.fetchData(uuid)
    return respData(**ret)
Exemple #30
0
def postModel():
    data = makeModelData()
    ret = arctype_mod_model.create(data)
    return respData(**ret)