We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
없음.
현재 MemberDto 코드의 상황입니다.
MemberDto
@Getter @Setter @NoArgsConstructor @AllArgsConstructor @Builder @JsonInclude(Include.NON_NULL) public class MemberDto { private Long id; private String loginId; private String emailAddress; private String password; private String realName; private String nickName; private String authCode; private Date birthday; private String studentId; private Date registerDate; private String followeeLoginId; private Integer point; private Integer level; private String rank; private String type; private List<String> jobs; private String thumbnailPath; private Integer merit; private Integer demerit; private Float generation; public MemberEntity toEntity() { return MemberEntity.builder() .loginId(loginId) .password(password) .realName(realName) .nickName(nickName) .emailAddress(emailAddress) .studentId(studentId) .build(); } public void initWithEntity(MemberEntity memberEntity) { // 민감한 정보 제외 this.id = memberEntity.getId(); this.loginId = null;//memberEntity.getLoginId(); this.password = null;//memberEntity.getPassword(); this.realName = null;//memberEntity.getRealName(); this.nickName = memberEntity.getNickName(); this.birthday = memberEntity.getBirthday(); this.emailAddress = memberEntity.getEmailAddress(); this.studentId = null;//memberEntity.getStudentId(); this.registerDate = memberEntity.getRegisterDate(); this.point = memberEntity.getPoint(); this.level = memberEntity.getLevel(); this.merit = memberEntity.getMerit(); this.demerit = memberEntity.getDemerit(); this.generation = memberEntity.getGeneration(); if (memberEntity.getThumbnail() != null) { this.thumbnailPath = EnvironmentProperty.getThumbnailPath( memberEntity.getThumbnail().getId()); } if (memberEntity.getMemberRank() != null) { this.rank = memberEntity.getMemberRank().getName(); } if (memberEntity.getMemberType() != null) { this.type = memberEntity.getMemberType().getName(); } if (memberEntity.getMemberJobs() != null || memberEntity.getMemberJobs().isEmpty() == false) { this.jobs = new ArrayList<>(); memberEntity.getMemberJobs() .forEach(job -> this.jobs.add(job.getMemberJobEntity().getName())); } } public MemberDto(MemberEntity memberEntity) { // 민감한 정보 포함 this.id = memberEntity.getId(); this.loginId = memberEntity.getLoginId(); this.password = null;//memberEntity.getPassword(); this.realName = memberEntity.getRealName(); this.nickName = memberEntity.getNickName(); this.birthday = memberEntity.getBirthday(); this.emailAddress = memberEntity.getEmailAddress(); this.studentId = memberEntity.getStudentId(); this.registerDate = memberEntity.getRegisterDate(); this.point = memberEntity.getPoint(); this.level = memberEntity.getLevel(); this.merit = memberEntity.getMerit(); this.demerit = memberEntity.getDemerit(); this.generation = memberEntity.getGeneration(); if (memberEntity.getThumbnail() != null) { this.thumbnailPath = EnvironmentProperty.getThumbnailPath( memberEntity.getThumbnail().getId()); } if (memberEntity.getMemberRank() != null) { this.rank = memberEntity.getMemberRank().getName(); } if (memberEntity.getMemberType() != null) { this.type = memberEntity.getMemberType().getName(); } if (memberEntity.getMemberJobs() != null || memberEntity.getMemberJobs().isEmpty() == false) { this.jobs = new ArrayList<>(); memberEntity.getMemberJobs() .forEach(job -> this.jobs.add(job.getMemberJobEntity().getName())); } } }
불필요한 정보까지 클라이언트로 넘겨주고 있으며, Dto 코드 자체도 방대해서 알아보기 힘듭니다. 또, admin/MemberDto와 user/MemberDto, common/CommonMemberDto 등 비슷한 Dto가 많습니다.
admin/MemberDto
user/MemberDto
common/CommonMemberDto
많은 코드에서 사용하는 MemberDto인 만큼 확실한 체계를 갖추고, 깔끔한 코드를 보여줘야 합니다.
따라서, 권한수준에 따라서 회원 정보를 얼마나 보여줄 지 상의하고 그에 맞게 MemberDto를 수정해야 할 것 같습니다.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
사전 수행 issue
없음.
이슈 내용
현재
MemberDto
코드의 상황입니다.불필요한 정보까지 클라이언트로 넘겨주고 있으며, Dto 코드 자체도 방대해서 알아보기 힘듭니다.
또,
admin/MemberDto
와user/MemberDto
,common/CommonMemberDto
등 비슷한 Dto가 많습니다.많은 코드에서 사용하는
MemberDto
인 만큼 확실한 체계를 갖추고, 깔끔한 코드를 보여줘야 합니다.따라서, 권한수준에 따라서 회원 정보를 얼마나 보여줄 지 상의하고 그에 맞게
MemberDto
를 수정해야 할 것 같습니다.MemberDto
를 수정한다.The text was updated successfully, but these errors were encountered: