def respond_json(method):
@wraps(method)
def call(self, *args, **kwargs):
data = method(self, *args, **kwargs)
if data:
self.set_header('Content-Type', 'application/json')
self.write(json_encode(data))
return call
评论列表
文章目录