def to_json(fnc):
@wraps(fnc)
def inner(*args, **kwargs):
bottle_resp.headers['Content-Type'] = 'application/json'
from_func = fnc(*args, **kwargs)
if from_func is not None:
return json.dumps({'result': from_func})
return inner
评论列表
文章目录