Skip to content
New issue

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

[BE] 인지원 로그인 #8

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open

Conversation

jiixon
Copy link
Member

@jiixon jiixon commented May 16, 2024

No description provided.

@jiixon jiixon self-assigned this May 16, 2024
@jiixon jiixon changed the title 인지원 로그인 [BE] 인지원 로그인 May 16, 2024
String password,

@NotNull
Part part
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part를 dto에서 enum type으로 받게 되면 "fe" , "be" 처럼 소문자 입력에서 에러가 발생할 수도 있을 것 같습니다.
String으로 변경후 받은 part를 대문자로 변환 -> enum에서 가져와서 저장하는 로직은 어떨까요?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

사실 그 부분은 기획적인 부분도 포함될 거같은데요! 해당 선택 부분이 드롭다운 바라고 생각했어서 자체를 enum으로 가져오도록 구현했었네요 말씀하신 방법도 좋은 것 같습니다:)

String accessToken,

@NotNull
String refreshToken
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 서비스는 로그인 세션을 길게 유지할(길어도 일주일에 한번) 필요가 없는 서비스라는 생각이 들었습니다.
따라서 refreshToken을 사용하지 않는 방향도 고려해보시면 좋을것 같습니다.
습관적으로 refreshToken을 사용하지만 꼭 사용해야 할까? 에 대해서도 같이 고민해 보면 좋을 것 같아요.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네! 습관적으로 refreshtoken을 생각했네요.. ^^..ㅜ 조언 감사합니다:)

Copy link
Member

@rootTiket rootTiket May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

정적 팩토리 메서드 패턴으로 수정하시는 방향도 고려해보시면 좋을것 같습니다!
다른 분 프로젝트에서 참고할 만한 코드가 있어 첨부합니다

public static Blog create(final Member member, final BlogCreateRequest blogCreateRequest) {
    return Blog.builder()
            .member(member)
            .title(blogCreateRequest.title())
            .description(blogCreateRequest.description())
            .build();
}

@Builder
public Blog(Member member, String title, String description) {
    this.member = member;
    this.title = title;
    this.description = description;
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋은 것 같습니다! 리팩토링 해볼게요!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants