some more fancy shit to make it auto update without having to press enter
This commit is contained in:
@@ -4,6 +4,7 @@ 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 org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -11,10 +12,15 @@ import java.util.ArrayList;
|
||||
public class WebServer {
|
||||
|
||||
@GetMapping("/")
|
||||
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);
|
||||
public String index() {
|
||||
return "index";
|
||||
}
|
||||
|
||||
@GetMapping("/api/fuzzy")
|
||||
@ResponseBody
|
||||
public ArrayList<BonusItem> index(@RequestParam(value = "q", required = true) String fuzzySearch, Model model){
|
||||
// Call your BonusManager or service to get items
|
||||
ArrayList<BonusItem> items = BonusManager.getBonusItems(fuzzySearch);
|
||||
return items;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user