We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7eca743 commit e08c6eaCopy full SHA for e08c6ea
1 file changed
backend/python_talk/api/index.py
@@ -10,6 +10,20 @@
10
bp = Blueprint("index", __name__, url_prefix="/api", description="首页")
11
12
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
+# 首页:类视图方式实现
27
@bp.route("/index", methods=["GET"])
28
class IndexView(MethodView):
29
"""首页
@@ -33,15 +47,3 @@ def specs():
33
47
34
48
"""
35
49
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
-# }
-# return ret
0 commit comments