This project implements a Cargo Management API using Spring Boot. The API provides endpoints for managing cargo loads, including retrieving, adding, updating, and deleting cargo information.
Endpoint: GET /loads
Description: Retrieve a list of all cargo loads.
Endpoint: GET /load
Parameters:
shipperId
(String): Shipper ID for filtering cargo loads.
Description: Retrieve a list of cargo loads based on the provided Shipper ID.
Endpoint: GET /load/{loadId}
Parameters:
loadId
(String): Unique identifier for the cargo load.
Description: Retrieve detailed information about a cargo load using its unique Load ID.
Endpoint: POST /load
Request Body: Cargo object in JSON format.
Description: Add a new cargo load to the system.
Endpoint: DELETE /load/{loadId}
Parameters:
loadId
(String): Unique identifier for the cargo load.
Description: Delete a cargo load based on its unique Load ID.
Endpoint: PUT /load/{loadId}
Parameters:
loadId
(String): Unique identifier for the cargo load.- Request Body: Updated Cargo object in JSON format.
Description: Update an existing cargo load with new information.
To use this API, you can make HTTP requests to the specified endpoints using tools like curl
or through your preferred programming language.
curl -X GET http://localhost:8080/loads
To run the Cargo Management API locally on a Windows environment, follow these steps:
-
Java Development Kit (JDK):
- Ensure that you have Java Development Kit (JDK) installed on your machine. You can download it from Oracle's website.
-
Maven:
- Make sure you have Maven installed. You can download Maven from the official Apache Maven website.
- Clone the Repository:
git clone https://github.com/m-ayan-k/SpringBoot_api.git
- Navigate to the Project Directory:
cd SpringBoot_api
- Build the Project:
mvn clean install
- Run the Application:
java -jar target/cargo-management-api.jar
The API will be accessible at http://localhost:8080.