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

[refactor] contents 기초 코드 수정 #10

Merged
merged 5 commits into from
Aug 23, 2024

Conversation

ssunnykku
Copy link
Contributor

Issue

PR 타입(하나 이상의 PR 타입을 선택해주세요)

  • 기능 추가
  • 기능 삭제
  • 버그 수정
  • 의존성, 환경 변수, 빌드 관련 코드 업데이트

반영 브랜치

feat/contents_entity -> dev

변경 사항

코드 리뷰 반영하여 코드 수정

@ssunnykku ssunnykku linked an issue Aug 23, 2024 that may be closed by this pull request
4 tasks
@ssunnykku ssunnykku closed this Aug 23, 2024
@ssunnykku ssunnykku reopened this Aug 23, 2024
@ssunnykku ssunnykku changed the title contents 기초 코드 수정 [refactor] contents 기초 코드 수정 Aug 23, 2024
Content: NoArgsConstructor AccessLevel 설정
User: user_id 컬럼명 변경
@ssunnykku ssunnykku closed this Aug 23, 2024
@ssunnykku ssunnykku reopened this Aug 23, 2024
@ssunnykku ssunnykku self-assigned this Aug 23, 2024
Copy link
Contributor

@pie2457 pie2457 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!
@Colum 어노테이션의 name은 필드에 선언한 변수명과 테이블에 설정해놓은 이름이 다를 경우 사용됩니다!
카멜 케이스는 알아서 스네이크 케이스로 변환되기 때문에 name을 따로 명시해줄 필요는 없습니다 😊

private String title;

Copy link
Contributor

Choose a reason for hiding this comment

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

37라인부터 43라인까지 공백은 없어도 괜찮은거 같아요 ~!

public class User {
@Id
@GeneratedValue(strategy = GenerationType.UUID)
@Column(name = "userId", nullable = false)
@Column(name = "user_Id", nullable = false)
Copy link
Contributor

Choose a reason for hiding this comment

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

user_Id -> user_id가 맞을 것 같습니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

반영했습니다.

@EntityListeners(AuditingEntityListener.class)
public class Content {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "content_id", nullable = false)
Copy link
Contributor

Choose a reason for hiding this comment

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

테이블의 pk를 content_id라고 설정해 놓으셨나요? id라고 설정해 놓으셨으면 name은 따로 작성 안하셔도 돼요!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네 DB 모델링 할 때 content_id로 했었습니다.

@Column(name = "content_id", nullable = false)
private Long id;

@Column(name = "like_count")
Copy link
Contributor

Choose a reason for hiding this comment

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

카멜 케이스는 알아서 스네이크 케이스로 변경되기 때문에 어노테이션 따로 작성 안하셔도 괜찮습니다!

Copy link
Contributor

@K-0joo K-0joo left a comment

Choose a reason for hiding this comment

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

확인했습니다! 수정 사항 반영 감사합니다!

Copy link
Contributor

@pie2457 pie2457 left a comment

Choose a reason for hiding this comment

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

공백라인만 제거해서 반영해주시면 좋을 것 같습니다! 수고하셨습니다 ~~ 😊

@jeongeungyeong jeongeungyeong merged commit c4182f9 into dev Aug 23, 2024
Copy link
Contributor

@rhaehf rhaehf left a comment

Choose a reason for hiding this comment

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

고생많으셨습니다!

@Table(name="contents")
@NoArgsConstructor
@Table(name = "contents")
@NoArgsConstructor(access = AccessLevel.PROTECTED)
Copy link
Contributor

Choose a reason for hiding this comment

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

이전 PR에서 제안한 의견 반영해 주신거 확인했습니다!

@ssunnykku ssunnykku deleted the refactor/contents_entity branch August 23, 2024 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

게시물 기능 공통 코드 작성
6 participants