- Timestamp:
- 01/04/23 02:49:26 (23 months ago)
- Branches:
- main
- Children:
- ab952ab
- Parents:
- 6832924
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/autopartz/controller/PartController.java
r6832924 rae042f4 5 5 import com.example.autopartz.service.PriceService; 6 6 import com.example.autopartz.service.RepairShopService; 7 import jakarta.servlet.http.HttpServletResponse;8 7 import org.springframework.stereotype.Controller; 9 8 import org.springframework.ui.Model; 10 9 import org.springframework.web.bind.annotation.*; 11 10 11 import javax.servlet.http.HttpServletResponse; 12 12 import java.io.IOException; 13 13 … … 24 24 } 25 25 @GetMapping("/{id}") 26 public String getPartPage(@PathVariable Longid, Model model){26 public String getPartPage(@PathVariable Integer id, Model model){ 27 27 Part temp = partService.findById(id); 28 28 Integer amount = priceService.findPriceForPart(temp).stream().findFirst().orElseThrow(RuntimeException::new).getAmount(); … … 33 33 } 34 34 @GetMapping("/delivery/{id}") 35 public String getDeliveryPage(@PathVariable Longid, Model model){35 public String getDeliveryPage(@PathVariable Integer id, Model model){ 36 36 model.addAttribute("repairShops",repairShopService.findAll()); 37 37 model.addAttribute("partId",id);
Note:
See TracChangeset
for help on using the changeset viewer.