-
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.
Feat: 사용자 태그는 자동으로 생성된다.
- Loading branch information
Showing
12 changed files
with
322 additions
and
28 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
src/main/java/com/seong/shoutlink/domain/tag/MemberTag.java
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.seong.shoutlink.domain.tag; | ||
|
||
import com.seong.shoutlink.domain.member.Member; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class MemberTag { | ||
|
||
private final Member member; | ||
private final Tag tag; | ||
|
||
public MemberTag(Member member, Tag tag) { | ||
this.member = member; | ||
this.tag = tag; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/seong/shoutlink/domain/tag/repository/MemberTagEntity.java
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.seong.shoutlink.domain.tag.repository; | ||
|
||
import jakarta.persistence.DiscriminatorValue; | ||
import jakarta.persistence.Entity; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@Entity | ||
@DiscriminatorValue("member") | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class MemberTagEntity extends TagEntity { | ||
|
||
private Long memberId; | ||
|
||
public MemberTagEntity(String name, Long memberId) { | ||
super(name); | ||
this.memberId = memberId; | ||
} | ||
} |
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
10 changes: 9 additions & 1 deletion
10
src/main/java/com/seong/shoutlink/domain/tag/service/TagRepository.java
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,16 +1,24 @@ | ||
package com.seong.shoutlink.domain.tag.service; | ||
|
||
import com.seong.shoutlink.domain.hub.Hub; | ||
import com.seong.shoutlink.domain.member.Member; | ||
import com.seong.shoutlink.domain.tag.HubTag; | ||
import com.seong.shoutlink.domain.tag.MemberTag; | ||
import com.seong.shoutlink.domain.tag.Tag; | ||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public interface TagRepository { | ||
|
||
List<Tag> saveAll(List<HubTag> tags); | ||
List<Tag> saveHubTags(List<HubTag> tags); | ||
|
||
void deleteHubTags(Hub hub); | ||
|
||
Optional<Tag> findLatestTagByHub(Hub hub); | ||
|
||
Optional<Tag> findLatestTagByMember(Member member); | ||
|
||
void deleteMemberTags(Member member); | ||
|
||
List<Tag> saveMemberTags(List<MemberTag> memberTags); | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...service/request/AutoCreateTagCommand.java → ...vice/request/AutoCreateHubTagCommand.java
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,5 +1,5 @@ | ||
package com.seong.shoutlink.domain.tag.service.request; | ||
|
||
public record AutoCreateTagCommand(Long hubId) { | ||
public record AutoCreateHubTagCommand(Long hubId) { | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/com/seong/shoutlink/domain/tag/service/request/AutoCreateMemberTagCommand.java
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.seong.shoutlink.domain.tag.service.request; | ||
|
||
public record AutoCreateMemberTagCommand(Long memberId) { | ||
|
||
} |
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
Oops, something went wrong.