목록개발 (28)
종우의 삶 (전체 공개)
대상 Repository : https://github.com/Jonggae/security Security와 관련된 내용들을 연습한다. 1편에 이어 회원가입 기능에 대한 테스트코드를 작성해본다. 여기서 수많은 난관에 봉착한다. 아직 진행중이기에 결론은 나지 않았지만 어쨌든 테스트코드의 목적은 테스트를 하는 것이기에.. 수많은 시행착오를 거쳐 아주 간단한 형태의 테스트코드가 남게 되었다. 그러나 package com.example.securitydemo.user.service; import com.example.securitydemo.user.domain.User; import com.example.securitydemo.user.dto.RegisterRequestDto; import com.exampl..

대상 Repository : https://github.com/Jonggae/security Security와 관련된 내용들을 연습한다. issue 1 : 회원 가입 기능 현재 Security 기능 중 유저 회원 가입을 개발하고있다. 최대한 단순하게 로직을 구상했고 가입하려는 회원은 username ; 로그인에 필요한 ID 처럼 쓰일 예정 password ; 비밀번호 email ; 메일주소 이상 3가지의 필드를 입력하여야한다. 이 중 password는 db에 저장이 되기 전에 암호화되며 보안성을 높이게 된다. 메인 로직 코드 코드를 전부 올리기에는 번거로우므로 깃허브를 참조한다. 이슈가 생긴 코드는 언급하여 함께 설명한다. 우선 UserService 에서 간단한 정보 3가지를 받아 회원가입을 진행하는 메..
대상 repository : https://github.com/Jonggae/group-invitation ( Readme 참고 ) 목표 : 가독성 향상, 부족한 기능 완성, 테스트코드 작성, 완성도 있는 코드 1.원래 구현 목표에 맞게 클래스를 추가 package com.exam.invitation.authority; public enum MemberRoleEnum { TEMPMEMBER(Authority.TEMPMEMBER), MEMBER(Authority.MEMBER); private final String authority; MemberRoleEnum(String authority) { this.authority=authority; } public String getAuthority() { ret..
대상 repository : https://github.com/Jonggae/group-invitation ( Readme 참고 ) 목표 : 가독성 향상, 부족한 기능 완성, 테스트코드 작성, 완성도 있는 코드 1. @Setter anotation에 대한 내용 @Setter의 사용은 자제하는 것이 좋다. -> 자주 들은 내용이었는데 기능 구현을 더 신경쓰다보니 생각없이 @Setter를 박아넣고 시작. 리팩토링하여 좀더 안정성 있는 코드를 만들어보자. ->객체지향적인 내용 of, from toEntity등으로 변경하였음. Entity 도메인에 setter를 사용하는 대신 생성자와 of를 이용하여 객체를 생성할 수 있도록 함. @Entity @Getter @Setter public class Member {..