Repository navigation
Version 0.2a
This follows incorrect Semantic Versioning, but for sake of no confusion, using the versioning as before.
I didn't have a backup copy of v0.1a and v0.2, so changes made in those are also included, documented below too, along with v0.2a changes. There is no v0.1b, went straight to v0.2.
Changelog v0.1a
[Edit] Group repo is ready for you to sync your forked repos and do a git pull, so that you have the latest main branch
commented out the Jackson dependencies as they are duplicates. Spring-boot-starter and spring-boot-starter-web dependency alr include these Jackson modules
Added ApiKey.java in the .gitignore so that we do not have to always remove API key in our local repo each time we just want to git push to our own forked repo. Git will just not track any future edits to ApiKey.java
===== Files added or edited =====
.gitignore (edited)
pom.xml (edited)
Changelog v0.2
Group repo is ready for you to sync your forked repos and do a git pull, so that you have the latest main branch
===== Files added or edited =====
README.md [edited]
DataLoader.java -> DataLoader.java.xxx (Become a text file now)
AppBusRouteController.java [edited]
AppBusServiceController.java [edited]
AppBusStopController.java [edited]
BusRouteRepository.java [edited, added a custom JPA Query to find route by service and direction, and it is case insensitive]
BusRouteApiService.java [edited]
BusServiceApiService.java [edited]
BusStopApiService.java [edited]
application.properties [edited, updated jpa.hibernate.dll.auto from =create to =update ]
AppBusArrivalControllerTest.java [NEW]
AppBusRouteControllerTest.java [NEW]
AppBusServiceControllerTest.java [NEW]
AppBusStopControllerTest.java [NEW]
=============================
Notes from Chooi Chin:
Change the application.properties to persist the database. Use jpa.hibernate.dll.auto=update. IMPORTANT: Must update the application.properties to make the database persist.
I remove the DataLoader by renaming its extention to .xxx. The data is too large to be loaded at once. Instead use the GET /datamall to load the table one by one.
The front-end point findAll is too large. So I replaced it with findFirstOne. This can be used as a test to make sure the endpoint is working.
Add in the following GET:
GET bus service by serviceNo.
GET bus stops by busStopCode.
Get bus route by serviceNo and direction.
Changelog v0.2a
Group repo is ready for you to sync your forked repos and do a git pull, so that you have the latest main branch
Vincent, do the pull request first for your UserAccess.java files, do that first before syncing your forked repo, to be safe.
===== Files added or edited =====
ApiTestController.java [NEW, used to test if I can return my Springboot environment variable app.api.key where I store my API key. Test is successful, can return my API key via the test endpoint]
this requires modifying the .vscode/launch.json by adding an env {} as below
also need to add a custom property in application.properties that has to be same name as environment variable, app.api.key
launch.json - have to add this in yourself, as it is an environment variable, and .vscode folder is not tracked by git
{
"configurations": [
{
"type": "java",
"name": "Spring Boot-BusApiApplication<bus-api>",
"request": "launch",
"cwd": "${workspaceFolder}",
"mainClass": "sg.edu.ntu.bus_api.BusApiApplication",
"projectName": "bus-api",
"args": "",
"envFile": "${workspaceFolder}/.env",
"env": {
"MY_API_KEY": "hHL3Rf0zTm6ibnuQLU228w=="
}
}
]
}
BusRouteNotFoundException.java [NEW]
BusServiceNotFoundException.java [NEW]
BusStopNotFoundException.java [NEW]
ErrorResponse.java [NEW]
GlobalExceptionHandler.java [NEW]
resources/static folder [NEW]
index.html [NEW]
resourecs/META-INF folder [NEW]
additional-spring-configuration-metadata.json [NEW, this is for creating custom property in application.properties]
=============================
I've reverted any temp changes from Chooi Chin files as requested (they were the service method findAll() and the controller endpoint for "get all Bus Stops" etc.). It is now reverted to what the files were in v0.2
Impt Note:
This version is still using API Key directly into ApiKey.java, meaning still need to remove your API key before you git add -A or git push.
Status of Springboot Env variable testing:
My attempt to add Springboot Environment variable doesn't seem to work when do the "Get Bus Arrival for one bus stop at a bus stop" endpoint (eg. http://localhost:8080/app/arrival?BusStopCode=75009&ServiceNo=10), which calls directly from LTA API. The others like get Bus Stop, get Bus Service work, which Chooi Chin said those call from database and not the LTA API.
Additional notes:
Added META-INF folder to create custom application.properties property app.api.key in attempt to add Springboot Environment variable to hide API Key. Right now the custom property app.api.key is sitting in application.properties but not used via the @value annotation in ApiKey.java, still using API key directly in ApiKey.java to run.