Skip to content

Commit 90a41cd

Browse files
committed
update README
1 parent 31fcd74 commit 90a41cd

1 file changed

Lines changed: 25 additions & 10 deletions

File tree

README.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A RESTful API for managing tasks built with Spring Boot. Uses an H2 in-memory da
99
| Layer | Technology |
1010
|-------------|------------------------|
1111
| Language | Java 21 |
12-
| Framework | Spring Boot 4.1.0 |
12+
| Framework | Spring Boot 3.4.1 |
1313
| Persistence | Spring Data JPA |
1414
| Validation | Spring Boot Validation |
1515
| Build Tool | Maven |
@@ -36,7 +36,7 @@ java -jar target/task-manager-api-0.0.1-SNAPSHOT.jar
3636

3737
The following `curl` commands can be used to verify the controller works. Start the app first with `./mvnw spring-boot:run`.
3838

39-
> **Note:** The controller currently uses an in-memory `HashMap` as a temporary task store. Data does not persist between restarts and will be replaced with a proper repository layer.
39+
> **Note:** The task store HashMap is in-memory and does not persist between restarts.
4040
4141
---
4242

@@ -48,7 +48,7 @@ curl -s -X POST http://localhost:8080/tasks \
4848
-d '{"name":"Buy groceries","description":"Milk, eggs, bread"}'
4949
```
5050

51-
**Expected:** `201 Created` with the new task body including a generated `id` and `createdAt` timestamp.
51+
**Expected:** `200 OK` with the new task body including a generated `id` and `createdAt` timestamp.
5252

5353
```json
5454
{
@@ -61,25 +61,33 @@ curl -s -X POST http://localhost:8080/tasks \
6161

6262
---
6363

64-
### GET /tasks/{id} — Fetch a task by ID
64+
### GET /tasks — Fetch all tasks
65+
66+
```bash
67+
curl -s http://localhost:8080/tasks
68+
```
6569

66-
Replace `{id}` with the `id` returned from the POST above.
70+
**Expected:** `200 OK` with an array of all tasks.
71+
72+
---
73+
74+
### GET /tasks/{id} — Fetch a task by ID
6775

6876
```bash
6977
curl -s http://localhost:8080/tasks/{id}
7078
```
7179

72-
**Expected:** `200 OK` with the matching task body.
80+
**Expected:** `200 OK` with the matching task, or `404` if not found.
7381

7482
---
7583

76-
### GET /tasks/{id} — Unknown ID
84+
### DELETE /tasks/{id} — Delete a task
7785

7886
```bash
79-
curl -s -o /dev/null -w "HTTP Status: %{http_code}" http://localhost:8080/tasks/bad-id
87+
curl -s -o /dev/null -w "HTTP Status: %{http_code}" -X DELETE http://localhost:8080/tasks/{id}
8088
```
8189

82-
**Expected:** `HTTP Status: 404`
90+
**Expected:** `204 No Content`
8391

8492
---
8593

@@ -102,13 +110,20 @@ See [`.github/workflows/maven.yml`](.github/workflows/maven.yml).
102110
src/
103111
├── main/
104112
│ ├── java/com/taskmanagerapi/
113+
│ │ ├── controller/
114+
│ │ │ └── TaskController.java
105115
│ │ ├── model/
106116
│ │ │ ├── Task.java
107117
│ │ │ └── TaskStatus.java
118+
│ │ ├── repository/
119+
│ │ │ └── TaskRepository.java
120+
│ │ ├── service/
121+
│ │ │ └── TaskService.java
108122
│ │ └── TaskManagerApiApplication.java
109123
│ └── resources/
110124
│ └── application.properties
111125
└── test/
112126
└── java/com/taskmanagerapi/
113-
└── TaskManagerApiApplicationTests.java
127+
├── TaskManagerApiApplicationTests.java
128+
└── TaskServiceTests.java
114129
```

0 commit comments

Comments
 (0)