diff --git a/pom.xml b/pom.xml index a0b8b25..d92a3bc 100644 --- a/pom.xml +++ b/pom.xml @@ -17,6 +17,7 @@ 17 + org.springframework.boot spring-boot-starter-web @@ -48,6 +49,12 @@ spring-boot-starter-test test + + org.springframework.security + spring-security-test + test + + diff --git a/src/main/java/com/parking82/api/controller/UserController.java b/src/main/java/com/parking82/api/controller/UserController.java index ae692fc..2d473b6 100644 --- a/src/main/java/com/parking82/api/controller/UserController.java +++ b/src/main/java/com/parking82/api/controller/UserController.java @@ -4,17 +4,13 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import com.parking82.api.model.User; import com.parking82.api.services.UserServices; @RestController -@RequestMapping("/cadastro/usuario") +@RequestMapping("/usuario") public class UserController { private UserServices userServices; @@ -28,7 +24,7 @@ public ResponseEntity> list() { return ResponseEntity.ok().body(userServices.list()); } - @PostMapping + @PostMapping("/cadastro") public ResponseEntity save(@RequestBody User user) { return ResponseEntity.status(HttpStatus.CREATED).body(userServices.save(user)); } diff --git a/src/main/java/com/parking82/api/respository/UserRespositorie.java b/src/main/java/com/parking82/api/respository/UserRespositorie.java index 5619ff6..a1e68a6 100644 --- a/src/main/java/com/parking82/api/respository/UserRespositorie.java +++ b/src/main/java/com/parking82/api/respository/UserRespositorie.java @@ -5,5 +5,4 @@ import com.parking82.api.model.User; public interface UserRespositorie extends JpaRepository { - } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index a8d5cd6..80c68a7 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,6 +1,6 @@ spring.jpa.hibernate.ddl-auto= update spring.datasource.url= jdbc:mysql://localhost:3306/parking82?createDatabaseIfNotExist=true&serverTimeZone=UTC spring.datasource.username= root -spring.datasource.password= 04758684 +spring.datasource.password= wel3nsuh spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver spring.mvc.hiddenmethod.filter.enabled=true \ No newline at end of file