Skip to content

Commit

Permalink
feat/#95 :: JoinRoom 로직에 필요한 구조체 구현
Browse files Browse the repository at this point in the history
- JoinRoomRequestMessage는 Request를 서버에 전달할 때 담길 메시지입니다
- JoinRoomResponseMessage는 Response로 내려올 메시지입니다
- JoinRoomEntity는 JoinRoomResponseMessage의 Entity입니다

Co-Authored-By: Youngkyu Song <[email protected]>
  • Loading branch information
Kiyoung-Kim-57 and youn9k committed Nov 25, 2024
1 parent 232d506 commit 080cecf
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Foundation

public struct JoinRoomRequestMessage: Encodable {
public let roomID: String
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Foundation
import PhotoGetherDomainInterface

public struct JoinRoomResponseMessage: Decodable {
public let userID: String
public let clientsID: [String]

public init(userID: String, clientsID: [String]) {
self.userID = userID
self.clientsID = clientsID
}

public func toEntity() -> JoinRoomEntity {
JoinRoomEntity(userID: self.userID, clientsID: self.clientsID)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Foundation

public struct JoinRoomEntity {
public let userID: String
public let clientsID: [String]

public init(userID: String, clientsID: [String]) {
self.userID = userID
self.clientsID = clientsID
}
}

0 comments on commit 080cecf

Please sign in to comment.