본문 바로가기

전체 글187

29. ModelMapper 적용 http://modelmapper.org/ ModelMapper - Simple, Intelligent, Object Mapping. Why ModelMapper? The goal of ModelMapper is to make object mapping easy, by automatically determining how one object model maps to another, based on conventions, in the same way that a human would - while providing a simple, refactoring-safe API for handli modelmapper.org 객체의 프로퍼티를 다른 객체의 프로퍼티로 맵핑해주는 유틸리티 의존성 추가 org.model.. 2020. 4. 22.
28. 알림 설정 알림 설정 특정 웹 서비스 이벤트(스터디 생성, 참가 신청 결과, 참여중인 스터디)에 대한 정보를 이메일로 받을지, 웹 알림 메시지로 받을지 선택하는 기능. 물론 둘 다 받을 수도 있음. 부트스트랩 Form 알림 설정을 전달할 Notifications DTO 작성 package me.weekbelt.studyolle.settings; @Data @NoArgsConstructor public class Notifications { private boolean studyCreatedByEmail; private boolean studyCreatedByWeb; private boolean studyEnrollmentResultByEmail; private boolean studyEnrollmentResultB.. 2020. 4. 22.
27. 패스워드 수정 테스트 package me.weekbelt.studyolle.settings; @SpringBootTest @AutoConfigureMockMvc class SettingsControllerTest { // 기존 코드 ..... @Autowired PasswordEncoder passwordEncoder; // 기존 코드 ...... @WithAccount("joohyuk") @DisplayName("패스워드 수정 폼") @Test public void updatePassword_form() throws Exception { mockMvc.perform(get("/settings/password")) .andExpect(status().isOk()) .andExpect(model().attributeExists.. 2020. 4. 22.
26. 패스워드 수정 패스워드 변경 패스워드 탭 활성화 새 패스워드와 새 패스워드 확인의 값이 일치해야 한다. 패스워드 인코딩 할 것! 둘 다 최소 8자에서 최대 50자 사이. 사용자 정보를 변경하는 작업. 서비스로 위임해서 트랜잭션 안에서 처리해야 한다. 또는 Detached 상태의 객체를 변경한 다음 Repository의 save를 호출해서 상태 변경 내역을 적용 할 것(Merge) 새로운 패스워드를 입력받기위한 PasswordForm DTO를 생성 package me.weekbelt.studyolle.settings; @NoArgsConstructor @Data public class PasswordForm { @Length(min = 8, max = 50) private String newPassword; @Lengt.. 2020. 4. 21.