Skip to content

Commit 60910a3

Browse files
committed
initialization of hero
1 parent 8024829 commit 60910a3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

code/spring-boot-telemetry/src/main/java/com/azure/examples/springboot/controller/VeggieController.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.azure.examples.springboot.controller;
22

3+
import com.azure.examples.springboot.model.Veggie;
34
import org.slf4j.Logger;
45
import org.slf4j.LoggerFactory;
56
import org.springframework.beans.factory.annotation.Value;
@@ -31,8 +32,10 @@ public class VeggieController {
3132

3233
@PostMapping("/init")
3334
public ResponseEntity<String> initializeDatabase() {
34-
veggieService.initializeDatabase();
35-
return ResponseEntity.ok("Database initialized with 3 veggie items");
35+
this.addVeggie(VeggieItem.builder().name("Carrot").description("Orange").build());
36+
this.addVeggie(VeggieItem.builder().name("Broccoli").description("Green").build());
37+
this.addVeggie(VeggieItem.builder().name("Cauliflower").description("White").build());
38+
return ResponseEntity.ok("Database initialized with 3 veggie items");
3639
}
3740

3841
@PostMapping

0 commit comments

Comments
 (0)