Skip to content
Snippets Groups Projects
Commit a248057f authored by joeappleton18's avatar joeappleton18
Browse files

4-5 solution added

parent a8b87283
No related branches found
No related tags found
No related merge requests found
package com.yatl.controller;
import java.sql.SQLException;
import java.util.List;
import com.yatl.dao.TodoDao;
import com.yatl.model.Todo;
import io.javalin.http.Context;
public class TodoController {
TodoDao todoDao;
public TodoController(TodoDao todoDao) {
this.todoDao = todoDao;
}
public void getAllTodos(Context ctx) {
try {
List<Todo> todos = todoDao.getAll();
ctx.json(todos);
} catch (SQLException e) {
ctx.status(500);
ctx.result("Internal server error");
}
}
}
package com.yatl.controller;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment