-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: 허브 태그 자동 생성 조건을 수정한다.
- Loading branch information
Showing
9 changed files
with
113 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,29 @@ | ||
package com.seong.shoutlink.domain.tag; | ||
|
||
import java.time.LocalDateTime; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class Tag { | ||
|
||
private Long tagId; | ||
private String name; | ||
private LocalDateTime createdAt; | ||
private LocalDateTime updatedAt; | ||
|
||
public Tag(String name) { | ||
this(null, name); | ||
this(null, name, null, null); | ||
} | ||
|
||
public Tag(Long tagId, String name) { | ||
public Tag(Long tagId, String name, LocalDateTime createdAt, LocalDateTime updatedAt) { | ||
this.tagId = tagId; | ||
this.name = name; | ||
this.createdAt = createdAt; | ||
this.updatedAt = updatedAt; | ||
} | ||
|
||
public boolean isCreatedWithinADay() { | ||
LocalDateTime aDayAgo = LocalDateTime.now().minusDays(1); | ||
return createdAt.isAfter(aDayAgo); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
package com.seong.shoutlink.fixture; | ||
|
||
import com.seong.shoutlink.domain.tag.Tag; | ||
import java.time.LocalDateTime; | ||
|
||
public final class TagFixture { | ||
|
||
public static final long TAG_ID = 1L; | ||
public static final String TAG_NAME = "태그1"; | ||
public static final LocalDateTime MORE_THEN_A_DAY = LocalDateTime.now().minusHours(25); | ||
|
||
public static Tag tag() { | ||
return new Tag(1L, "태그1"); | ||
return new Tag(TAG_ID, TAG_NAME, MORE_THEN_A_DAY, MORE_THEN_A_DAY); | ||
} | ||
} |