Skip to content
Snippets Groups Projects
Commit 078f276a authored by Simon Prevost's avatar Simon Prevost
Browse files

tp non fini

parent c42d2483
No related branches found
No related tags found
No related merge requests found
Pipeline #8285 failed
......@@ -24,5 +24,8 @@ public interface TacheDAO {
@SqlQuery("select * from taches")
@RegisterBeanMapper(Tache.class)
List<Tache> getAll();
@SqlQuery("select * from taches where id = :id")
Tache getById(@BindBean String id);
}
......@@ -16,6 +16,7 @@ import jakarta.ws.rs.PUT;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Context;
import jakarta.ws.rs.core.EntityTag;
......@@ -64,4 +65,10 @@ public class TodoRessource {
}
return builder.build();
}
@GET
@Path("/taches/{id}")
public Tache getById(@PathParam("id") String id) {
return todoService.getTache(UUID.fromString(id));
}
}
......@@ -15,7 +15,7 @@ public class TodoService {
}
public Tache getTache(UUID id) {
return null;
return taches.getById(id.toString());
}
public List<Tache> getAll() {
......
......@@ -21,6 +21,8 @@ import fr.ulille.iut.todo.DebugMapper;
import fr.ulille.iut.todo.dao.TacheDAO;
import fr.ulille.iut.todo.dto.CreationTacheDTO;
import fr.ulille.iut.todo.service.Tache;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.client.Entity;
import jakarta.ws.rs.core.Application;
import jakarta.ws.rs.core.Form;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment