digifi login
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
FLASK_APP=project/__init__.py
|
||||
FLASK_DEBUG=1
|
||||
SOCKET_URL=https://dev-socket.mermsemr.com
|
||||
PANEL_URL=https://dev-panel.mermsemr.com
|
||||
DATABASE_URL=postgresql://merms_panel:merms_panel@10.20.30.60:5432/merms_panel
|
||||
SQL_HOST=10.20.30.60
|
||||
SQL_PORT=5432
|
||||
DATABASE=postgres
|
||||
APP_FOLDER=/usr/src/app
|
||||
INITIAL_PRODUCT_URL=devprov.mermsemr.com
|
||||
MAIL_SERVER=smtp.gmail.com
|
||||
MAIL_PORT= 465
|
||||
MAIL_USERNAME=message@chiefsoft.com
|
||||
MAIL_PASSWORD=may12002!
|
||||
JWT_SECRET=dce6bd64f7d71
|
||||
+41
-2
@@ -8,10 +8,10 @@ API_URL = 'http://petstore.swagger.io/v2/swagger.json' # Our API url (can of co
|
||||
|
||||
# Call factory function to create our blueprint
|
||||
swaggerui_blueprint = get_swaggerui_blueprint(
|
||||
SWAGGER_URL, # Swagger UI static files will be mapped to '{SWAGGER_URL}/dist/'
|
||||
SWAGGER_URL, # Swagger UI static files will be mapped to '{SWAGGER_URL}/dist/'m
|
||||
API_URL,
|
||||
config={ # Swagger UI config overrides
|
||||
'app_name': "Test application"
|
||||
'app_name': "digiFi-Core"
|
||||
},
|
||||
# oauth_config={ # OAuth config. See https://github.com/swagger-api/swagger-ui#oauth2-configuration .
|
||||
# 'clientId': "your-client-id",
|
||||
@@ -30,5 +30,44 @@ app.register_blueprint(swaggerui_blueprint)
|
||||
def hello():
|
||||
return "Hello World!"
|
||||
|
||||
@app.route('/salary/login', methods=["POST"])
|
||||
def salary_login():
|
||||
try:
|
||||
data = request.json
|
||||
if not data:
|
||||
return {
|
||||
"message": "Please provide user details",
|
||||
"data": None,
|
||||
"error": "Bad request"
|
||||
}, 400
|
||||
# validate input
|
||||
username = data["username"]
|
||||
password = data["password"]
|
||||
if username == 'digifiuser' and password == 'digifipass' :
|
||||
return {
|
||||
"message": "Successfully Login",
|
||||
"data": [
|
||||
{"uid":"425611f2-c692-4404-b93d-76ca7a5ce70","icon": "icon_user", "name": "Simulator User" , "status": '1', "id": 1}
|
||||
] }, 201
|
||||
else:
|
||||
return {
|
||||
"message": "Error fetching auth token!, invalid email or password",
|
||||
"data": None,
|
||||
"error": "Unauthorized"
|
||||
}, 404
|
||||
|
||||
except Exception as e:
|
||||
return {
|
||||
"message": "Something went wrong!",
|
||||
"error": str(e),
|
||||
"data": None
|
||||
}, 500
|
||||
|
||||
|
||||
@app.route('/salary/demousers')
|
||||
def salary_demousers():
|
||||
return "Hello World!"
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host='0.0.0.0', port=8000)
|
||||
Reference in New Issue
Block a user