60 lines
1.5 KiB
Python
60 lines
1.5 KiB
Python
from flask import Flask
|
|
import config
|
|
import utils.response as response
|
|
import service.faker_data as faker
|
|
from base import db
|
|
from model import SexEnum
|
|
|
|
app = Flask(__name__)
|
|
config.init_config(app)
|
|
db.init_app(app)
|
|
|
|
|
|
@app.route('/')
|
|
def hello_world():
|
|
return f'<h1>nConTrack_Faker<h1>'
|
|
|
|
|
|
@app.route("/faker/railway/<number>")
|
|
def faker_railway(number):
|
|
return response.succ(faker.faker_railways(int(number)))
|
|
|
|
|
|
@app.route("/faker/hotel/<number>")
|
|
def faker_hotel(number):
|
|
return response.succ(faker.faker_hotels(int(number)))
|
|
|
|
|
|
@app.route("/faker/contacts/<num_hotel>/<num_railway>")
|
|
def faker_contacts(num_hotel, num_railway):
|
|
return response.succ(faker.faker_contacts(int(num_hotel), int(num_railway)))
|
|
|
|
|
|
@app.route("/query/patient")
|
|
def query_patient():
|
|
return response.succ(faker.query_patients())
|
|
|
|
|
|
@app.route("/query/contacts/hotel/<identification>")
|
|
def query_contacts_hotel(identification):
|
|
return response.succ(faker.query_contacts_hotel(identification))
|
|
|
|
|
|
@app.route("/query/contacts/railway/<identification>")
|
|
def query_contacts_railway(identification):
|
|
return response.succ(faker.query_contacts_railway(identification))
|
|
|
|
|
|
@app.route("/query/contacts/classify/<identification>")
|
|
def query_contacts_classify(identification):
|
|
return response.succ(faker.query_contacts_classify(identification))
|
|
|
|
|
|
@app.route("/query/contacts/<identification>")
|
|
def query_contacts(identification):
|
|
return response.succ(faker.query_contacts(identification))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
app.run()
|