feat: faker data: railway

This commit is contained in:
Zhaolong
2022-01-27 18:00:03 +08:00
parent 1e3d584870
commit c374acc1db
9 changed files with 178 additions and 20 deletions

10
app.py
View File

@@ -3,11 +3,13 @@ import config
import utils.response as response
import service.faker_data as faker
from base import db
from model import Person, SexEnum
from model import Person, SexEnum, City
app = Flask(__name__)
config.init_config(app)
db.init_app(app)
# with app.app_context():
# print(db.session.query(City).one())
@app.route('/')
@@ -18,10 +20,10 @@ def hello_world(): # put application's code here
@app.route("/faker")
def faker_data():
persons = faker.store_faker_identification(1)
results = [person.__to_dict__() for person in persons]
# 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))
return response.succ(faker.faker_railways(30))
if __name__ == '__main__':