Skip to content

Commit e08c6ea

Browse files
committed
comment function view
1 parent 7eca743 commit e08c6ea

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

backend/python_talk/api/index.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@
1010
bp = Blueprint("index", __name__, url_prefix="/api", description="首页")
1111

1212

13+
# 首页:函数视图实现
14+
# @bp.route("/index", methods=["GET"])
15+
# @bp.response(200)
16+
# def index():
17+
# """首页
18+
#
19+
# """
20+
# ret = {
21+
# 'data': 'welcome to Python Talk'
22+
# }
23+
# return ret
24+
25+
26+
# 首页:类视图方式实现
1327
@bp.route("/index", methods=["GET"])
1428
class IndexView(MethodView):
1529
"""首页
@@ -33,15 +47,3 @@ def specs():
3347
3448
"""
3549
return render_template("swagger-ui.html")
36-
37-
# 方式 1
38-
# @bp.route("/index", methods=["GET"])
39-
# @bp.response(200)
40-
# def index():
41-
# """首页
42-
#
43-
# """
44-
# ret = {
45-
# 'data': 'welcome to Python Talk'
46-
# }
47-
# return ret

0 commit comments

Comments
 (0)