-
Notifications
You must be signed in to change notification settings - Fork 2
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
[Feature] 사진 오브젝트 전송 로직 수정, Text 오브젝트 수정 기능 추가 #117
Conversation
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.
딩푸루부 ............ 점점 더 오추팀의 로직을 이해하기 어려워지고 있어유 ..
분발하겠습니다 😇😇😇😇😇😇😇😇😇😇😇
@@ -12,4 +12,5 @@ public enum AirplaINDataType: String, Codable { | |||
case drawing | |||
case game | |||
case chat | |||
case jpg |
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.
photo와 jpg의 차이가 무엇인가요 ??
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.
photo는 whiteboardObject이고, jpg는 실제 사진 data에 해당합니다
실제 사진 데이터 case에 어떤 이름을 붙이는게 적절할까요!! 네이밍 도와주세요,,
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.
5f9ff2a 반영 했습니다!
public protocol WhiteboardObjectSetInterface { | ||
func contains(object: WhiteboardObject) async -> Bool | ||
|
||
func insert(object: WhiteboardObject) async | ||
|
||
func remove(object: WhiteboardObject) async | ||
|
||
func update(object: WhiteboardObject) async | ||
|
||
func fetchObjectByID(id: UUID) async -> WhiteboardObject? | ||
} |
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.
얘네 !!! 인터페이스라 ~ 문서주석 필요합니뎅 ~~
그른데 WhiteboardObjectSetInterface
요 녀석은 정확히 무순 용도인가요 ?
ManageWhiteboardObjectUseCase
에서 쓰이던데 WhiteboardObjectSet 관리를 위한 인터페이스지만,
UseCase, Repository 추상체가 아니라 그냥 Interface 폴더에 넣으신건가요 ??
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.
넵 맞습니다!! 폴더링이 애매해서 일단은 Interface 폴더에 넣었습니다.
WhiteboardObject들을 안전하게 꺼내 쓸 수 있는 WhiteboardObjectSet을 추상화한 프로토콜입니다!
WhiteboardObject 수정이 ManageWhiteboardUseCase와 AddTextUseCase 두 군데에서 사용되고 있기 때문에 추상화하였습니다.
추가로 AddTextUseCase의 경우 이름을 바꾸는게 적절해보이네요~
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.
앗 이미 AddTextUseCase가 아니라 지금도 TextObjectUseCase였네요!! 현상유지하는걸로~
주석은 5f9ff2a 요기서 반영 했습니다!
whiteboardRepository: WhiteboardObjectRepositoryInterface, | ||
whiteboardObjectSet: WhiteboardObjectSetInterface |
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.
쏘 복잡 .... ....
whiteboardRepository에서는 NearbyNetworkInterface에 데이터를 전송하는 역할,
whiteboardObjectSet에서는 말 그대로 whiteboardObject Set의 데이터를 관리하는 역할 !! 로 나뉘는 것인가요 ?!?!
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.
넵 맞습니다!!
이건 설계 구현의 문제가 아닐까,, 개선점이 쌓여가고 있습니다!! 타임어택을 눈 앞에 두니 포기하는 부분이 많아지는데요!! 같이 리팩..해주실거죠? |
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.
고생하셨습니다ㅜㅜ
어쩌다보니 오브젝트 추가 및 수정의 90프로를 혼자서 담당하시게 된것같아 죄송합니다ㅜㅜ
하지만 딩동이 맡은 덕분에 빠르게 해결.. 구욷
func save( | ||
dataInfo: DataInformationDTO, | ||
data: Data?, | ||
fileType: String?) -> URL? |
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.
fileType을 언젠가는 enum으로 구분해 주면 좋을 것 같네요..
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.
알고보니~~!! 필요 없어서 다음 PR에서 삭제 될 예정입니다!!
추후 추가 된다면 enum으로 제한하는거 완전 동의합니다!
async let sendJPEGTask: () = sendJPEG( | ||
photoObject: photoObject, | ||
type: .jpg, | ||
isDeleted: isDeleted) | ||
async let sendPhotoObjectTask: () = send( |
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.
async let vs let await
....
학습해봐야겠군요..
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.
TaskGroup에서 자식 task를 생성해서 처리했던 것처럼, async let을 이용하며 parallel하게 여러 비동기 작업을 진행할 수 있습니다!
구조적 동시성을 키워드로 찾아보면 좋을 것 같습니다~!
guard let savedURL = filePersistence.save(dataInfo: info, data: receiveData, fileType: ".jpg") else { return } | ||
|
||
if !info.isDeleted { |
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.
추후에 delete됐다면 로컬 파일을 삭제한다거나,
화이트보드를 나온다면 파일들을 삭제한다는 정책을 정해보면 좋을 것 같네요...
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.
동의 합니다!!! 가능하면 내일 작업해보겠습니다!
@@ -43,4 +43,8 @@ public class TextObject: WhiteboardObject { | |||
try container.encode(text, forKey: .text) | |||
try super.encode(to: encoder) | |||
} | |||
|
|||
func updateText(text: String) { |
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.
스타일적인 부분이라 가볍게 생각해주세요!
저는 func update(text: String) 이런 형식으로 주로 사용합니다!!
텍스트를 업데이트하다 이런 느낌으로!
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.
파라미터에서 text임을 알려주고 있으니까 좋은 방법이라고 생각합니다!
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.
5f9ff2a 반영 했습니다!
🌁 Background
👩💻 Contents
✅ Testing
📝 Review Note