Skip to content

Commit

Permalink
πŸ—ƒοΈ μ±„νŒ… λ©”μ‹œμ§€ 생성 κΈ°λŠ₯(out port μ˜μ†μ„±)(#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
jun108059 committed Jul 17, 2022
1 parent 2f099fd commit 6071099
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 1 deletion.
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);

}
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);

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@Builder
@AllArgsConstructor
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Message {
public class Chat {

private Long id;
private String content;
Expand Down
30 changes: 30 additions & 0 deletions core/src/main/java/hexagonal/core/domain/jpa/ChatJpaEntity.java
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 core/src/main/java/hexagonal/core/repository/ChatRepository.java
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> {

}

0 comments on commit 6071099

Please sign in to comment.