Skip to content

Commit a98a6d8

Browse files
committed
feat: create resource to goal
Signed-off-by: Otavio Santana <[email protected]>
1 parent 8dd8436 commit a98a6d8

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
11
package os.expert.sample;
22

3+
4+
import jakarta.ws.rs.GET;
5+
import jakarta.ws.rs.PUT;
6+
import jakarta.ws.rs.Path;
7+
import jakarta.ws.rs.QueryParam;
8+
9+
import java.util.List;
10+
import java.util.logging.Logger;
11+
12+
@Path("/goals")
313
public class GoalResource {
14+
15+
private static final Logger LOGGER = Logger.getLogger(GoalResource.class.getName());
16+
17+
@GET
18+
public List<Goal> goals(@QueryParam("page") int page,@QueryParam("size") int size) {
19+
LOGGER.info("Listing goals, page: " + page + ", size: " + size);
20+
return List.of(new Goal("Learn Quarkus", "Learn Quarkus", List.of(new Task("Create a new project", "Create a new project"))));
21+
}
22+
23+
@PUT
24+
public Goal create(Goal goal) {
25+
LOGGER.info("Creating a goal: " + goal);
26+
return goal;
27+
}
428
}

0 commit comments

Comments
 (0)