This is a service designed in Spring Boot/Data to provide REST APIs for storing/retrieving runner's information in MySQL database.
git https://github.com/xiayank/RunningInformationAnalysis.git
Go to project folder, start up Mysql docker.
mysql --host=127.0.0.1 --port=3306 --user=root --password=root
Look up existed database.
show database;
If there is no database called running_information_analysis_db
, then create one.
create database running_information_analysis_db;
Quit the mysql.
quit;
Build maven application.
mvn clean install
Run the fat jar.
java -jar target/RunningInformationAnalysisService-1.0.0.0-SNAPSHOT.jar
Use Postman
to make a POST request with URL:
http://localhost:9000/create
Request Body is in the file dummaydata.txt
.
If the response is 200 OK
, meaning that this API works.
Use Postman
to make a GET request with URL:
http://localhost:9000/findAllByOrder
It should return all 7 JSON data with required format. And default page = 0, size = 2.
__
Use Postman
to make a GET request with URL:
http://localhost:9000/heartRateGreatThan/{a exist heart rate}
Use Postman
to make a GET request with URL:
http://localhost:9000/heartRate/{a exist heart rate}
Use Postman
to make a DELETE request with URL:
http://localhost:9000/purge
If the response is 200 OK
, meanning that all the info have been deleted.