-
Notifications
You must be signed in to change notification settings - Fork 2
[FEAT/#40] 방 생성 작업 2 진행중... #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 15 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
fbb8809
chore/#40 :: 불필요한 주석 제거
youn9k 689bd16
Merge branch 'feat/#40-create-room' into feat/#40-create-room-2
youn9k dff1bad
feat/#40 :: 인코딩, 디코딩에 필요한 모델 구현
Kiyoung-Kim-57 7b667f7
chore/#40 :: 불필요한 주석 제거
Kiyoung-Kim-57 3b2c3af
refactor/#40 :: Room, RoomManager를 Struct -> Class 전환
Kiyoung-Kim-57 31e8f3c
feat/#40 :: 테스트용 라우트 코드 작성
Kiyoung-Kim-57 fec092f
feat/#40 :: Request의 타입을 디코딩 할 수 있는 구조체 구현
Kiyoung-Kim-57 99beada
style/#40 :: SignalingRequestDTO, RoomRequestDTO 생성자 수정
Kiyoung-Kim-57 527eba8
feat/#40 :: SDP, Candidate를 SignalingRequestDTO로 래핑해서 전달
Kiyoung-Kim-57 cde62d6
chore/#40 :: 불필요한 의존성 제거
youn9k 91ec65e
feat/#40 :: SendOfferUseCase 구현
youn9k 65d12c6
fix/#40 :: 전송할 데이터가 잘못 지정된 문제 수정
youn9k 0a84adb
style/#40 :: 코드 가독성 향상
youn9k 5dbff7d
fix/#40 :: 접근제어자 수정
youn9k 2a68012
feat/#40 :: Local, Remote Video 가져오는 UseCase 생성
Kiyoung-Kim-57 bd471de
feat/#40 :: SendOfferUseCase WaitingRoomViewModel에 적용
Kiyoung-Kim-57 e50af8e
refactor/#40 :: SendOfferUseCase 생성자 접근제어자 수정
Kiyoung-Kim-57 ee7beb5
feat/#40 :: WaitingRoomFeatureDemo의 SceneDelegate 수정
Kiyoung-Kim-57 67779f0
feat/#40 :: 컬렉션뷰 DiffableDataSource 업데이트 테스트
youn9k 67e8363
fix/#40 :: 디코딩 에러 수정
Kiyoung-Kim-57 14b0772
fix/#40 :: SignalingRequestDTO 생성자에서 할당 안해주던 오류 수정
Kiyoung-Kim-57 3cf8412
fix/#40 :: 서버 에러 수정
Kiyoung-Kim-57 cfca505
fix/#40 :: RoomRequestDTO 생성자 오류 수정
Kiyoung-Kim-57 7a27b0a
fix/#40 :: 서버 DTO 생성자 오류 수정
Kiyoung-Kim-57 ba4a83c
feat/#40 :: local, remote 화면 바인딩
youn9k fc7e04b
feat/#40 :: 1대1 화면 연결 완료
youn9k 512a3a6
feat/#40 :: 비디오 캡쳐 기능 추가
Kiyoung-Kim-57 38d2df7
chore/#40 :: 클래스명 수정
youn9k 30dcc7f
chore/#40 :: 클래스명 수정
youn9k File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
File renamed without changes.
This file contains hidden or 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
This file contains hidden or 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
15 changes: 15 additions & 0 deletions
15
...omainLayer/PhotoGetherDomain/PhotoGetherDomain/UseCaseImpl/GetLocalVideoUseCaseImpl.swift
This file contains hidden or 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,15 @@ | ||
| import Foundation | ||
| import UIKit | ||
| import PhotoGetherDomainInterface | ||
|
|
||
| public final class GetLocalVideoUseCaseImpl: GetLocalVideoUseCase { | ||
| public func execute() -> UIView { | ||
| connectionRepository.clients[0].localVideoView | ||
| } | ||
|
|
||
| private let connectionRepository: ConnectionRepository | ||
|
|
||
| public init(connectionRepository: ConnectionRepository) { | ||
| self.connectionRepository = connectionRepository | ||
| } | ||
| } | ||
15 changes: 15 additions & 0 deletions
15
...mainLayer/PhotoGetherDomain/PhotoGetherDomain/UseCaseImpl/GetRemoteVideoUseCaseImpl.swift
This file contains hidden or 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,15 @@ | ||
| import Foundation | ||
| import UIKit | ||
| import PhotoGetherDomainInterface | ||
|
|
||
| public final class GetRemoteVideoUseCaseImpl: GetRemoteVideoUseCase { | ||
| public func execute() -> [UIView] { | ||
| connectionRepository.clients.map { $0.remoteVideoView } | ||
| } | ||
|
|
||
| private let connectionRepository: ConnectionRepository | ||
|
|
||
| public init(connectionRepository: ConnectionRepository) { | ||
| self.connectionRepository = connectionRepository | ||
| } | ||
| } |
16 changes: 16 additions & 0 deletions
16
...er/DomainLayer/PhotoGetherDomain/PhotoGetherDomain/UseCaseImpl/SendOfferUseCaseImpl.swift
This file contains hidden or 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,16 @@ | ||
| import Foundation | ||
| import PhotoGetherDomainInterface | ||
|
|
||
| public final class SendOfferUseCaseImpl: SendOfferUseCase { | ||
| public func execute() { | ||
| // TODO: 특정 Peer에게만 Offer를 보내도록 수정해야 함 | ||
| guard let client = repository.clients.first else { return } | ||
| client.sendOffer() | ||
| } | ||
|
|
||
| private let repository: ConnectionRepository | ||
|
|
||
| init(repository: ConnectionRepository) { | ||
| self.repository = repository | ||
| } | ||
| } |
6 changes: 6 additions & 0 deletions
6
...mainLayer/PhotoGetherDomain/PhotoGetherDomainInterface/UseCase/GetLocalVideoUseCase.swift
This file contains hidden or 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 @@ | ||
| import Foundation | ||
| import UIKit | ||
|
|
||
| public protocol GetLocalVideoUseCase { | ||
| func execute() -> UIView | ||
| } |
6 changes: 6 additions & 0 deletions
6
...ainLayer/PhotoGetherDomain/PhotoGetherDomainInterface/UseCase/GetRemoteVideoUseCase.swift
This file contains hidden or 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 @@ | ||
| import Foundation | ||
| import UIKit | ||
|
|
||
| public protocol GetRemoteVideoUseCase { | ||
| func execute() -> [UIView] | ||
| } |
5 changes: 5 additions & 0 deletions
5
...r/DomainLayer/PhotoGetherDomain/PhotoGetherDomainInterface/UseCase/SendOfferUseCase.swift
This file contains hidden or 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 @@ | ||
| import Foundation | ||
|
|
||
| public protocol SendOfferUseCase { | ||
| func execute() | ||
| } |
This file contains hidden or 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
This file contains hidden or 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
15 changes: 15 additions & 0 deletions
15
PhotoGetherServer/PhotoGetherServer/Sources/App/DTO/RequestDTO/RoomRequestDTO.swift
This file contains hidden or 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,15 @@ | ||
| import Foundation | ||
|
|
||
| struct RoomRequestDTO: WebSocketRequestable { | ||
| var messageType: RoomMessageType | ||
| var message: Data? | ||
|
|
||
| init(messageType: RoomMessageType, body: Data? = nil) { | ||
| self.messageType = messageType | ||
| } | ||
|
|
||
| enum RoomMessageType: String, Decodable { | ||
| case createRoom | ||
| case joinRoom | ||
| } | ||
| } |
14 changes: 14 additions & 0 deletions
14
PhotoGetherServer/PhotoGetherServer/Sources/App/DTO/RequestDTO/SignalingRequestDTO.swift
This file contains hidden or 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,14 @@ | ||
| import Foundation | ||
|
|
||
| struct SignalingRequestDTO: WebSocketRequestable { | ||
| var messageType: SignalingMessageType | ||
| var message: Data? | ||
|
|
||
| init(messageType: SignalingMessageType = .signaling, body: Data? = nil) { | ||
| self.messageType = messageType | ||
| } | ||
|
|
||
| enum SignalingMessageType: String, Decodable { | ||
| case signaling | ||
| } | ||
| } |
5 changes: 5 additions & 0 deletions
5
PhotoGetherServer/PhotoGetherServer/Sources/App/DTO/RequestDTO/WebSocketRequestType.swift
This file contains hidden or 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 @@ | ||
| import Foundation | ||
|
|
||
| struct WebSocketRequestType: Decodable { | ||
| let type: String | ||
| } |
11 changes: 11 additions & 0 deletions
11
PhotoGetherServer/PhotoGetherServer/Sources/App/DTO/ResponseDTO/RoomResponseDTO.swift
This file contains hidden or 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,11 @@ | ||
| import Foundation | ||
|
|
||
| struct RoomResponseDTO: WebSocketRequestable { | ||
| var messageType: RoomMessageType | ||
| var message: Data? | ||
|
|
||
| enum RoomMessageType: String, Decodable { | ||
| case createRoom | ||
| case joinRoom | ||
| } | ||
| } |
8 changes: 3 additions & 5 deletions
8
PhotoGetherServer/PhotoGetherServer/Sources/App/Model/Room.swift
This file contains hidden or 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 |
|---|---|---|
| @@ -1,25 +1,23 @@ | ||
| struct Room { | ||
| final class Room { | ||
| private var users: [User] = [] | ||
| private var maxCount: Int = 4 | ||
| let roomID: String | ||
|
|
||
|
|
||
| init(roomID: String) { | ||
| self.roomID = roomID | ||
| } | ||
|
|
||
| @discardableResult | ||
| mutating func invite(user: User) -> Bool { | ||
| func invite(user: User) -> Bool { | ||
| guard users.count < maxCount else { return false } | ||
| users.append(user) | ||
| return true | ||
| } | ||
|
|
||
| @discardableResult | ||
| mutating func kick(userID: String) -> Bool { | ||
| func kick(userID: String) -> Bool { | ||
| let filtered = users.filter { $0.id != userID } | ||
| users = filtered | ||
| return filtered.isEmpty // 필터에 걸렸으면 찾은 것 | ||
| } | ||
|
|
||
| } |
This file contains hidden or 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
7 changes: 7 additions & 0 deletions
7
PhotoGetherServer/PhotoGetherServer/Sources/App/Model/WebSocketRequestable.swift
This file contains hidden or 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 @@ | ||
| import Foundation | ||
|
|
||
| public protocol WebSocketRequestable: Decodable { | ||
| associatedtype ResponseType: Decodable | ||
| var messageType: ResponseType { get } | ||
| var message: Data? { get } | ||
| } |
15 changes: 15 additions & 0 deletions
15
PhotoGetherServer/PhotoGetherServer/Sources/App/Model/WebSocketResponsable.swift
This file contains hidden or 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,15 @@ | ||
| import Foundation | ||
|
|
||
| public protocol WebSocketResponsable: Encodable { | ||
| associatedtype RequestType: Encodable | ||
| var messageType: RequestType { get } | ||
| var message: Data? { get } | ||
|
|
||
| func toData(encoder: JSONEncoder) -> Data? | ||
| } | ||
|
|
||
| public extension WebSocketResponsable { | ||
| func toData(encoder: JSONEncoder) -> Data? { | ||
| return try? encoder.encode(self) | ||
| } | ||
| } |
4 changes: 0 additions & 4 deletions
4
PhotoGetherServer/PhotoGetherServer/Sources/App/configure.swift
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
추후 Repository에서 하나의 localVideoView만 들고있도록 할 예정입니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
추후 Client 프로퍼티에서 host/guest 여부와 닉네임을 알 수 있도록 하면 좋을 것 같습니다!