This commit is contained in:
@@ -1,12 +1,19 @@
|
||||
package be.seeseepuff.pcinv.controllers;
|
||||
|
||||
import be.seeseepuff.pcinv.services.AssetService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Controller
|
||||
public class WebController {
|
||||
private final AssetService assetService;
|
||||
|
||||
@GetMapping("/")
|
||||
public String index() {
|
||||
return "index"; // This will resolve to src/main/resources/templates/index.html
|
||||
public String index(Model model) {
|
||||
model.addAttribute("asset_count", assetService.countAssets());
|
||||
return "index";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user