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)
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)
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)
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)
def put(): data, up = makeData() uuid = get_argument('id', type=int) ret = archive_model.edit(data, up, uuid) return respData(**ret)
def remove(): uuid = get_argument('id') ret = archive_model.remove(uuid) return respData(**ret)
def fetchDataBases(): ret = database_model.fetchData() return respData(**ret)
def backupRecovery(timestamp): ret = database_model.dbRecovery(timestamp) return respData(**ret)
def dbBackup(): table_list = get_argument('table_list') ret = database_model.dbBackup(table_list) return respData(**ret)
def fetchOptions(): ret = arctype_model.fetchOptions() return respData(**ret)
def refStatus(): status = get_argument('status') uuid = get_argument('id') ret = comment_model.editStatus(uuid, status) return respData(**ret)
def removeGuestBookComment(): uuid = get_argument('id') ret = comment_model.remove(uuid) return respData(**ret)
def removeArchiveComment(): uuid = get_argument('id') ret = comment_model.remove(uuid) return respData(**ret)
def fetchComment(uuid): ret = comment_model.fetchData(uuid) return respData(**ret)
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)
def removeModel(): pk = get_argument('id') ret = arctype_mod_model.remove(pk) return respData(**ret)
def remove(): uuid = get_argument('id', default=0) logger.debug(uuid) ret = arctype_model.remove(uuid) return respData(**ret)
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)
def fetchData(uuid): ret = arctype_model.fetchData(uuid) logger.debug(ret) return respData(**ret)
def post(): post_data, up = makeData() ret = arctype_model.create(post_data, up) return respData(**ret)
def fetchBackup(): ret = database_model.fetchBackup() return respData(**ret)
def put(): data, up = makeData() ret = arctype_model.edit(data, up) return respData(**ret)
def removeBackup(): timestamp = get_argument('id') ret = database_model.removeBackup(timestamp) return respData(**ret)
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)
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)
def fetchModel(mid): ret = arctype_mod_model.fetchData(mid) return respData(**ret)
def post(): post_data, up = makeData() ret = archive_model.create(data=post_data, up=up) return respData(**ret)
def putModel(mid): data = makeModelData() ret = arctype_mod_model.edit(data, mid) return respData(**ret)
def fetchData(uuid): ret = archive_model.fetchData(uuid) return respData(**ret)
def postModel(): data = makeModelData() ret = arctype_mod_model.create(data) return respData(**ret)