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

feat: 특정 방문 기록 삭제 API 구현 #26 #42

Merged
merged 22 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
295c97c
feat: 특정 방문 기록 삭제 API 구현
devhoya97 Jul 22, 2024
5eefdf6
feat: 양수가 아닌 id로 특정 방문 기록 삭제를 시도할 때 예외 처리 기능 구현
devhoya97 Jul 22, 2024
e03d7d5
feat: 방문 기록 삭제 시 방문 로그도 함께 삭제되는 기능 구현
devhoya97 Jul 22, 2024
30a2fc3
refactor: 커스텀 예외를 제거하는 방향으로 변경
devhoya97 Jul 23, 2024
8b9914c
fix: 예외를 못 잡던 문제 해결
devhoya97 Jul 23, 2024
2748c25
refactor: 메서드명 적절하게 변경
devhoya97 Jul 23, 2024
939d46d
build: Docker Compose Setting #27 (#40)
Ho-Tea Jul 22, 2024
b735d14
feat: 여행 상세 생성 API 구현 #18 (#43)
linirini Jul 23, 2024
60171c8
build: CD yml 파일 구성 #28 (#53)
Ho-Tea Jul 23, 2024
3bf8c9b
fix: rebase 과정에서 파일이 꼬인 문제 해결
devhoya97 Jul 24, 2024
495f98e
test: HttpHeaders.AUTHORIZATION 사용
devhoya97 Jul 24, 2024
c2bfc63
refactor: 중간 테이블 엔티티 수정 #56 (#57)
linirini Jul 24, 2024
c490e2c
feat: Pin, Visit, VisitLog 생성자에 builder 추가
devhoya97 Jul 24, 2024
6a94854
feat: Pin repository 추가
devhoya97 Jul 24, 2024
f144a77
refactor: visit이 삭제되기 전에 visit에 의존하는 visitLog들이 먼저 삭제되도록 순서 변경
devhoya97 Jul 24, 2024
076e570
test: 방문 기록 삭제에 대한 서비스 슬라이스 테스트 추가
devhoya97 Jul 24, 2024
a559d68
test: 방문 기록이 갖는 모든 방문 로그 삭제 메서드 테스트
devhoya97 Jul 24, 2024
665ea5f
fix: Modifying을 사용할 때 영속성컨텍스트와 관련하여 발생하던 문제 해결
devhoya97 Jul 24, 2024
55218fd
refactor: visitLog의 content를 필수값으로 변경
devhoya97 Jul 24, 2024
94d2664
test: 컨벤션에 맞게 Controller 테스트 클래스 변경
devhoya97 Jul 24, 2024
fff5c00
fix: ConstraintViolationException의 예외 메시지를 정해둔 형식에 맞게 변경
devhoya97 Jul 24, 2024
4ad9148
Merge branch 'develop-be' into feature/#26-delete-visit
devhoya97 Jul 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions backend/src/main/java/com/staccato/pin/domain/Pin.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
import com.staccato.config.domain.BaseEntity;

import lombok.AccessLevel;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.NonNull;

@Entity
@NoArgsConstructor(access = AccessLevel.PROTECTED)
Expand All @@ -24,4 +26,10 @@ public class Pin extends BaseEntity {
private String place;
@Column(nullable = false)
private String address;

@Builder
public Pin(@NonNull String place, @NonNull String address) {
this.place = place;
this.address = address;
}
}
11 changes: 10 additions & 1 deletion backend/src/main/java/com/staccato/visit/domain/Visit.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;

@Entity
@Builder
@Getter
@AllArgsConstructor
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@SQLDelete(sql = "UPDATE visit SET is_deleted = true WHERE id = ?")
Expand All @@ -39,4 +41,11 @@ public class Visit extends BaseEntity {
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "travel_id", nullable = false)
private Travel travel;

@Builder
public Visit(@NonNull LocalDate visitedAt, @NonNull Pin pin, @NonNull Travel travel) {
this.visitedAt = visitedAt;
this.pin = pin;
this.travel = travel;
}
}
12 changes: 11 additions & 1 deletion backend/src/main/java/com/staccato/visit/domain/VisitLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.validation.constraints.NotNull;

import org.hibernate.annotations.SQLDelete;

Expand All @@ -17,10 +18,12 @@
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;

@Entity
@Builder
@Getter
@AllArgsConstructor
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@SQLDelete(sql = "UPDATE visit_log SET is_deleted = true WHERE id = ?")
Expand All @@ -36,4 +39,11 @@ public class VisitLog extends BaseEntity {
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "member_id", nullable = false)
private Member member;

@Builder
public VisitLog(String content, @NotNull Visit visit, @NonNull Member member) {
Copy link
Contributor

Choose a reason for hiding this comment

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

2차 스프린트 개발 범위는 아니지만, content도 필수값이 될 것 같습니다. NotNull 어노테이션을 추가하면 좋을 것 같네요!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

간단한 내용이라 반영 했습니다 :)

this.content = content;
this.visit = visit;
this.member = member;
}
}