-
Notifications
You must be signed in to change notification settings - Fork 4
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: 휴지통 관련 기능 구현 #53
Conversation
import javax.persistence.Table; | ||
|
||
@Entity | ||
@Table(name = "albumPage") |
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.
굳이 name을 지정하지 않으셔도 될거 같아요!
import java.time.LocalDateTime; | ||
|
||
@Entity | ||
@Table(name = "trashs") |
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.
해당 테이블은 trashs라고 명명하신 이유가 있을까요?
private final TrashService trashService; | ||
|
||
//휴지통 조회 GET | ||
@GetMapping("/") |
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.
해당 엔드포인트는 불필요해 보입니다!
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/albums/{albumId}/trashes") |
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.
작성하신 대로 trash의 복수형이 trashs인데 trashs에서 명세를 바꾸는 것이 좋을듯 합니다.
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.
잘 이해가 안가서 그러는데 trashs로 명세를 다 바꾸는 것이 좋다는 의미인가요?
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.
trashes 로 바뀌어야 하지 않을까 라는 의견입니다..ㅎㅎ
|
||
public interface TrashJPARepository extends JpaRepository<Trash, Long> { | ||
@Query("select t from Trash t where t.albumPage.album.id = :albumId") | ||
List<Trash> findAllByAlbumId(@Param("albumId") Long albumId); |
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.
이 부분도 Spring Data JPA 라이브러리가 제공하는 쿼리 메소드를 활용하면 좋을듯 합니다.
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.
jpa 기본 메서드가 findAllByAlbumPage_Album_Id라 findAllByAlbumId으로 직접 쿼리를 적는 것이 직관적이라 생각했습니다. 둘의 성능 차이는 없는데 기본 메서드로 변경하는 것이 좋을까요?
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.
return new TrashesFindResponseDTO(albumId, trashes); | ||
} | ||
|
||
public void restoreTrash(Long trashId){ |
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.
트랜잭션 처리를 해야하지 않을까요!
@Getter | ||
public class TrashesFindResponseDTO { | ||
private Long albumId; | ||
private List<TrashDTO> Trashes; |
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.
trashes라고 명명하는 게 더 좋을거 같아요! 오타인거 같네요.
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.
이름 관련은 둘이 작성하다 보니 체크가 덜 된 것 같습니다. 확인해서 통일하겠습니다
Issue #52
어떤 페이지인지 이미지를 띄워야 하는데 앨범 페이지에서 가지고 오는지 논의가 필요합니다.
페이지 영구 삭제에 대한 논의가 필요합니다.
Description
휴지통 관련 기능 구현
Tasks