-
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.
๐๏ธ ์ฑํ
๋ฐฉ ์์ฑ In Port UseCase, Command(#5)
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
api/src/main/java/hexagonal/api/room/application/port/in/CreateRoomCommand.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,25 @@ | ||
package hexagonal.api.room.application.port.in; | ||
|
||
import hexagonal.core.domain.jpa.RoomJpaEntity; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class CreateRoomCommand { | ||
|
||
private final Long companyId; | ||
private final Long adminId; | ||
|
||
public CreateRoomCommand(Long companyId, Long adminId) { | ||
this.companyId = companyId; | ||
this.adminId = adminId; | ||
} | ||
|
||
public RoomJpaEntity toJpaEntity() { | ||
return RoomJpaEntity.builder() | ||
.id(null) | ||
.companyId(companyId) | ||
.adminId(adminId) | ||
.build(); | ||
} | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
api/src/main/java/hexagonal/api/room/application/port/in/CreateRoomUseCase.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 hexagonal.api.room.application.port.in; | ||
|
||
public interface CreateRoomUseCase { | ||
Long createRoom(CreateRoomCommand command); | ||
} |