Skip to content

refactor:: yunNote 반영 리팩토링#276

Merged
HyunJunSon merged 2 commits intoKernel360:developfrom
HyunJunSon:refator/yunNote
Mar 7, 2024
Merged

refactor:: yunNote 반영 리팩토링#276
HyunJunSon merged 2 commits intoKernel360:developfrom
HyunJunSon:refator/yunNote

Conversation

@HyunJunSon
Copy link
Collaborator

💡 Motivation and Context

여기에 왜 이 PR이 필요했는지, PR을 통해 무엇이 바뀌는지에 대해서 설명해 주세요

  • 최윤진 멘토님 리뷰에 따른 리팩토링 진행했습니다.
  • [review] f1-washpedia #144
  • 전체내용을 반영하지는 못했고, 가능한 부분 위주로 진행했습니다.
  • physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
    는 carInfo, washInfo entity 대상으로 테스트 삼아 바꾸어보았습니다. 데이터베이스 반영은 잘되는 것을 확인했습니다.
    다른 entity 적용여부는 얘기를 해보시면 좋을 듯 합니다.

image
image


🔨 Modified

여기에 무엇이 크게 바뀌었는지 설명해 주세요

  • enumtype 위치변경
  • Objects 메소드 활용 null 로직 간소화
  • camel_underscore 자동설정 추가 등
  • Password validation 추가 (백엔드에서도 password 같은 경우는 검증 로직을 넣는것이 좋다고 합니다.)

🌟 More

  • 여기에 PR 이후 추가로 해야 할 일에 대해서 설명해 주세요


📋 커밋 전 체크리스트

  • 추가/변경에 대한 단위 테스트를 완료하였습니다.
  • 컨벤션에 맞게 작성하였습니다.

🤟🏻 PR로 완료된 이슈

closes #270

@HyunJunSon HyunJunSon added 🖥️ BackEnd 서버 관련 🔨 Refactor 이 코드는 아주 약간 더 클린코드에 가까워졌습니다... labels Mar 6, 2024
@HyunJunSon HyunJunSon self-assigned this Mar 6, 2024
@@ -1,4 +1,4 @@
package com.kernel360.main.controller;
package com.kernel360.main.enumset;
Copy link
Collaborator

Choose a reason for hiding this comment

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

enum 타입 패키지 이동 후 메서드 public 부여 확인 했습니다.

import jakarta.validation.constraints.Size;

public record PasswordDto(
@NotBlank(message = "비밀번호는 비어 있을수 없습니다.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

이건 저희 로그상에서만 확인 가능한 메세지를 내보내주는 역할인가 보네요

dialect: org.hibernate.dialect.PostgreSQLDialect
ddl-auto: validate
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
Copy link
Collaborator

Choose a reason for hiding this comment

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

@column 애노테이션 제거 후 자동 매핑 처리를 위한 옵션 확인 했습니다.

Copy link
Collaborator

@chan99k chan99k left a comment

Choose a reason for hiding this comment

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

리팩터링 고생하셨습니다~

format_sql: true
dialect: org.hibernate.dialect.PostgreSQLDialect
ddl-auto: validate
naming:
Copy link
Collaborator

Choose a reason for hiding this comment

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

hibernate 가 자동으로 이름 붙여주는 부분 확인하였습니다

public record PasswordDto(
@NotBlank(message = "비밀번호는 비어 있을수 없습니다.")
@Size(min = 8, max = 16, message = "비밀번호는 8~16글자입니다.")
@Pattern(regexp = "^(?=.*[0-9])(?=.*[a-zA-Z])(?=\\S+$).{8,20}$", message = "8~16자의 영문 대/소문자, 숫자, 특수문자를 사용해 주세요.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍🏻

Copy link
Collaborator

@linglong67 linglong67 left a comment

Choose a reason for hiding this comment

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

확인했습니다~!
확인 요청드린 코멘트만 봐주세요~

Comment on lines +9 to +11
@Size(min = 8, max = 16, message = "비밀번호는 8~16글자입니다.")
@Pattern(regexp = "^(?=.*[0-9])(?=.*[a-zA-Z])(?=\\S+$).{8,20}$", message = "8~16자의 영문 대/소문자, 숫자, 특수문자를 사용해 주세요.")
// @Pattern(regexp = "^(?=.*[0-9])(?=.*[a-zA-Z])(?=.*\\W).{8,16}$", message = "8~16자의 영문자(대/소문자 구분 없음), 숫자, 특수문자를 사용해 주세요.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Size에 대한 내용과 대소문자 구분을 보면 아래 주석을 한 부분의 패턴이 맞는 것 같은데 아래 패턴을 주석처리하고 위 패턴으로 적용하신 이유가 있으실까요?

Copy link
Collaborator

Choose a reason for hiding this comment

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

깔끔해지겠군요 ㅎㅎ
저도 이후에 만드는 건 일단 이렇게 해봐야겠어요

@HyunJunSon HyunJunSon merged commit 1094194 into Kernel360:develop Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🖥️ BackEnd 서버 관련 🔨 Refactor 이 코드는 아주 약간 더 클린코드에 가까워졌습니다...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor::Sping Mentor님 Review에 따른 리팩토링

4 participants