As I noticed that the API has two versions, and those two versions have different methods, Some users might be interested in some methods in v1 and some other methods in v2. Thus, I applied an adapter pattern to make the API project more flexible and reusable. In this way, the users can modify Adapter.py to create their version of API, and it helps the users add new functions quickly.
Proposed Changes
Adding a new class Adapter to apply an adapter pattern and Adapter will help the users to assign different methods in the integrator files to the router files.
Changing data structure in the router files. Before, the constructors in router files called the methods in the integrator files to get the data. After the changes, the adapter class calls the integrator files' methods first and then assigns the data to the constructors in the router files.
Addtional Info
It seems the test files are modified as well after I made the changes to the router files. I am not a python programming pro, so I do not know how to fix those test files, but I think this pull request can show you my general idea about applying an adapter pattern to the project.
Related Issue:
As I noticed that the API has two versions, and those two versions have different methods, Some users might be interested in some methods in v1 and some other methods in v2. Thus, I applied an adapter pattern to make the API project more flexible and reusable. In this way, the users can modify Adapter.py to create their version of API, and it helps the users add new functions quickly.
Proposed Changes
Adding a new class Adapter to apply an adapter pattern and Adapter will help the users to assign different methods in the integrator files to the router files.
Changing data structure in the router files. Before, the constructors in router files called the methods in the integrator files to get the data. After the changes, the adapter class calls the integrator files' methods first and then assigns the data to the constructors in the router files.
Addtional Info
It seems the test files are modified as well after I made the changes to the router files. I am not a python programming pro, so I do not know how to fix those test files, but I think this pull request can show you my general idea about applying an adapter pattern to the project.
Checklist