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: Post Modify 기능 개발 #21

Merged
merged 8 commits into from
Jan 29, 2024
Merged

feat: Post Modify 기능 개발 #21

merged 8 commits into from
Jan 29, 2024

Conversation

yumzen
Copy link
Member

@yumzen yumzen commented Jan 29, 2024

#️⃣ 연관된 이슈

#4 , #6

📝 작업 내용

Post 수정 기능 개발 완료

스크린샷 (선택)

image

💬 리뷰 요구사항(선택)

enum 파일 추가
post entity, controller, service, dto 내용 잘 확인 부탁드립니다!

@yumzen yumzen self-assigned this Jan 29, 2024
@yumzen yumzen added the feat 기능 개발 시 label Jan 29, 2024
@yumzen yumzen linked an issue Jan 29, 2024 that may be closed by this pull request
Post entity = postRepository.findById(id)
.orElseThrow(() -> new IllegalArgumentException());
entity.modify(req);
entity.setModifiedAt(LocalDateTime.now());
Copy link
Contributor

Choose a reason for hiding this comment

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

modifiedAt은 @LastModifiedAt이라는 어노테이션을 선언했기에, 이렇게 set 메소드를 쓰지 않아도 자동으로 시간이 업데이트될거라서 안 쓰셔도 될 거에요!

import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.time.LocalDateTime;

@Getter
@Setter
Copy link
Contributor

Choose a reason for hiding this comment

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

위의 setModifiedAt은 필요 없어서, setter도 사용 안 하셔도 될 것 같아요!

Copy link
Contributor

@dl-00-e8 dl-00-e8 left a comment

Choose a reason for hiding this comment

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

리뷰 남긴 두 부분만 확인해주시면 될 것 같아요!
DTO를 class로 쓴 부분들은 추후에 record로 리팩토링되는 부분들이라 일단 리뷰 남긴 두 부분만 고치고 진행해도 좋을 것 같습니다!
수고 많으셨어요! 😄

Copy link
Member

@jinnxyoung jinnxyoung left a comment

Choose a reason for hiding this comment

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

굿굿 지은이 수고했어!! ☺️

@yumzen yumzen merged commit 912aa03 into feat/post Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat 기능 개발 시
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: 프로젝트 수정/삭제 기능 개발
3 participants