-
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.
ποΈ μ±ν
λ©μμ§ μμ± κΈ°λ₯(out port μμμ±)(#6)
- Loading branch information
Showing
5 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
api/src/main/java/hexagonal/api/chat/application/port/out/FindChatPort.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,10 @@ | ||
package hexagonal.api.chat.application.port.out; | ||
|
||
import hexagonal.core.domain.jpa.ChatJpaEntity; | ||
|
||
import java.util.List; | ||
|
||
public interface FindChatPort { | ||
List<ChatJpaEntity> findChatByRoom(Long roomId); | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
api/src/main/java/hexagonal/api/chat/application/port/out/SaveChatPort.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,8 @@ | ||
package hexagonal.api.chat.application.port.out; | ||
|
||
import hexagonal.core.domain.jpa.ChatJpaEntity; | ||
|
||
public interface SaveChatPort { | ||
Long saveChat(ChatJpaEntity entity); | ||
|
||
} |
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
30 changes: 30 additions & 0 deletions
30
core/src/main/java/hexagonal/core/domain/jpa/ChatJpaEntity.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,30 @@ | ||
package hexagonal.core.domain.jpa; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.persistence.*; | ||
|
||
@Entity | ||
@Table(name = "chat") | ||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Builder | ||
public class ChatJpaEntity { | ||
|
||
@Id | ||
@GeneratedValue | ||
private Long id; | ||
|
||
@Column | ||
private String content; | ||
|
||
@Column | ||
private Long senderId; | ||
|
||
@Column | ||
private Long roomId; | ||
} |
10 changes: 10 additions & 0 deletions
10
core/src/main/java/hexagonal/core/repository/ChatRepository.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,10 @@ | ||
package hexagonal.core.repository; | ||
|
||
import hexagonal.core.domain.jpa.ChatJpaEntity; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface ChatRepository extends JpaRepository<ChatJpaEntity, Long> { | ||
|
||
} |