fixed bugs
This commit is contained in:
@@ -8,31 +8,33 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import de.jottyfan.bico.modules.CommonController;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
public class NextController extends CommonController {
|
||||
|
||||
@Autowired
|
||||
private NextService service;
|
||||
|
||||
|
||||
@GetMapping("/next")
|
||||
public String getNext(Model model) {
|
||||
model.addAttribute("list", service.getNext(LocalDate.now()));
|
||||
public String getNext(@RequestParam(name = "groupname", required = false) String groupname, Model model) {
|
||||
model.addAttribute("list", service.getNext(LocalDate.now(), groupname));
|
||||
return "/next";
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/next/{date}")
|
||||
public String getNextForDate(@PathVariable("date") String dateStr, Model model) {
|
||||
public String getNextForDate(@PathVariable("date") String dateStr,
|
||||
@RequestParam(name = "groupname", required = false) String groupname, Model model) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
LocalDate date = LocalDate.parse(dateStr, formatter);
|
||||
model.addAttribute("list", service.getNext(date));
|
||||
LocalDate date = LocalDate.parse(dateStr, formatter);
|
||||
model.addAttribute("list", service.getNext(date, groupname));
|
||||
return "/next";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user