feat: faker data: query
This commit is contained in:
38
app.py
38
app.py
@@ -3,8 +3,7 @@ import config
|
||||
import utils.response as response
|
||||
import service.faker_data as faker
|
||||
from base import db
|
||||
from model import Person, SexEnum, City, Hotel
|
||||
from sqlalchemy import select, join
|
||||
from model import SexEnum
|
||||
|
||||
app = Flask(__name__)
|
||||
config.init_config(app)
|
||||
@@ -12,9 +11,8 @@ db.init_app(app)
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def hello_world(): # put application's code here
|
||||
print(SexEnum(1).sex)
|
||||
return 'Hello World!'
|
||||
def hello_world():
|
||||
return f'<h1>nConTrack_Faker<h1>'
|
||||
|
||||
|
||||
@app.route("/faker/railway/<number>")
|
||||
@@ -32,12 +30,30 @@ def faker_contacts(num_hotel, num_railway):
|
||||
return response.succ(faker.faker_contacts(int(num_hotel), int(num_railway)))
|
||||
|
||||
|
||||
@app.route("/test")
|
||||
def test():
|
||||
print(
|
||||
select(Hotel.identification).
|
||||
join(Hotel, )
|
||||
)
|
||||
@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()
|
||||
|
||||
Reference in New Issue
Block a user