ExpDev07 / coronavirus-tracker-api

🦠 A simple and fast (< 200ms) API for tracking the global coronavirus (COVID-19, SARS-CoV-2) outbreak. It's written in python using the 🔥 FastAPI framework. Supports multiple sources!
https://coronavirus-tracker-api.herokuapp.com
GNU General Public License v3.0
1.59k stars 323 forks source link

refactor: apply aggregate pattern in app/location #379

Closed FrankX-xzh closed 3 years ago

FrankX-xzh commented 3 years ago

I apply the second aggregate pattern in app/location to guarantee the consistency of changes to objects in the project. In init.py, I add the class Locations to contain data format from different data-source. The Locations is the root of the aggregate. The outside objects can get different data format by the root.