29 lines
621 B
Python
29 lines
621 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
|
|
|
|
app = Flask(__name__)
|
|
config.init_config(app)
|
|
db.init_app(app)
|
|
|
|
|
|
@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_train(3))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
app.run()
|