File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ def info():
3535# @test_api.route('/ac', methods=['GET'])
3636# @route_meta(auth='用户查询自己信息', module='权限')
3737# @login_required
38- # # @Notify(template='{user.nickname}查看自己是否为激活状态 ,状态码为{response.status_code}', event='激活')
3938# @Logger(template='{user.nickname}查询了自己的名字,状态码为{response.status_code}')
4039# def get_active():
4140# return jsonify({
@@ -46,7 +45,6 @@ def info():
4645# @test_api.route('/ni', methods=['GET'])
4746# @route_meta(auth='用户查询自己信息', module='权限')
4847# @group_required
49- # # @Notify(template='{user.nickname}查询了自己的名字,状态码为{response.status_code}', event='名称', hello='world')
5048# @Logger(template='{user.nickname}查询了自己的名字,状态码为{response.status_code}')
5149# def get_name():
5250# return jsonify({
Original file line number Diff line number Diff line change 77from flask import jsonify
88from lin import route_meta , group_required , login_required
99from lin .exception import Success
10- from lin .notify import Notify
1110from lin .redprint import Redprint
1211
1312from app .models .book import Book
1615book_api = Redprint ('book' )
1716
1817
19- # 注意:如果Notify添加的视图函数,没有添加任何视图函数,那么不可识别用户身份
2018# 这与真实的情况是一致的,因为一般的情况下,重要的接口需要被保护,重要的消息才需要推送
2119@book_api .route ('/<bid>' , methods = ['GET' ])
2220@login_required
23- @Notify (template = '{user.nickname}查询了一本图书' , event = 'queryBook' )
2421def get_book (bid ):
2522 book = Book .get_detail (bid )
2623 return jsonify (book )
2724
2825
2926@book_api .route ('/' , methods = ['GET' ])
3027@login_required
31- @Notify (template = '{user.nickname}查询了所有图书' , event = 'queryBooks' )
3228def get_books ():
3329 books = Book .get_all ()
3430 return jsonify (books )
You can’t perform that action at this time.
0 commit comments