/
ZufarFaiz
/
SberProject
Обзор
Документация
Войти
/
ZufarFaiz
/
SberProject
Код
Запросы
1
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
src/main/java/com/example/JobExchange_app/controller/ApplicantProfileController.java
36 строк
1 KB
Семейный
Добавил обработчики,упростил логику в контроллерах
01 июн 2025, 23:33
01 июн 2025, 23:33
6559e91
Код
Авторство
О чём код?
package com.example.JobExchange_app.controller; import com.example.JobExchange_app.dto.ApplicantProfileDto; import com.example.JobExchange_app.service.ApplicantService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import org.springframework.ui.Model; @Slf4j @Controller @RequestMapping("/applicant/profile") public class ApplicantProfileController { @Autowired ApplicantService applicantServiceImpl; @GetMapping("/") public String profile(Model model) { model.addAttribute("profile", applicantServiceImpl.getProfile(applicantServiceImpl.getUserName())); return "applicantProfile"; } @GetMapping("/edit") public String editProfile(Model model) { model.addAttribute("profile", applicantServiceImpl.getProfile(applicantServiceImpl.getUserName())); return "updateApplicantProfile"; } @PutMapping public String updateProfile(@ModelAttribute ApplicantProfileDto dto){ applicantServiceImpl.updateProfile(applicantServiceImpl.getUserName(),dto); return "redirect:/applicant/profile/"; } }