added (somewhat) functional front-end
This commit is contained in:
@@ -1,12 +1,20 @@
|
||||
package nl.herpiederpiee.appie_scraper;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@Controller
|
||||
public class WebServer {
|
||||
|
||||
@GetMapping("/")
|
||||
public String index() {
|
||||
return "index"; // resolves to index.html in templates/
|
||||
public String index(@RequestParam(value = "fuzzySearch", required = false) String fuzzySearch, Model model) {
|
||||
// Call your BonusManager or service to get items
|
||||
ArrayList<BonusItem> items = BonusManager.getBonusItems(fuzzySearch);
|
||||
model.addAttribute("items", items);
|
||||
return "index";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user