Skip to content

Commit a0452fc

Browse files
colorful3pedro
authored andcommitted
Refactor/remove notify (#51)
* chore: upgrade-deps-version (#48) * chore: 升级依赖包版本号 * fix: 修改requirements.txt的依赖版本 * chore: 升级核心库版本号 * 修改readme文件 * chore: upgrade requirements.txt * chore: 更新为bate版本 * refactor: 删除notify相关
1 parent 2eb05c0 commit a0452fc

2 files changed

Lines changed: 0 additions & 6 deletions

File tree

app/api/cms/test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff 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({

app/api/v1/book.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from flask import jsonify
88
from lin import route_meta, group_required, login_required
99
from lin.exception import Success
10-
from lin.notify import Notify
1110
from lin.redprint import Redprint
1211

1312
from app.models.book import Book
@@ -16,19 +15,16 @@
1615
book_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')
2421
def 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')
3228
def get_books():
3329
books = Book.get_all()
3430
return jsonify(books)

0 commit comments

Comments
 (0)