Ignore:
Timestamp:
02/04/24 17:12:57 (5 months ago)
Author:
Blazho <aleksandar.blazhevski@…>
Branches:
master
Children:
a226bc3
Parents:
cab1b7d
Message:

Added order items page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/cookbook/controller/VrabotenController.java

    rcab1b7d ree27685  
    33
    44import com.example.cookbook.model.Naracka;
     5import com.example.cookbook.model.Recept;
     6import com.example.cookbook.model.Stavka;
    57import com.example.cookbook.service.NarackiService;
    68import org.springframework.stereotype.Controller;
    79import org.springframework.ui.Model;
    810import org.springframework.web.bind.annotation.GetMapping;
     11import org.springframework.web.bind.annotation.PostMapping;
     12import org.springframework.web.bind.annotation.RequestParam;
    913
    1014import java.sql.SQLException;
     15import java.time.LocalDateTime;
    1116import java.util.List;
    1217
     
    3338        return "naracki";
    3439    }
     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    }
    3557}
Note: See TracChangeset for help on using the changeset viewer.