File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed
java/com/java_api/java_api/controller Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "java.compile.nullAnalysis.mode" : " automatic"
3+ }
Original file line number Diff line number Diff line change 77import org .springframework .http .ResponseEntity ;
88import org .springframework .web .bind .annotation .*;
99
10+
11+
1012import java .util .List ;
1113import java .util .Optional ;
1214
@@ -18,6 +20,7 @@ public class TaskController {
1820 private TaskRepository taskRepository ;
1921
2022 // Criar uma nova task
23+ @ SuppressWarnings ("null" )
2124 @ PostMapping
2225 public ResponseEntity <Task > createTask (@ RequestBody Task task ) {
2326 try {
@@ -29,6 +32,7 @@ public ResponseEntity<Task> createTask(@RequestBody Task task) {
2932 }
3033
3134 // Obter todas as tasks
35+ @ SuppressWarnings ("null" )
3236 @ GetMapping
3337 public ResponseEntity <List <Task >> getAllTasks () {
3438 try {
Original file line number Diff line number Diff line change 1- # application.properties
2- spring.application.name = ${SPRING_APPLICATION_NAME:java-api} # Valor padrão se não definido
3- spring.data.mongodb.uri =${SPRING_DATA_MONGODB_URI}
4- spring.data.mongodb.database =${SPRING_DATA_MONGODB_DATABASE}
1+ spring. application.name = java-api
2+ # CONFIG DATABASE
3+ spring.data.mongodb.uri =
mongodb+srv://danielvor:[email protected] /?retryWrites=true&w=majority&appName=danielvor 4+ spring.data.mongodb.database =todo_db
You can’t perform that action at this time.
0 commit comments