This commit is contained in:
Anton Romanov 2025-03-18 17:59:42 +04:00
parent 10b6835a31
commit a630df317c

View File

@ -2,7 +2,11 @@ package ru.ulstu.admin.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import ru.ulstu.admin.model.ReportForm;
import ru.ulstu.admin.service.AdminReportService;
@ -19,10 +23,12 @@ public class AdminReportController {
this.adminReportService = adminReportService;
}
@GetMapping("/report/{aspirantId}")
public String getReportForm(@PathVariable(value = "aspirantId") Integer aspirantId, Model model) {
@GetMapping("/report")
public String getReportForm(Model model) {
ReportForm reportForm = new ReportForm();
reportForm.setAspirantId(aspirantId); // Устанавливаем ID аспиранта
//todo get current user aspirant id
//reportForm.setAspirantId(aspirantId); // Устанавливаем ID аспиранта
model.addAttribute("report", reportForm);
return "admin/aspirantReport"; // Возвращает шаблон report.html
}