package ciai.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import com.fasterxml.jackson.annotation.JsonView; import ciai.model.Degree; import ciai.service.AppService; import ciai.view.Views; @Controller @RequestMapping(value = "/degree") public class DegreeController { @Autowired AppService service; /** * Lista de cursos e as respetivas cadeiras */ @RequestMapping(value = "/view/all", method = RequestMethod.GET) @JsonView(Views.GuestView.class) public @ResponseBody Iterable getAll() throws Exception { return service.getDegrees(); } }