package es.uv.garcosda.controllers;

import es.uv.garcosda.domain.Meeting;

import java.time.LocalDateTime;
import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class MeetupController {

	List<Meeting> meetings = List.of(new Meeting("First meeting", LocalDateTime.now()),
								     new Meeting("Second meeting", LocalDateTime.now()),
								     new Meeting("Third meeting", LocalDateTime.now()),
								     new Meeting("Fourth meeting", LocalDateTime.now()));
	
	@GetMapping("/")
	public String getMeetups(Model model) {
		model.addAttribute("meetings", this.meetings);
		return "index";
	}
}
