31 lines
691 B
Python
31 lines
691 B
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 Person, SexEnum, City
|
|
|
|
app = Flask(__name__)
|
|
config.init_config(app)
|
|
db.init_app(app)
|
|
db.app = app
|
|
with app.app_context():
|
|
db.create_all()
|
|
|
|
@app.route('/')
|
|
def hello_world(): # put application's code here
|
|
print(SexEnum(1).sex)
|
|
return 'Hello World!'
|
|
|
|
|
|
@app.route("/faker")
|
|
def faker_data():
|
|
# persons = faker.store_faker_identification(1)
|
|
# results = [person.__to_dict__() for person in persons]
|
|
# return response.succ(persons)
|
|
return response.succ(faker.faker_railways(30))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
app.run()
|