mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:35:50 +00:00
git commit -m "Updated schema and README file"
This commit is contained in:
parent
91b9831915
commit
7969fe6766
2 changed files with 23 additions and 0 deletions
15
README.md
15
README.md
|
@ -163,3 +163,18 @@ For additional details, please refer to the blog post [Hello DCO, Goodbye CLA: S
|
|||
## License
|
||||
|
||||
The Spring PetClinic sample application is released under version 2.0 of the [Apache License](https://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
||||
## Assignment Enhancements
|
||||
|
||||
- Added endpoints to GET and POST pet attributes (Temperament, Length, Weight).
|
||||
- Created REST API endpoints to **GET** and **POST** pet type data
|
||||
- Developed model, service, repository, and controller layers
|
||||
- Included SQL schema for new table
|
||||
|
||||
## Endpoints
|
||||
|
||||
- `POST /api/pettypes` — Create a new pet with attributes
|
||||
- `GET /api/pettypes` — Retrieve all pet types with their attributes
|
||||
|
||||
Access the endpoints via Postman or curl at:
|
||||
http://localhost:8080/api/pettypes
|
|
@ -62,3 +62,11 @@ CREATE TABLE visits (
|
|||
);
|
||||
ALTER TABLE visits ADD CONSTRAINT fk_visits_pets FOREIGN KEY (pet_id) REFERENCES pets (id);
|
||||
CREATE INDEX visits_pet_id ON visits (pet_id);
|
||||
|
||||
CREATE TABLE pet_types (
|
||||
id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(255) NOT NULL,
|
||||
temperament VARCHAR(255),
|
||||
length DOUBLE,
|
||||
weight DOUBLE
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue