added swagger

This commit is contained in:
CHIEFSOFT\ameye
2024-12-14 05:33:10 -05:00
parent 2b2da1d104
commit e51f2a3a66
2 changed files with 34 additions and 2 deletions
+32 -1
View File
@@ -10,7 +10,7 @@ import project.validate.validate as validate
#import project.models.members as Members
from project.models.members import Members
from flask_cors import CORS
from flasgger import Swagger
#from models.models import User
@@ -32,6 +32,25 @@ app.config.from_object("project.config.Config")
db = SQLAlchemy(app)
app.config['SECRET_KEY'] ='thisisourwondefulkey'
template = {
"swagger": "2.0",
"info": {
"title": "MERMS Core API",
"description": "This API was developed using Python Flask, which provides an interface for producing and consuming messages with Apache Kafka topics via HTTP endpoints.",
"version": "1.0"
}
}
app.config['SWAGGER'] = {
'title': 'Flask Kafka API',
'uiversion': 2,
'template': './resources/flasgger/swagger_ui.html'
}
Swagger(app, template=template)
def token_required(f):
@wraps(f)
def decorated(*args, **kwargs):
@@ -247,3 +266,15 @@ def account_payments(current_user):
}
return jsonify(payments_data=payments_data)
##. Description Date Status "10-10-2021 10 AM"
@app.route("/panel/myproduct/dash")
@token_required
def myproduct(current_user):
dash_data = {
"username": "sanyaameye",
"account_name": "This is the test account name",
"firstname": "TestFirstname",
"lastname" : "Testlastname",
"email": "bestemail@email.com"
}
return jsonify(dash_data=dash_data)
+2 -1
View File
@@ -7,4 +7,5 @@ python-dotenv
pyjwt
pillow
flask-cors
pandas
pandas
flasgger