Resolve "Список периодических событий" #129

Merged
romanov73 merged 57 commits from 4-show-time-line into master 2018-10-30 23:32:01 +04:00
Showing only changes of commit 7f54394b44 - Show all commits

View File

@ -0,0 +1,25 @@
package ru.ulstu.paper.service;
import ru.ulstu.paper.model.Paper;
import ru.ulstu.paper.model.PaperDto;
import ru.ulstu.user.model.UserDto;
import ru.ulstu.user.service.MailService;
import java.util.List;
public class PaperMessages {
public final MailService mailService;
public PaperMessages(MailService mailService){
this.mailService = mailService;
}
private void sendMessageAboutStatusChange(Paper.PaperStatus oldStatus, PaperDto paper){
List<UserDto> users = paper.getAuthors();
for (UserDto user: users) {
mailService.sendEmail(user.getEmail(), "Обновление статуса статьи",
"Статус статьи " + paper.getTitle() + " сменился с " + oldStatus.getName()
+ " на " + paper.getStatus().getName());
}
}
}