refactor: 重构邮件通知部分

This commit is contained in:
Captain.B 2020-09-27 14:57:53 +08:00
parent 6fa096f319
commit 7d91d48fa4
2 changed files with 7 additions and 8 deletions

View File

@ -6,8 +6,7 @@ import lombok.Data;
import java.util.List;
@Data
public class NoticeRequest extends NoticeDetail {
private String testId;
private List<NoticeDetail> notices;
public class NoticeRequest {
private String testId;
private List<NoticeDetail> notices;
}

View File

@ -47,7 +47,7 @@ public class NoticeService {
NoticeExample example = new NoticeExample();
example.createCriteria().andTestIdEqualTo(id);
List<Notice> notices = noticeMapper.selectByExample(example);
List<NoticeDetail> notice = new ArrayList<>();
List<NoticeDetail> result = new ArrayList<>();
List<String> success = new ArrayList<>();
List<String> fail = new ArrayList<>();
String[] successArray;
@ -75,10 +75,10 @@ public class NoticeService {
failArray = fail.toArray(new String[0]);
notice1.setNames(successArray);
notice2.setNames(failArray);
notice.add(notice1);
notice.add(notice2);
result.add(notice1);
result.add(notice2);
}
return notice;
return result;
}
}