<commit_before>package nl.vpro.poel.controller;

import nl.vpro.poel.domain.Match;
import nl.vpro.poel.domain.Message;
import nl.vpro.poel.domain.User;
import nl.vpro.poel.dto.MatchForm;
import nl.vpro.poel.dto.MessageForm;
import nl.vpro.poel.service.MatchService;
import nl.vpro.poel.service.MessageService;
import nl.vpro.poel.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

@Controller
@RequestMapping("/admin")
class AdminController {

    private final MatchService matchService;

    private final MessageService messageService;

    private final UserService userService;

    @Autowired
    public AdminController(MatchService matchService, MessageService messageService, UserService userService) {
        this.matchService = matchService;
        this.messageService = messageService;
        this.userService = userService;
    }

    @RequestMapping(method = RequestMethod.GET)
    String showIndex() {
        return "admin/index";
    }

    @RequestMapping(value = "/matches", method = RequestMethod.GET)
    String showMatches(Model model) {
        List<Match> matches = matchService.findAll();
        model.addAttribute("matches", matches);
        return "admin/matches";
    }

    @RequestMapping(value = "/matches", method = RequestMethod.POST)
    String saveMatches(@ModelAttribute("matches") MatchForm matchForm, BindingResult bindingResult) {
        matchService.save(matchForm);
        return "redirect:/admin/matches";
    }

    @RequestMapping(value = "/messages", method = RequestMethod.GET)
    String showMessages(Model model) {
        List<Message> messages = messageService.findAll();
        model.addAttribute("messages", messages);
        return "admin/messages";
    }

    @RequestMapping(value = "/messages", method = RequestMethod.POST)
    String saveMessages(@ModelAttribute("messages") MessageForm messageForm, BindingResult bindingResult) {
        messageService.setMessages(messageForm);
        return "redirect:/admin/messages";
    }

    @RequestMapping(value = "/users", method = RequestMethod.GET)
    String showUsers(Model model) {
        List<User> allUsers = userService.getAllUsers();
        model.addAttribute("users", allUsers);
        return "admin/users";
    }

    @RequestMapping(value = "/groups", method = RequestMethod.GET)
    String showGroups(Model model) {

        return "admin/groups";
    }
}<commit_msg>Getting the group back together<commit_after>package nl.vpro.poel.controller;

import nl.vpro.poel.domain.Group;
import nl.vpro.poel.domain.Match;
import nl.vpro.poel.domain.Message;
import nl.vpro.poel.domain.User;
import nl.vpro.poel.dto.MatchForm;
import nl.vpro.poel.dto.MessageForm;
import nl.vpro.poel.dto.GroupForm;
import nl.vpro.poel.service.GroupService;
import nl.vpro.poel.service.MatchService;
import nl.vpro.poel.service.MessageService;
import nl.vpro.poel.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

@Controller
@RequestMapping("/admin")
class AdminController {

    private final GroupService groupService;

    private final MatchService matchService;

    private final MessageService messageService;

    private final UserService userService;

    @Autowired
    public AdminController(GroupService groupService, MatchService matchService, MessageService messageService, UserService userService) {
        this.groupService = groupService;
        this.matchService = matchService;
        this.messageService = messageService;
        this.userService = userService;
    }

    @RequestMapping(method = RequestMethod.GET)
    String showIndex() {
        return "admin/index";
    }

    @RequestMapping(value = "/matches", method = RequestMethod.GET)
    String showMatches(Model model) {
        List<Match> matches = matchService.findAll();
        model.addAttribute("matches", matches);
        return "admin/matches";
    }

    @RequestMapping(value = "/matches", method = RequestMethod.POST)
    String saveMatches(@ModelAttribute("matches") MatchForm matchForm, BindingResult bindingResult) {
        matchService.save(matchForm);
        return "redirect:/admin/matches";
    }

    @RequestMapping(value = "/messages", method = RequestMethod.GET)
    String showMessages(Model model) {
        List<Message> messages = messageService.findAll();
        model.addAttribute("messages", messages);
        return "admin/messages";
    }

    @RequestMapping(value = "/messages", method = RequestMethod.POST)
    String saveMessages(@ModelAttribute("messages") MessageForm messageForm, BindingResult bindingResult) {
        messageService.setMessages(messageForm);
        return "redirect:/admin/messages";
    }

    @RequestMapping(value = "/users", method = RequestMethod.GET)
    String showUsers(Model model) {
        List<User> allUsers = userService.getAllUsers();
        model.addAttribute("users", allUsers);
        return "admin/users";
    }

    @RequestMapping(value = "/groups", method = RequestMethod.GET)
    String showGroups(Model model) {
        List<Group> groups = groupService.findAll();
        model.addAttribute("groups", groups);
        return "admin/groups";
    }
}
{'fraction_non_alphanumeric': 0.10779661016949152, 'fraction_numerical': 0.0, 'mean_word_length': 4.047904191616767, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2273457', 'n_tokens_mistral': 1608, 'n_tokens_neox': 1602, 'n_words': 317}