Commit 4195bcbb authored by 崔为之's avatar 崔为之 💪🏽

Update project

parent 29acd336
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# @Author : StudentCWZ # @Author : StudentCWZ
# @Email : StudentCWZ@outlook.com # @Email : StudentCWZ@outlook.com
# @Date : 2023/11/4 15:08 # @Date : 2023/11/4 15:08
# @File : __init__.py.py # @File : __init__.py
# @Description : # @Description :
""" """
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# @Email : StudentCWZ@outlook.com # @Email : StudentCWZ@outlook.com
# @Date : 2023/11/21 10:01 # @Date : 2023/11/21 10:01
# @File : init_consul.py # @File : init_consul.py
# @Description : # @Description : Initializes the FlaskConsulService for a Flask application.
""" """
# Import built-in modules # Import built-in modules
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# @Email : StudentCWZ@outlook.com # @Email : StudentCWZ@outlook.com
# @Date : 2023/11/4 15:43 # @Date : 2023/11/4 15:43
# @File : init_cors.py # @File : init_cors.py
# @Description : # @Description : Initializes the Flask CORS extension for a Flask application.
""" """
from flask import Flask from flask import Flask
...@@ -16,9 +16,15 @@ from flask_cors import CORS ...@@ -16,9 +16,15 @@ from flask_cors import CORS
def init_cors(app: Flask) -> None: def init_cors(app: Flask) -> None:
""" """
Initialize the dynaconf extension Initializes the Flask CORS extension for a Flask application.
:param app: flask.Flask application instance The CORS extension allows for cross-origin resource sharing, enabling
:return: None requests from different domains to the Flask application.
Args:
app (Flask): The Flask application.
Returns:
None
""" """
CORS(app) CORS(app)
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# @Email : StudentCWZ@outlook.com # @Email : StudentCWZ@outlook.com
# @Date : 2023/11/21 10:51 # @Date : 2023/11/21 10:51
# @File : init_dotenv.py # @File : init_dotenv.py
# @Description : # @Description : Initializes the dotenv extension for the application.
""" """
# Import standard library modules # Import standard library modules
......
...@@ -7,12 +7,11 @@ ...@@ -7,12 +7,11 @@
# @Email : StudentCWZ@outlook.com # @Email : StudentCWZ@outlook.com
# @Date : 2023/10/28 18:16 # @Date : 2023/10/28 18:16
# @File : init_elasticsearch.py # @File : init_elasticsearch.py
# @Description : # @Description : Initializes the FlaskElasticsearch extension for a Flask application.
""" """
from flask import Flask from flask import Flask
from application.libs import FlaskElasticsearch from application.libs import FlaskElasticsearch
es = FlaskElasticsearch() es = FlaskElasticsearch()
...@@ -20,9 +19,17 @@ es = FlaskElasticsearch() ...@@ -20,9 +19,17 @@ es = FlaskElasticsearch()
def init_elasticsearch(app: Flask) -> None: def init_elasticsearch(app: Flask) -> None:
""" """
Initialize the flask_elasticsearch extension Initializes the FlaskElasticsearch extension for a Flask application.
Elasticsearch is a distributed, RESTful search and analytics engine capable of
addressing a growing number of use cases. As the heart of the Elastic Stack,
it centrally stores your data for lightning fast search, fine‑tuned relevancy,
and powerful analytics that scale with ease.
Args:
app (Flask): The Flask application.
:param app: flask.Flask application instance Returns:
:return: None None
""" """
es.init_app(app) es.init_app(app)
...@@ -7,19 +7,25 @@ ...@@ -7,19 +7,25 @@
# @Email : StudentCWZ@outlook.com # @Email : StudentCWZ@outlook.com
# @Date : 2023/10/28 18:16 # @Date : 2023/10/28 18:16
# @File : init_logger.py # @File : init_logger.py
# @Description : # @Description : Initializes the FlaskLoguru service for a Flask application.
""" """
from flask import Flask from flask import Flask
from application.libs import FlaskLoguru from application.libs import FlaskLoguru
def init_logger(app: Flask) -> None: def init_logger(app: Flask) -> None:
""" """
Initialize the dynaconf extension Initializes the FlaskLoguru service for a Flask application.
Loguru is a library which aims to bring enjoyable logging in Python.
It provides a nice and clean interface over logging's complex API
to ease the process of logging.
Args:
app (Flask): The Flask application.
:param app: flask.Flask application instance Returns:
:return: None None
""" """
FlaskLoguru(app) FlaskLoguru(app)
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# @Email : StudentCWZ@outlook.com # @Email : StudentCWZ@outlook.com
# @Date : 2023/10/28 22:01 # @Date : 2023/10/28 22:01
# @File : init_sqlalchemy.py # @File : init_sqlalchemy.py
# @Description : # @Description : Initializes the SQLAlchemy extension for a Flask application.
""" """
from flask import Flask from flask import Flask
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# @Author : StudentCWZ # @Author : StudentCWZ
# @Email : StudentCWZ@outlook.com # @Email : StudentCWZ@outlook.com
# @Date : 2023/10/28 15:06 # @Date : 2023/10/28 15:06
# @File : __init__.py.py # @File : __init__.py
# @Description : # @Description :
""" """
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# @Author : StudentCWZ # @Author : StudentCWZ
# @Email : StudentCWZ@outlook.com # @Email : StudentCWZ@outlook.com
# @Date : 2023/11/11 15:15 # @Date : 2023/11/11 15:15
# @File : __init__.py.py # @File : __init__.py
# @Description : # @Description :
""" """
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# @Author : StudentCWZ # @Author : StudentCWZ
# @Email : StudentCWZ@outlook.com # @Email : StudentCWZ@outlook.com
# @Date : 2023/11/21 09:10 # @Date : 2023/11/21 09:10
# @File : __init__.py.py # @File : __init__.py
# @Description : # @Description :
""" """
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# @Author : StudentCWZ # @Author : StudentCWZ
# @Email : StudentCWZ@outlook.com # @Email : StudentCWZ@outlook.com
# @Date : 2023/10/28 22:12 # @Date : 2023/10/28 22:12
# @File : __init__.py.py # @File : __init__.py
# @Description : # @Description :
""" """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment