Skip to content

Conversation

@Funital
Copy link
Contributor

@Funital Funital commented Jan 15, 2026

🔗 연결된 이슈

Resolved #43

✨ 주요 작업사항

이번 PR의 핵심 변경사항을 알려주세요!

이 Pull Request는 Home 기능에 대한 대규모 개선과 리팩토링을 도입하며,
데이터 접근의 모듈화, 도메인 모델 확장, 의존성 관리 개선에 중점을 둡니다.

이번 변경을 통해 새로운 Use Case가 추가되었고, Repository 및 Datasource 인터페이스가 확장되었으며,
카테고리 관리, 의류 아이템 조회, 코디 보드 작업, 룩북 연동 등 Home 화면의 추가 기능을 지원하기 위해 데이터 모델이 더욱 풍부해졌습니다.

Domain Model & DTO Extensions:

  • 의류 아이템, 코디 보드, 룩북을 위한 새로운 Entity 및 DTO가 추가되었습니다.
    (HomeClothEntity, ClothListRequestDTO, ClothListResponseDTO,
    CodiCoordinateRequestDTO, LookBookBottomSheetEntity), 또한 데이터 변환을 더 깔끔하게 처리하기 위해 매핑 확장(extension) 이 추가되었습니다.

Repository & Data Source Refactoring:

  • HomeRepository 프로토콜과 구현체가 리팩토링되어 다음 기능들을 지원하도록 확장되었습니다.: 의류 아이템 조회, 데일리 코디 생성, 코디 좌표 저장, 룩북 데이터 조회. Datasource 레이어에는 위 기능들에 대한 비동기(async) Mock 구현이 추가되어 테스트 데이터 기반의 동작을 지원합니다.

Dependency Injection & Use Case Layer:

  • HomeDIContainer가 업데이트되어 다음과 같은 변경이 이루어졌습니다.
    • CategoryUseCase, AddToLookBookUseCase 등 새로운 Use Case 제공.
    • HomeViewModel을 싱글톤으로 관리.
  • ViewModel 생성자는 하나의 거대한 Use Case 대신, 기능별로 분리된 Use Case를 주입받도록 수정되었습니다.

UI Text Improvements:

  • TextLiteral에 사용자에게 보여지는 문자열이 추가 및 수정되어,
    더 명확한 메시지를 제공하고 Home 화면의 신규 기능을 지원합니다.

Code Organization & Comments:

  • 섹션 주석을 개선하고, 메서드 이름을 더 명확하게 변경했으며,
    데이터 접근과 도메인 로직의 관심사를 분리하여 코드 가독성과 유지보수성을 향상시켰습니다.

Most important changes:

1. Domain Model & DTO 확장

  • HomeClothEntity, ClothListRequestDTO, ClothListResponseDTO,
    CodiCoordinateRequestDTO, LookBookBottomSheetEntity 등 새로운 Entity 및 DTO가 도입되었고,
    Home 기능 확장을 지원하기 위한 매핑 extension이 추가되었습니다.

2. Repository & Data Source Refactoring

  • HomeRepository 및 HomeRepositoryImpl에 다음 기능이 추가되었습니다.
    • 의류 아이템 조회
    • 코디 좌표 저장
    • 룩북 데이터 처리
    • 카테고리 관리
  • HomeDatasource에는 위 기능들에 대한 비동기 Mock 구현이 추가되었습니다.

3. Dependency Injection & Use Case Layer

  • HomeDIContainer가 확장되어 새로운 Use Case들을 제공하고,
    HomeViewModel을 싱글톤으로 관리하며,
    ViewModel에 보다 세분화된 의존성 주입이 가능해졌습니다.

4. UI Text Improvements

  • Home 기능 확장을 지원하기 위해 사용자에게 보여지는 문구들이 추가 및 개선되었습니다.

5. Code Organization & Comments

  • Datasource 전반에 걸쳐 섹션 주석, 메서드 명명, 로직 분리가 개선되어
    전반적인 가독성과 유지보수성이 향상되었습니다.

📸 스크린샷 / 동영상

구현한 화면의 크기를 img width="250"로 설정해서 첨부해주세요!

🔍 리뷰어에게 (선택)

코드 리뷰 시 특별히 확인했으면 하는 부분이나, 의견을 묻고 싶은 내용을 적어주세요!

@Funital Funital requested review from Hrepay and taebin2 January 15, 2026 18:37
@Funital Funital self-assigned this Jan 15, 2026
@Funital Funital added the 📃 Feat 사용자를 위한 새로운 기능 추가 또는 개선 label Jan 15, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @Funital, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 Pull Request는 Home 기능에 대한 대규모 개선과 리팩토링을 통해 애플리케이션의 핵심 기능을 강화합니다. 데이터 접근 방식의 모듈화, 도메인 모델의 확장, 그리고 의존성 관리의 효율성 증대에 중점을 두어, 코드의 가독성과 유지보수성을 크게 향상시켰습니다. 새로운 Use Case 패턴을 도입하여 각 기능의 책임이 명확해졌으며, 룩북 추가 바텀시트와 코디 완료 팝업 등 사용자 경험을 개선하는 UI 요소들이 추가되었습니다.

Highlights

  • 도메인 모델 및 DTO 확장: 의류 아이템, 코디 보드, 룩북을 위한 새로운 엔티티 및 DTO가 추가되었으며, 데이터 변환을 위한 매핑 확장 기능이 도입되었습니다.
  • Repository 및 Data Source 리팩토링: HomeRepository 프로토콜과 구현체가 의류 아이템 조회, 데일리 코디 생성, 코디 좌표 저장, 룩북 데이터 조회 등 새로운 기능들을 지원하도록 확장되었고, Datasource 레이어에 비동기 Mock 구현이 추가되었습니다.
  • 의존성 주입 및 Use Case 계층 개선: HomeDIContainer가 업데이트되어 기능별로 분리된 새로운 Use Case(CategoryUseCase, AddToLookBookUseCase 등)를 제공하며, HomeViewModel을 싱글톤으로 관리하고 ViewModel에 세분화된 의존성 주입이 가능해졌습니다.
  • UI 텍스트 개선: 사용자에게 더 명확한 메시지를 제공하고 Home 화면의 신규 기능을 지원하기 위해 TextLiteral에 문자열이 추가 및 수정되었습니다.
  • 코드 구성 및 주석 개선: 섹션 주석, 메서드 명명, 데이터 접근 및 도메인 로직 분리가 개선되어 코드 가독성과 유지보수성이 향상되었습니다.
  • 룩북 추가 바텀시트 및 완료 팝업 구현: 룩북에 코디를 추가할 수 있는 바텀시트와 오늘의 코디 완성 시 나타나는 완료 팝업 UI가 추가되었습니다.
  • 카테고리 카운터 및 코디 의류 뷰 개선: 카테고리 카운터 뷰의 로직이 개선되었고, 코디 의류 뷰는 빈 상태 처리 및 이미지 로딩 방식을 포함하여 대폭 리팩토링되었습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


코드의 숲, 복잡한 길, Use Case로 나누어, 명료해진 길. 각자의 역할, 책임은 분명, 새로운 기능, 이제 꽃 피우네.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이번 PR은 Home 기능에 대한 대규모 리팩토링으로, 하나의 큰 Use Case를 기능별로 분리하여 아키텍처를 크게 개선했습니다. DI 컨테이너를 통해 HomeViewModel을 싱글톤으로 관리하여 관련 뷰 간의 상태를 공유하는 방식도 좋은 접근입니다. 코드 구조가 잘 잡혀있고 관심사 분리가 명확하게 이루어졌습니다. 몇 가지 코드 일관성 개선 및 중복 제거를 위한 제안을 추가했습니다. 전반적으로 훌륭한 작업입니다.

Comment on lines +114 to +152
switch categoryId {
case 1:
mockResponse = [
ClothListResponseDTO(clothId: 101, clothImageUrl: "https://images.unsplash.com/photo-1521572163474-6864f9cf17ab?w=800"),
ClothListResponseDTO(clothId: 102, clothImageUrl: "https://images.unsplash.com/photo-1596755389378-c31d21fd1273?w=800")
]
case 2:
mockResponse = [
ClothListResponseDTO(clothId: 201, clothImageUrl: "https://images.unsplash.com/photo-1541099649105-f69ad21f3246?w=800"),
ClothListResponseDTO(clothId: 202, clothImageUrl: "https://images.unsplash.com/photo-1594633312681-425c7b97ccd1?w=800")
]
case 3:
mockResponse = [
ClothListResponseDTO(clothId: 201, clothImageUrl: "https://images.unsplash.com/photo-1541099649105-f69ad21f3246?w=800"),
ClothListResponseDTO(clothId: 202, clothImageUrl: "https://images.unsplash.com/photo-1594633312681-425c7b97ccd1?w=800")
]
case 4:
mockResponse = [
ClothListResponseDTO(clothId: 201, clothImageUrl: "https://images.unsplash.com/photo-1541099649105-f69ad21f3246?w=800"),
ClothListResponseDTO(clothId: 202, clothImageUrl: "https://images.unsplash.com/photo-1594633312681-425c7b97ccd1?w=800")
]
case 5:
mockResponse = [
ClothListResponseDTO(clothId: 501, clothImageUrl: "https://images.unsplash.com/photo-1542291026-7eec264c27ff?w=800"),
ClothListResponseDTO(clothId: 502, clothImageUrl: "https://images.unsplash.com/photo-1549298916-b41d501d3772?w=800")
]
case 6:
mockResponse = [
ClothListResponseDTO(clothId: 201, clothImageUrl: "https://images.unsplash.com/photo-1541099649105-f69ad21f3246?w=800"),
ClothListResponseDTO(clothId: 202, clothImageUrl: "https://images.unsplash.com/photo-1594633312681-425c7b97ccd1?w=800")
]
case 7:
mockResponse = [
ClothListResponseDTO(clothId: 201, clothImageUrl: "https://images.unsplash.com/photo-1541099649105-f69ad21f3246?w=800"),
ClothListResponseDTO(clothId: 202, clothImageUrl: "https://images.unsplash.com/photo-1594633312681-425c7b97ccd1?w=800")
]
default:
mockResponse = []
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

switch 문에서 case 2, 3, 4, 6, 7의 코드가 중복됩니다. 여러 case를 쉼표로 구분하여 함께 처리하면 코드를 더 간결하게 만들고 유지보수성을 높일 수 있습니다.

        switch categoryId {
        case 1: 
            mockResponse = [
                ClothListResponseDTO(clothId: 101, clothImageUrl: "https://images.unsplash.com/photo-1521572163474-6864f9cf17ab?w=800"),
                ClothListResponseDTO(clothId: 102, clothImageUrl: "https://images.unsplash.com/photo-1596755389378-c31d21fd1273?w=800")
            ]
        case 2, 3, 4, 6, 7:
            mockResponse = [
                ClothListResponseDTO(clothId: 201, clothImageUrl: "https://images.unsplash.com/photo-1541099649105-f69ad21f3246?w=800"),
                ClothListResponseDTO(clothId: 202, clothImageUrl: "https://images.unsplash.com/photo-1594633312681-425c7b97ccd1?w=800")
            ]
        case 5:
            mockResponse = [
                ClothListResponseDTO(clothId: 501, clothImageUrl: "https://images.unsplash.com/photo-1542291026-7eec264c27ff?w=800"),
                ClothListResponseDTO(clothId: 502, clothImageUrl: "https://images.unsplash.com/photo-1549298916-b41d501d3772?w=800")
            ]
        default:
            mockResponse = []
        }

Comment on lines +135 to +142
struct LookBookBottomSheetEntity: Identifiable, Codable {
var id = UUID()
let lookbookId: Int
let codiId: Int
let imageUrl: String
let title: String
let count: Int
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Identifiable 프로토콜을 준수하기 위해 idUUID로 생성하고 있습니다. 하지만 서버에서 받은 lookbookId가 고유 식별자 역할을 한다면, 이를 id로 사용하는 것이 좋습니다. 이렇게 하면 데이터를 다시 불러올 때 SwiftUI가 뷰의 정체성을 안정적으로 유지하여 예기치 않은 UI 문제를 방지할 수 있습니다. id가 Codable의 일부가 아니므로 CodingKeys를 수동으로 구현해야 합니다.

struct LookBookBottomSheetEntity: Identifiable, Codable {
    let lookbookId: Int
    let codiId: Int
    let imageUrl: String
    let title: String
    let count: Int

    var id: Int { lookbookId }

    private enum CodingKeys: String, CodingKey {
        case lookbookId, codiId, imageUrl, title, count
    }
}

let content: String
var locationX: CGFloat
var locationY: CGFloat
var isRightSide: Bool = true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

isRightSide 속성은 HomeViewModel에서 설정되지만, HomeHasCodiView에서 태그 위치를 계산할 때 사용되지 않습니다. 불필요한 속성이므로 제거하는 것이 좋습니다.

let locationX: Double
let locationY: Double
let ratio: Double
let degree: Int

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

CodiPayloaddegree 타입이 Int로 선언되어 있습니다. 코디보드에서 사용하는 DraggableImageEntityrotationAngle과 서버로 보내는 CodiCoordinatePayloadDTOdegree는 모두 Double 타입입니다. 데이터 타입의 일관성을 유지하고 잠재적인 데이터 손실을 방지하기 위해 Double로 변경하는 것이 좋습니다.

    let degree: Double

Comment on lines +175 to +184
// 이미지 위치에 따른 태그 방향 결정 (임계값 200)
let isImageOnRight = item.x > 200
self.selectedItemTags = [
ClothTagEntity(
title: item.brandName,
content: item.clothName,
locationX: 0.5,
locationY: 0.5,
isRightSide: !isImageOnRight
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

isImageOnRight를 결정하기 위해 매직 넘버 200을 사용하고 있습니다. 이는 뷰의 크기가 변경될 때 깨지기 쉬운 구현입니다. 또한, 이 로직으로 설정된 ClothTagEntityisRightSide 속성은 HomeHasCodiView에서 실제 태그 위치를 계산할 때 사용되지 않고 있어 불필요합니다. 뷰에서 직접 위치를 계산하도록 하고, ViewModel과 Entity에서 관련 로직을 제거하는 것이 좋습니다.

            self.selectedItemTags = [
                ClothTagEntity(
                    title: item.brandName,
                    content: item.clothName,
                    locationX: 0.5,
                    locationY: 0.5
                )
            ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📃 Feat 사용자를 위한 새로운 기능 추가 또는 개선

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] Home 2차 구현

2 participants