Link 테이블 업데이트 관련 질의 #953
-
Link 테이블에 created_at, updated_at 필드 추가하는 것은 어떨까요? 현재 픽 생성 시에 image_url 또는 description이 비어있을 때만 update하도록 되어 있습니다. // null 값이 아닌 필드만 업데이트
// 이미 값이 있으면 업데이트하지 않음.
public Link updateMetadata(String title, String description, String imageUrl) {
if (StringUtils.isEmpty(this.title)) {
this.title = title;
}
if (StringUtils.isEmpty(this.description)) {
this.description = description;
}
if (StringUtils.isEmpty(this.imageUrl)) {
this.imageUrl = imageUrl;
}
return this;
} 픽 생성 시 해당 링크의 updated_at이 한 달이 넘었을 경우에 update를 하는 것은 어떨까요? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
퍼펙트. 아예 #928 작업을 바로 들어갈 수 있게, 오늘 자기전에 |
Beta Was this translation helpful? Give feedback.
-
@sangwonsheep |
Beta Was this translation helpful? Give feedback.
퍼펙트. 아예 #928 작업을 바로 들어갈 수 있게, 오늘 자기전에
updated_at
추가해놓겠슴다.