New api data
This commit is contained in:
+42
-3
@@ -1,6 +1,16 @@
|
||||
from flask import Flask
|
||||
# from flask import Flask
|
||||
from flask_swagger_ui import get_swaggerui_blueprint
|
||||
|
||||
import datetime
|
||||
import jwt
|
||||
import random
|
||||
import json
|
||||
import names
|
||||
from flask import (
|
||||
Flask,
|
||||
jsonify,
|
||||
send_from_directory,
|
||||
request,
|
||||
)
|
||||
app = Flask(__name__)
|
||||
|
||||
SWAGGER_URL = '/api/docs' # URL for exposing Swagger UI (without trailing '/')
|
||||
@@ -66,7 +76,36 @@ def salary_login():
|
||||
|
||||
@app.route('/salary/demousers')
|
||||
def salary_demousers():
|
||||
return "Hello World!"
|
||||
dList = []
|
||||
for i in range(10):
|
||||
print(names.get_full_name())
|
||||
|
||||
sample_range = random.randint(20, 60)
|
||||
for x in range(sample_range):
|
||||
calDate = datetime.datetime.utcnow() + datetime.timedelta(minutes=180 * random.randint(1, 20))
|
||||
new_l = {
|
||||
"uid":"425611f2-c692-4404-b93d-76ca7a5ce7"+str(x),
|
||||
"name": names.get_full_name() ,
|
||||
"added": calDate, "offers":random.randint(1, 4),
|
||||
"mobile": '801-000-'+str( random.randint(1000, 9999) ) ,
|
||||
"bvn": '8315000'+str( random.randint(1000, 9999) ),
|
||||
"email": 'jerry@example.com' ,
|
||||
"current_loans" : [],
|
||||
"salary_account": random.randint(0, 1)
|
||||
}
|
||||
dList.append(new_l)
|
||||
|
||||
demo_data = {
|
||||
"last_update": datetime.datetime.utcnow(),
|
||||
"offers": [
|
||||
{"cid": "1", "description": "Product Loan 01" },
|
||||
{"cid": "2", "description": "Product Loan 02" },
|
||||
{"cid": "3", "description": "Product Loan 03" },
|
||||
{"cid": "4", "description": "Product Loan 04" },
|
||||
],
|
||||
"list" : dList
|
||||
}
|
||||
return jsonify(demo_data=demo_data)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -13,4 +13,5 @@ sqlalchemy
|
||||
flask-socketio
|
||||
Flask-Mail
|
||||
pycountry
|
||||
flask-swagger-ui
|
||||
flask-swagger-ui
|
||||
names
|
||||
Reference in New Issue
Block a user