update curl api
This commit is contained in:
@@ -14,7 +14,7 @@ import org.springframework.web.server.ResponseStatusException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
@RestController
|
||||
@RequestMapping("/coach")
|
||||
public class CoachResource {
|
||||
@Autowired
|
||||
@@ -29,8 +29,8 @@ public class CoachResource {
|
||||
}
|
||||
|
||||
@GetMapping("/all")
|
||||
@PreAuthorize("hasRole('Admin') or hasRole('Coach')")
|
||||
public List<CoachDTO> getAll() {
|
||||
System.out.println("GET /coach/all called");
|
||||
List<Coach> coaches = coachDAO.findAll();
|
||||
List<CoachDTO> dtos = new ArrayList<>();
|
||||
for (Coach coach : coaches) {
|
||||
|
||||
@@ -7,5 +7,7 @@ spring.jpa.hibernate.ddl-auto=update
|
||||
spring.jpa.show-sql=true
|
||||
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
|
||||
server.port=8081
|
||||
server.servlet.context-path=/api
|
||||
|
||||
spring.security.oauth2.resourceserver.jwt.issuer-uri=http://localhost:8080/realms/Frisbyee_realm
|
||||
spring.security.oauth2.resourceserver.jwt.jwk-set-uri: http://localhost:8080/realms/Frisbyee_realm/protocol/openid-connect/certs
|
||||
Reference in New Issue
Block a user