-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#131] feat: UserTagHistory domain 생성과 실패 기록 시 태그 히스토리 저장
- Loading branch information
Showing
7 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
...main/java/com/todaysfail/domains/usertaghistory/adpater/UserTagHistoryCommandAdapter.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,18 @@ | ||
package com.todaysfail.domains.usertaghistory.adpater; | ||
|
||
import com.todaysfail.common.annotation.Adapter; | ||
import com.todaysfail.domains.usertaghistory.domain.UserTagHistory; | ||
import com.todaysfail.domains.usertaghistory.port.UserTagHistoryCommandPort; | ||
import com.todaysfail.domains.usertaghistory.repository.UserTagHistoryRepository; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Adapter | ||
@RequiredArgsConstructor | ||
public class UserTagHistoryCommandAdapter implements UserTagHistoryCommandPort { | ||
private final UserTagHistoryRepository userTagHistoryRepository; | ||
|
||
@Override | ||
public UserTagHistory save(UserTagHistory userTagHistory) { | ||
return userTagHistoryRepository.save(userTagHistory); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...c/main/java/com/todaysfail/domains/usertaghistory/adpater/UserTagHistoryQueryAdapter.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,9 @@ | ||
package com.todaysfail.domains.usertaghistory.adpater; | ||
|
||
import com.todaysfail.common.annotation.Adapter; | ||
import com.todaysfail.domains.usertaghistory.port.UserTagHistoryQueryPort; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Adapter | ||
@RequiredArgsConstructor | ||
public class UserTagHistoryQueryAdapter implements UserTagHistoryQueryPort {} |
33 changes: 33 additions & 0 deletions
33
...ail-Domain/src/main/java/com/todaysfail/domains/usertaghistory/domain/UserTagHistory.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,33 @@ | ||
package com.todaysfail.domains.usertaghistory.domain; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@Builder | ||
@Entity(name = "tbl_user_tag_history") | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class UserTagHistory { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "user_tag_history_id") | ||
private Long id; | ||
|
||
private Long userId; | ||
|
||
private Long tagId; | ||
|
||
public static UserTagHistory registerUserTagHistory(Long userId, Long tagId) { | ||
return new UserTagHistory(null, userId, tagId); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...n/src/main/java/com/todaysfail/domains/usertaghistory/port/UserTagHistoryCommandPort.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,7 @@ | ||
package com.todaysfail.domains.usertaghistory.port; | ||
|
||
import com.todaysfail.domains.usertaghistory.domain.UserTagHistory; | ||
|
||
public interface UserTagHistoryCommandPort { | ||
UserTagHistory save(UserTagHistory userTagHistory); | ||
} |
3 changes: 3 additions & 0 deletions
3
...ain/src/main/java/com/todaysfail/domains/usertaghistory/port/UserTagHistoryQueryPort.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,3 @@ | ||
package com.todaysfail.domains.usertaghistory.port; | ||
|
||
public interface UserTagHistoryQueryPort {} |
6 changes: 6 additions & 0 deletions
6
.../main/java/com/todaysfail/domains/usertaghistory/repository/UserTagHistoryRepository.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,6 @@ | ||
package com.todaysfail.domains.usertaghistory.repository; | ||
|
||
import com.todaysfail.domains.usertaghistory.domain.UserTagHistory; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface UserTagHistoryRepository extends JpaRepository<UserTagHistory, Long> {} |
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