package com.example.redirect;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.view.RedirectView;
@RestController
public class RedirectController {
@GetMapping("/search")
public RedirectView redirectToWebsite(@RequestParam String query) {
if (query.contains("flippenlekkerbraai")) {
return new RedirectView("https://b-e-o.shop.netcash.co.za/");
}
return new RedirectView("https://www.google.com");
}
}