thymeleaf
<div th:if="${message}"
class="alert alert-info alert-dismissable fade show mt-3" role="alert">
<span th:text="${message}">메시지</span>코드를 입력하세요
프로필 이미지 변경은 Cropper를 사용해서 진행합니다.
프론트 라이브러리 설치
서비스로 위임해서 트랜잭션 안에서 처리해야하고,
Detached 상태의 객체를 변경하고,
Repository의 save를 호출해서 상태 변경 내역을 적용합니다. (Merge)
1.임시 비밀번호 생성
public String generateTemporaryPassword(int length) {
StringBuilder randomPassword = new StringBuilder();
String characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
SecureRandom secureRandom = new SecureRandom();
for(int i = 0; i < length; i++) {
char randomChar = characters.charAt(secureRandom.nextInt(characters.length()));
randomPassword.append(randomChar);
}
return randomPassword.toString();
}
public void sendTemporaryPasswordByEmail(Account account, String temporaryPassword) {
String emailMessage = "임시 비밀번호: " + temporaryPassword;
SimpleMailMessage mailMessage = new SimpleMailMessage();
mailMessage.setTo(account.getEmail());
mailMessage.setSubject("스터디메이트, 임시비밀번호 발급");
mailMessage.setText(emailMessage);
javaMailSender.send(mailMessage);
}