-
Notifications
You must be signed in to change notification settings - Fork 0
[Feature] 백엔드 엔티티 구조 구현 #60
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
base: dev
Are you sure you want to change the base?
Conversation
- `uuid-creator` 라이브러리 추가 - `StringToUuidConverter` 구현으로 문자열을 UUID로 변환하도록 설정 - Spring Web MVC 구성에 uuid-converter 등록
- `UuidV7Generator` 객체 구현으로 UUID v7 생성 기능 제공
- `TZ` 및 `PGTZ` 환경 변수에 `Asia/Seoul` 값 설정 추가
- `BaseTimeEntity` 및 `BaseTimeSyncEntity` 생성으로 공통 시간 관리 필드 및 동작 분리 - `BaseEntity`에서 UUID 자동 생성 로직 추가 (`UuidV7Generator` 활용)
- `Tag` 엔티티 구현으로 태그 관리 기능 지원 - 이름 및 HEX 색상 검증 로직 포함
- `Group` 엔티티 생성으로 그룹 관리 기능 지원 - 제목 길이 및 가시성(Visibility) 검증 로직 포함
- `Place`, `Address`, `PlaceImage`, `PlaceTag` 엔티티 구현 - 장소의 주소, 이미지, 태그 관련 연관관계 매핑 및 검증 로직 추가
- `UuidV7Generator`를 활용하여 UUID 생성 로직을 각 엔티티의 팩토리 메서드로 이동 - `BaseEntity`에서 UUID 자동 생성 기능 제거
uselessnaming
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
추상화를 통해서 UUID 생성하는 것과 시간과 관련된 속성을 중복을 갖는 Entity들을 묶어주셨다고 이해하면 될까요?
| @Entity | ||
| @Table(name = "place_images") | ||
| @SQLDelete(sql = "UPDATE place_images SET deleted_at = CURRENT_TIMESTAMP WHERE id = ?") | ||
| @SQLRestriction("deleted_at IS NULL") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 restriction 어노테이션이 어떤 의미인지 궁금합니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
soft delete 하면서 deleted_at을 사용하는데,
매번 조회할 때 where deleted_at is not null 인거 붙여서 조회하지 않아도 자동으로 null인 거 빼고 조회하도록 도와주는 부분입니다! 조회할 때 놓칠 수도 있고, 매번 저 조건을 추가하는 것도 쿼리가 길어져서요!
📝 변경 사항
백엔드 데이터베이스 구조(엔티티)를 구현했습니다.
🎯 작업 내용
구현된 엔티티 (데이터 구조)
User (사용자)
Group (그룹)
Tag (태그)
Place (장소)
기술적 개선사항
UUID v7 도입
UuidV7Generator를 활용하여 UUID 생성 로직을 각 엔티티의 팩토리 메서드에 설정타임존 설정
공통 필드 자동 관리
🔗 관련 이슈
Closes #58
📸 스크린샷 (선택사항)
💬 리뷰어에게