27 lines
787 B
Java
27 lines
787 B
Java
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 org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
@Controller
|
|
public class WebServer {
|
|
|
|
@GetMapping("/")
|
|
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;
|
|
}
|
|
}
|