- Timestamp:
- 02/04/24 17:12:57 (9 months ago)
- Branches:
- master
- Children:
- a226bc3
- Parents:
- cab1b7d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/cookbook/controller/VrabotenController.java
rcab1b7d ree27685 3 3 4 4 import com.example.cookbook.model.Naracka; 5 import com.example.cookbook.model.Recept; 6 import com.example.cookbook.model.Stavka; 5 7 import com.example.cookbook.service.NarackiService; 6 8 import org.springframework.stereotype.Controller; 7 9 import org.springframework.ui.Model; 8 10 import org.springframework.web.bind.annotation.GetMapping; 11 import org.springframework.web.bind.annotation.PostMapping; 12 import org.springframework.web.bind.annotation.RequestParam; 9 13 10 14 import java.sql.SQLException; 15 import java.time.LocalDateTime; 11 16 import java.util.List; 12 17 … … 33 38 return "naracki"; 34 39 } 40 41 @GetMapping("/naracki/naracka") 42 public String getNarackaPage(@RequestParam String telefon, 43 @RequestParam LocalDateTime vreme, 44 Model model){ 45 46 List<Stavka> stavkiVoNaracka = null; 47 try { 48 stavkiVoNaracka = narcakiService.findByTelAndVreme(telefon, vreme); 49 } catch (SQLException e) { 50 return "redirect:/error-page/SQL%20Exception"; 51 } 52 53 model.addAttribute("stavki", stavkiVoNaracka); 54 55 return "stavka"; 56 } 35 57 }
Note:
See TracChangeset
for help on using the changeset viewer.