Skip to content

Conversation

@kimjeakwan
Copy link
Collaborator

@kimjeakwan kimjeakwan commented Feb 20, 2025

πŸ’‘ κ°œμš”

Notice μ„œλ²„ν†΅μ‹ μ„ μœ„ν•œ μ„ΈνŒ…μ„ ν–ˆμŠ΅λ‹ˆλ‹€

πŸ“ƒ μž‘μ—…λ‚΄μš©

Notice μ„œλ²„ν†΅μ‹ μ„ μœ„ν•œ μ„ΈνŒ…μ„ ν–ˆμŠ΅λ‹ˆλ‹€

πŸ”€ 변경사항

Notice μ„œλ²„ν†΅μ‹ μ„ μœ„ν•œ DatasourceIpml, Datasource, Repository, RespositoryImpl 을 μΆ”κ°€ν–ˆμŠ΅λ‹ˆλ‹€.

πŸ™‹β€β™‚οΈ μ§ˆλ¬Έμ‚¬ν•­

  • κ°œμ„ ν•  점, μ˜€νƒ€, μ½”λ“œμ— μ΄μ‚°ν•œ 뢀뢄이 μžˆλ‹€λ©΄ Comment λ‹¬μ•„μ£Όμ„Έμš”.

🍴 μ‚¬μš©λ°©λ²•

🎸 기타

Summary by CodeRabbit

  • μƒˆλ‘œμš΄ κΈ°λŠ₯
    • μ„œλ²„μ—μ„œ μ΅œμ‹  곡지사항 데이터λ₯Ό λΉ„λ™κΈ°μ μœΌλ‘œ λΆˆλŸ¬μ™€ 관리할 수 있게 λ˜μ—ˆμŠ΅λ‹ˆλ‹€.
    • 곡지사항 데이터λ₯Ό μ²˜λ¦¬ν•˜λŠ” μ „λ°˜μ μΈ κΈ°λŠ₯(데이터 μ†ŒμŠ€, 리포지토리, μ‚¬μš© 사둀)이 ν™•μž₯λ˜μ—ˆμŠ΅λ‹ˆλ‹€.
    • 곡지사항 λ¦¬μŠ€νŠΈμ™€ 상세 정보λ₯Ό κΉ”λ”ν•˜κ²Œ ν‘œμ‹œν•˜λŠ” μƒˆλ‘œμš΄ UI μ»΄ν¬λ„ŒνŠΈμ™€ 화면이 λ„μž…λ˜μ—ˆμŠ΅λ‹ˆλ‹€.
    • μ•± λ„€λΉ„κ²Œμ΄μ…˜μ— 곡지사항 화면이 μΆ”κ°€λ˜μ–΄ μ†μ‰½κ²Œ μ ‘κ·Όν•  수 μžˆμŠ΅λ‹ˆλ‹€.

@coderabbitai
Copy link

coderabbitai bot commented Feb 20, 2025

Walkthrough

이번 PR은 곡지사항 κΈ°λŠ₯을 μ „λ©΄ λ„μž…ν•©λ‹ˆλ‹€. μ˜μ‘΄μ„± μ£Όμž… λͺ¨λ“ˆμ— NoticeAPI, NoticeDatasource, NoticeRepository 제곡 λ©”μ„œλ“œλ₯Ό μΆ”κ°€ν•˜κ³ , λ„€νŠΈμ›Œν¬, 데이터, 도메인 및 ν”„λ ˆμ  ν…Œμ΄μ…˜ 계측 μ „λ°˜μ— 걸쳐 곡지사항 쑰회 둜직과 UI 컴포저블, λ„€λΉ„κ²Œμ΄μ…˜, ViewModel μƒνƒœ 관리 κΈ°λŠ₯이 ν™•μž₯λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

Changes

File(s) Summary of Changes
app/src/main/java/module/NetworkModule.kt, app/src/main/java/module/RemoteDataSourceModule.kt, app/src/main/java/module/RepositoryModule.kt 곡지사항 κ΄€λ ¨ API, λ°μ΄ν„°μ†ŒμŠ€, 리포지토리 제곡 λ©”μ„œλ“œ μΆ”κ°€
data/src/main/java/remote/api/auth/NoticeAPI.kt, data/src/main/java/remote/datasource/notice/NoticeDataSourceImpl.kt, data/src/main/java/remote/datasource/notice/NoticeDatasource.kt, data/src/main/java/remote/dto/users/response/NoticeResponse.kt NoticeAPI μΈν„°νŽ˜μ΄μŠ€, λ°μ΄ν„°μ†ŒμŠ€ κ΅¬ν˜„ 및 DTO ν΄λž˜μŠ€μ™€ ν™•μž₯ ν•¨μˆ˜ μΆ”κ°€
repoistory/NoticeRepositoryImpl.kt, domain/src/main/java/reopoistory/NoticeRepository.kt, domain/src/main/java/usecase/notice/GetNoticeUseCase.kt, domain/src/main/java/model/users/response/NoticeResponseModel.kt 곡지사항 리포지토리 κ΅¬ν˜„, NoticeRepository μΈν„°νŽ˜μ΄μŠ€, UseCase 및 λͺ¨λΈ 클래슀 μΆ”κ°€
presentation/src/main/java/view/notice/component/NoticeCard.kt, presentation/src/main/java/view/notice/navgation/NoticeNavigation.kt, presentation/src/main/java/view/notice/screen/NoticeScreen.kt, presentation/src/main/java/viewModel/homes/HomesViewmodel.kt, presentation/src/main/java/viewModel/homes/uistate/NoticeUiState.kt 곡지사항 UI 컴포저블, λ„€λΉ„κ²Œμ΄μ…˜, ν™”λ©΄ ꡬ성 및 HomesViewModel에 곡지사항 μƒνƒœ 관리 κΈ°λŠ₯ μΆ”κ°€

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant NoticeScreen
    participant HomesViewModel
    participant GetNoticeUseCase
    participant NoticeRepository
    participant NoticeDatasource
    participant NoticeAPI

    User->>NoticeScreen: 곡지사항 μš”μ²­ (noticeId 전달)
    NoticeScreen->>HomesViewModel: getNotice(noticeId) 호좜
    HomesViewModel->>GetNoticeUseCase: Invoke(noticeId)
    GetNoticeUseCase->>NoticeRepository: getNotice(noticeId) 호좜
    NoticeRepository->>NoticeDatasource: getNotice(noticeId) 호좜
    NoticeDatasource->>NoticeAPI: getNotice(noticeId) 호좜
    NoticeAPI-->>NoticeDatasource: NoticeResponse 리슀트 λ°˜ν™˜
    NoticeDatasource-->>NoticeRepository: Flow<List<NoticeResponseModel>> λ°˜ν™˜
    NoticeRepository-->>GetNoticeUseCase: Flow<List<NoticeResponseModel>> 전달
    GetNoticeUseCase-->>HomesViewModel: Flow<List<NoticeResponseModel>> 전달
    HomesViewModel-->>NoticeScreen: NoticeUiState μ—…λ°μ΄νŠΈ (Success/Fail)
    NoticeScreen->>User: UI에 곡지사항 λ Œλ”λ§
Loading

Possibly related PRs

Suggested labels

✨ Feature, 1️⃣ Priority: High

Suggested reviewers

  • xx-lvr

Poem

토끼 ν•œ 마리, μ½”λ“œλ₯Ό λ›°μ–΄λ„˜μ–΄
μ„€λ ˆλŠ” λ³€ν™”, 곡지사전 열리넀
API와 UIκ°€ ν•˜λͺ¨λ‹ˆλ₯Ό 이루며
λ°μ΄ν„°μ˜ 흐름 따라 좀을 μΆ”λ„€
ν–‰λ³΅ν•œ μ½”λ“œ 숲 속을 기쁘게 λ‹¬λ €κ°€μš”!
🐰 깑총깑총, μƒˆλ‘œμš΄ κΈ°λŠ₯ ν™˜μ˜ν•΄μš”!


πŸ“œ Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between d7f3ca7 and aecf56f.

πŸ“’ Files selected for processing (3)
  • app/src/main/java/module/NetworkModule.kt (2 hunks)
  • app/src/main/java/module/RemoteDataSourceModule.kt (2 hunks)
  • app/src/main/java/module/RepositoryModule.kt (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • app/src/main/java/module/RepositoryModule.kt
  • app/src/main/java/module/RemoteDataSourceModule.kt
  • app/src/main/java/module/NetworkModule.kt
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❀️ Share
πŸͺ§ Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

πŸ”­ Outside diff range comments (1)
app/src/main/java/module/NetworkModule.kt (1)

73-73: πŸ› οΈ Refactor suggestion

ν•˜λ“œμ½”λ”©λœ baseUrl을 μ„€μ • 파일둜 μ΄λ™ν•˜μ„Έμš”.

"exple Base url"κ³Ό 같은 ν•˜λ“œμ½”λ”©λœ 값은 μœ μ§€λ³΄μˆ˜μ™€ ν™˜κ²½ μ„€μ • 변경을 μ–΄λ ΅κ²Œ λ§Œλ“­λ‹ˆλ‹€. BuildConfigλ‚˜ μ„€μ • 파일둜 μ΄λ™ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€.

-            .baseUrl("exple Base url")
+            .baseUrl(BuildConfig.BASE_URL)
🧹 Nitpick comments (9)
domain/src/main/java/model/users/response/NoticeResponseModel.kt (1)

3-8: λ¬Έμ„œν™” μΆ”κ°€ μ œμ•ˆ

데이터 클래슀의 λͺ©μ κ³Ό 각 ν•„λ“œμ˜ 역할을 λͺ…ν™•νžˆ ν•˜κΈ° μœ„ν•΄ KDoc λ¬Έμ„œν™”λ₯Ό μΆ”κ°€ν•˜λŠ” 것이 μ’‹κ² μŠ΅λ‹ˆλ‹€.

+/**
+ * 곡지사항 응닡을 μœ„ν•œ 도메인 λͺ¨λΈ
+ *
+ * @property noticeId 곡지사항 고유 μ‹λ³„μž
+ * @property title 곡지사항 제λͺ©
+ * @property content 곡지사항 λ‚΄μš©
+ * @property name μž‘μ„±μž 이름
+ */
data class NoticeResponseModel (
     val noticeId: Int,
     val title: String,
     val content: String,
     val name: String,
)
data/src/main/java/remote/datasource/notice/NoticeDatasource.kt (1)

7-9: μΈν„°νŽ˜μ΄μŠ€ λ¬Έμ„œν™” μΆ”κ°€ μ œμ•ˆ

μΈν„°νŽ˜μ΄μŠ€μ™€ λ©”μ„œλ“œμ˜ 역할을 λͺ…ν™•νžˆ ν•˜κΈ° μœ„ν•΄ KDoc λ¬Έμ„œν™”λ₯Ό μΆ”κ°€ν•˜λŠ” 것이 μ’‹κ² μŠ΅λ‹ˆλ‹€.

+/**
+ * 곡지사항 데이터 μ†ŒμŠ€ μΈν„°νŽ˜μ΄μŠ€
+ */
interface NoticeDatasource {
+    /**
+     * νŠΉμ • 곡지사항 ID에 ν•΄λ‹Ήν•˜λŠ” 곡지사항 λͺ©λ‘μ„ μ‘°νšŒν•©λ‹ˆλ‹€.
+     *
+     * @param noticeId μ‘°νšŒν•  곡지사항 ID
+     * @return 곡지사항 응닡 λͺ©λ‘μ„ ν¬ν•¨ν•˜λŠ” Flow
+     */
    fun getNotice(noticeId: UUID): Flow<List<NoticeResponse>>
}
domain/src/main/java/usecase/notice/GetNoticeUseCase.kt (1)

4-4: μ‚¬μš©ν•˜μ§€ μ•ŠλŠ” import 문을 μ œκ±°ν•΄μ£Όμ„Έμš”.

RankResponseModel은 ν˜„μž¬ μ½”λ“œμ—μ„œ μ‚¬μš©λ˜μ§€ μ•Šκ³  μžˆμŠ΅λ‹ˆλ‹€.

-import model.rank.response.RankResponseModel
data/src/main/java/remote/datasource/notice/NoticeDataSourceImpl.kt (1)

14-16: μ—λŸ¬ μ²˜λ¦¬μ— λŒ€ν•œ λ¬Έμ„œν™”κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

performApiRequest μœ ν‹Έλ¦¬ν‹°λ₯Ό μ‚¬μš©ν•œ κ΅¬ν˜„μ€ μ’‹μŠ΅λ‹ˆλ‹€. ν•˜μ§€λ§Œ λ°œμƒ κ°€λŠ₯ν•œ μ˜ˆμ™Έ 상황과 처리 방법에 λŒ€ν•œ λ¬Έμ„œν™”λ₯Ό μΆ”κ°€ν•˜λ©΄ 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같이 KDoc을 μΆ”κ°€ν•΄μ£Όμ„Έμš”:

+    /**
+     * 곡지사항을 μ‘°νšŒν•©λ‹ˆλ‹€.
+     * @param noticeId μ‘°νšŒν•  κ³΅μ§€μ‚¬ν•­μ˜ ID
+     * @return 곡지사항 λͺ©λ‘
+     * @throws IOException λ„€νŠΈμ›Œν¬ 였λ₯˜ λ°œμƒ μ‹œ
+     * @throws HttpException API 호좜 μ‹€νŒ¨ μ‹œ
+     */
     override fun getNotice(noticeId: UUID): Flow<List<NoticeResponse>> =
data/src/main/java/repoistory/NoticeRepositoryImpl.kt (1)

16-18: 가독성 ν–₯상을 μœ„ν•œ μ½”λ“œ ν¬λ§·νŒ…μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

map μ—°μ‚°μž 체인이 ν•œ 쀄에 μžˆμ–΄ 가독성이 λ–¨μ–΄μ§‘λ‹ˆλ‹€. μ—¬λŸ¬ μ€„λ‘œ λ‚˜λˆ„μ–΄ μž‘μ„±ν•˜λŠ” 것이 μ’‹κ² μŠ΅λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같이 κ°œμ„ ν•΄λ³΄μ„Έμš”:

-    override fun getNotice(noticeId: UUID): Flow<List<NoticeResponseModel>> {
-        return noticeDatasource.getNotice(noticeId = noticeId).map {list -> list.map { it.toModel() }  }
-    }
+    override fun getNotice(noticeId: UUID): Flow<List<NoticeResponseModel>> {
+        return noticeDatasource.getNotice(noticeId = noticeId)
+            .map { list -> 
+                list.map { it.toModel() }
+            }
+    }
app/src/main/java/module/RemoteDataSourceModule.kt (1)

31-34: μ½”λ“œ μŠ€νƒ€μΌ κ°œμ„ μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

λ°˜ν™˜ νƒ€μž… μ„ μ–Έ 뢀뢄에 콜둠 μ•žμ˜ 곡백이 λˆ„λ½λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같이 μˆ˜μ •ν•΄μ£Όμ„Έμš”:

-    ):NoticeDatasource
+    ): NoticeDatasource
presentation/src/main/java/view/notice/component/NoticeCard.kt (1)

96-102: 제λͺ©μ—λ„ ν…μŠ€νŠΈ μ˜€λ²„ν”Œλ‘œμš° 처리λ₯Ό μΆ”κ°€ν•˜μ„Έμš”.

κΈ΄ 제λͺ©μ΄ UIλ₯Ό λ²—μ–΄λ‚˜λŠ” 것을 λ°©μ§€ν•˜κΈ° μœ„ν•΄ 제λͺ© ν…μŠ€νŠΈμ—λ„ μ˜€λ²„ν”Œλ‘œμš° μ²˜λ¦¬κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

             Text(
                 text = data.title,
                 color = colors.WHITE,
                 fontFamily = typography.bodySmall.fontFamily,
                 fontWeight = FontWeight.Bold,
-                fontSize = 14.sp
+                fontSize = 14.sp,
+                maxLines = 1,
+                overflow = TextOverflow.Ellipsis
             )
presentation/src/main/java/view/notice/screen/NoticeScreen.kt (2)

73-73: ν•˜λ“œμ½”λ”©λœ 색상 값을 ν…Œλ§ˆλ‘œ μ΄λ™ν•˜μ„Έμš”.

Color(0xFF1E1E1E)와 같은 ν•˜λ“œμ½”λ”©λœ 색상 값은 ν…Œλ§ˆ μ‹œμŠ€ν…œμ„ 톡해 κ΄€λ¦¬λ˜μ–΄μ•Ό ν•©λ‹ˆλ‹€.

-                .background(color = Color(0xFF1E1E1E))
+                .background(color = colors.background)

109-118: 미리보기에 더 λ‹€μ–‘ν•œ μƒνƒœλ₯Ό μΆ”κ°€ν•˜μ„Έμš”.

ν˜„μž¬λŠ” Loading μƒνƒœλ§Œ 미리보기할 수 μžˆμŠ΅λ‹ˆλ‹€. Success, Empty, Fail μƒνƒœλ„ 미리보기에 μΆ”κ°€ν•˜λ©΄ μ’‹κ² μŠ΅λ‹ˆλ‹€.

 @Preview
 @Composable
 fun NoticeScreenPreview() {
+    Column {
+        // Loading μƒνƒœ
+        NoticeScreen(
+            noticeUiState = NoticeUiState.Loading,
+            onErrorToast = { _, _ -> },
+            navigateToBack = {},
+            noticeCallBack = {},
+        )
+        
+        // Success μƒνƒœ
+        NoticeScreen(
+            noticeUiState = NoticeUiState.Success(
+                listOf(
+                    NoticeResponseModel(
+                        noticeId = UUID.randomUUID(),
+                        title = "ν…ŒμŠ€νŠΈ 곡지사항",
+                        content = "ν…ŒμŠ€νŠΈ λ‚΄μš©μž…λ‹ˆλ‹€."
+                    )
+                )
+            ),
+            onErrorToast = { _, _ -> },
+            navigateToBack = {},
+            noticeCallBack = {},
+        )
+    }
 }
πŸ“œ Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 0a1e29a and d7f3ca7.

πŸ“’ Files selected for processing (16)
  • app/src/main/java/module/NetworkModule.kt (2 hunks)
  • app/src/main/java/module/RemoteDataSourceModule.kt (2 hunks)
  • app/src/main/java/module/RepositoryModule.kt (2 hunks)
  • data/src/main/java/remote/api/auth/NoticeAPI.kt (1 hunks)
  • data/src/main/java/remote/datasource/notice/NoticeDataSourceImpl.kt (1 hunks)
  • data/src/main/java/remote/datasource/notice/NoticeDatasource.kt (1 hunks)
  • data/src/main/java/remote/dto/users/response/NoticeResponse.kt (1 hunks)
  • data/src/main/java/repoistory/NoticeRepositoryImpl.kt (1 hunks)
  • domain/src/main/java/model/users/response/NoticeResponseModel.kt (1 hunks)
  • domain/src/main/java/reopoistory/NoticeRepository.kt (1 hunks)
  • domain/src/main/java/usecase/notice/GetNoticeUseCase.kt (1 hunks)
  • presentation/src/main/java/view/notice/component/NoticeCard.kt (1 hunks)
  • presentation/src/main/java/view/notice/navgation/NoticeNavigation.kt (1 hunks)
  • presentation/src/main/java/view/notice/screen/NoticeScreen.kt (1 hunks)
  • presentation/src/main/java/viewModel/homes/HomesViewmodel.kt (1 hunks)
  • presentation/src/main/java/viewModel/homes/uistate/NoticeUiState.kt (1 hunks)
πŸ”‡ Additional comments (7)
presentation/src/main/java/viewModel/homes/uistate/NoticeUiState.kt (1)

6-11: UI μƒνƒœ 관리가 잘 κ΅¬ν˜„λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€!

sealed interfaceλ₯Ό μ‚¬μš©ν•˜μ—¬ κ³΅μ§€μ‚¬ν•­μ˜ μƒνƒœλ₯Ό λͺ…ν™•ν•˜κ²Œ μ •μ˜ν–ˆμŠ΅λ‹ˆλ‹€. Loading, Empty, Success, Fail μƒνƒœλ₯Ό 톡해 UI의 λ‹€μ–‘ν•œ 상황을 잘 μ²˜λ¦¬ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

domain/src/main/java/usecase/notice/GetNoticeUseCase.kt (1)

10-16: UseCase κ΅¬ν˜„μ΄ κΉ”λ”ν•©λ‹ˆλ‹€!

μ˜μ‘΄μ„± μ£Όμž…κ³Ό Flowλ₯Ό ν™œμš©ν•œ κ΅¬ν˜„μ΄ 잘 λ˜μ–΄μžˆμŠ΅λ‹ˆλ‹€. operator fun invokeλ₯Ό μ‚¬μš©ν•˜μ—¬ UseCase의 ν˜ΈμΆœμ„ κ°„λ‹¨ν•˜κ²Œ λ§Œλ“  점이 μ’‹μŠ΅λ‹ˆλ‹€.

data/src/main/java/remote/dto/users/response/NoticeResponse.kt (1)

15-20: λͺ¨λΈ λ³€ν™˜ κ΅¬ν˜„μ΄ κΉ”λ”ν•©λ‹ˆλ‹€!

ν™•μž₯ ν•¨μˆ˜λ₯Ό μ‚¬μš©ν•˜μ—¬ DTOλ₯Ό 도메인 λͺ¨λΈλ‘œ λ³€ν™˜ν•˜λŠ” κ΅¬ν˜„μ΄ 잘 λ˜μ–΄μžˆμŠ΅λ‹ˆλ‹€.

presentation/src/main/java/view/notice/navgation/NoticeNavigation.kt (1)

1-24: λ„€λΉ„κ²Œμ΄μ…˜ κ΅¬ν˜„μ΄ 잘 λ˜μ–΄μžˆμŠ΅λ‹ˆλ‹€!

λ„€λΉ„κ²Œμ΄μ…˜ 둜직이 κΉ”λ”ν•˜κ²Œ κ΅¬ν˜„λ˜μ–΄ 있으며, μ—λŸ¬ μ²˜λ¦¬μ™€ λ’€λ‘œκ°€κΈ° κΈ°λŠ₯이 μ μ ˆν•˜κ²Œ ν¬ν•¨λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.

app/src/main/java/module/RepositoryModule.kt (1)

31-34: μ˜μ‘΄μ„± μ£Όμž… 섀정이 μ˜¬λ°”λ₯΄κ²Œ λ˜μ–΄μžˆμŠ΅λ‹ˆλ‹€!

NoticeRepository의 바인딩이 κΈ°μ‘΄ νŒ¨ν„΄μ„ 잘 λ”°λ₯΄κ³  있으며, Hilt μ˜μ‘΄μ„± μ£Όμž…μ΄ μ˜¬λ°”λ₯΄κ²Œ κ΅¬ν˜„λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.

app/src/main/java/module/NetworkModule.kt (1)

94-98: NoticeAPI ν”„λ‘œλ°”μ΄λ” κ΅¬ν˜„μ΄ 잘 λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

κΈ°μ‘΄ API ν”„λ‘œλ°”μ΄λ”λ“€κ³Ό μΌκ΄€λœ νŒ¨ν„΄μ„ λ”°λ₯΄κ³  있으며, 싱글톀 μŠ€μ½”ν”„κ°€ μ μ ˆν•˜κ²Œ μ μš©λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

presentation/src/main/java/viewModel/homes/HomesViewmodel.kt (1)

32-33: 곡지사항 μƒνƒœ 관리가 잘 κ΅¬ν˜„λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

κΈ°μ‘΄ μƒνƒœ 관리 νŒ¨ν„΄μ„ μΌκ΄€λ˜κ²Œ λ”°λ₯΄κ³  있으며, StateFlowλ₯Ό μ μ ˆν•˜κ²Œ μ‚¬μš©ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.

@@ -0,0 +1,9 @@
package reopoistory
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

νŒ¨ν‚€μ§€ 이름 μ˜€νƒ€ μˆ˜μ • ν•„μš”

νŒ¨ν‚€μ§€ 이름에 μ˜€νƒ€κ°€ μžˆμŠ΅λ‹ˆλ‹€. 'reopoistory'λ₯Ό 'repository'둜 μˆ˜μ •ν•΄μ•Ό ν•©λ‹ˆλ‹€.

-package reopoistory
+package repository
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
package reopoistory
package repository

Comment on lines +9 to +13
@GET("/{notice_id}")
suspend fun getNotice(
@Path("notice_id") noticeId: UUID,
): List<NoticeResponse>

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

API μ—”λ“œν¬μΈνŠΈ 경둜 μˆ˜μ • 및 λ¬Έμ„œν™” ν•„μš”

  1. GET μš”μ²­μ˜ κΈ°λ³Έ κ²½λ‘œκ°€ λˆ„λ½λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. μ™„μ „ν•œ μ—”λ“œν¬μΈνŠΈ 경둜λ₯Ό μ§€μ •ν•΄μ•Ό ν•©λ‹ˆλ‹€.
  2. API μΈν„°νŽ˜μ΄μŠ€μ™€ λ©”μ„œλ“œμ— λŒ€ν•œ λ¬Έμ„œν™”κ°€ ν•„μš”ν•©λ‹ˆλ‹€.
+/**
+ * 곡지사항 κ΄€λ ¨ API μΈν„°νŽ˜μ΄μŠ€
+ */
interface NoticeAPI {
+    /**
+     * νŠΉμ • 곡지사항을 μ‘°νšŒν•©λ‹ˆλ‹€.
+     *
+     * @param noticeId μ‘°νšŒν•  곡지사항 ID
+     * @return 곡지사항 응닡 λͺ©λ‘
+     */
-    @GET("/{notice_id}")
+    @GET("/api/v1/notices/{notice_id}")
    suspend fun getNotice(
        @Path("notice_id") noticeId: UUID,
    ): List<NoticeResponse>
}
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@GET("/{notice_id}")
suspend fun getNotice(
@Path("notice_id") noticeId: UUID,
): List<NoticeResponse>
/**
* 곡지사항 κ΄€λ ¨ API μΈν„°νŽ˜μ΄μŠ€
*/
interface NoticeAPI {
/**
* νŠΉμ • 곡지사항을 μ‘°νšŒν•©λ‹ˆλ‹€.
*
* @param noticeId μ‘°νšŒν•  곡지사항 ID
* @return 곡지사항 응닡 λͺ©λ‘
*/
@GET("/api/v1/notices/{notice_id}")
suspend fun getNotice(
@Path("notice_id") noticeId: UUID,
): List<NoticeResponse>
}


@JsonClass(generateAdapter = true)
data class NoticeResponse (
@Json(name = "noticeId") val noticeId: Int,
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

noticeId의 νƒ€μž… 일관성 문제

GetNoticeUseCaseμ—μ„œλŠ” UUID νƒ€μž…μ„ μ‚¬μš©ν•˜λŠ”λ° μ—¬κΈ°μ„œλŠ” Int νƒ€μž…μ„ μ‚¬μš©ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. νƒ€μž… 일관성을 μœ„ν•΄ UUID둜 ν†΅μΌν•˜λŠ” 것이 μ’‹κ² μŠ΅λ‹ˆλ‹€.

-    @Json(name = "noticeId") val noticeId: Int,
+    @Json(name = "noticeId") val noticeId: UUID,
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@Json(name = "noticeId") val noticeId: Int,
@Json(name = "noticeId") val noticeId: UUID,

Comment on lines +36 to +55
fun getNotice(noticeId: UUID) = viewModelScope.launch {
getNoticeUseCase(
noticeId = noticeId
)
.asResult()
.collectLatest { result ->
when (result) {
is Result.Loading -> {
_noticeUiState.value = NoticeUiState.Loading
}
is Result.Error -> {
_noticeUiState.value = NoticeUiState.Fail(result.exception)
}
is Result.Success -> {
_noticeUiState.value = NoticeUiState.Success(result.data)
}
}

}
}
Copy link

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

UUID λ§€κ°œλ³€μˆ˜μ— λŒ€ν•œ null μ•ˆμ „μ„±μ„ μΆ”κ°€ν•˜μ„Έμš”.

noticeIdκ°€ null일 수 μžˆλŠ” 상황을 κ³ λ €ν•˜μ—¬ nullable νƒ€μž…μœΌλ‘œ μ„ μ–Έν•˜κ³  μ μ ˆν•œ 처리λ₯Ό μΆ”κ°€ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€.

-    fun getNotice(noticeId: UUID) = viewModelScope.launch {
+    fun getNotice(noticeId: UUID?) = viewModelScope.launch {
+        if (noticeId == null) {
+            _noticeUiState.value = NoticeUiState.Empty
+            return@launch
+        }
         getNoticeUseCase(
             noticeId = noticeId
         )
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
fun getNotice(noticeId: UUID) = viewModelScope.launch {
getNoticeUseCase(
noticeId = noticeId
)
.asResult()
.collectLatest { result ->
when (result) {
is Result.Loading -> {
_noticeUiState.value = NoticeUiState.Loading
}
is Result.Error -> {
_noticeUiState.value = NoticeUiState.Fail(result.exception)
}
is Result.Success -> {
_noticeUiState.value = NoticeUiState.Success(result.data)
}
}
}
}
fun getNotice(noticeId: UUID?) = viewModelScope.launch {
if (noticeId == null) {
_noticeUiState.value = NoticeUiState.Empty
return@launch
}
getNoticeUseCase(
noticeId = noticeId
)
.asResult()
.collectLatest { result ->
when (result) {
is Result.Loading -> {
_noticeUiState.value = NoticeUiState.Loading
}
is Result.Error -> {
_noticeUiState.value = NoticeUiState.Fail(result.exception)
}
is Result.Success -> {
_noticeUiState.value = NoticeUiState.Success(result.data)
}
}
}
}

LazyColumn(
modifier = Modifier
.fillMaxWidth()
.heightIn(max = 10_000.dp)
Copy link

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

LazyColumn의 μ΅œλŒ€ 높이 값을 μ‘°μ •ν•˜μ„Έμš”.

10,000dpλŠ” 맀우 큰 κ°’μž…λ‹ˆλ‹€. ν™”λ©΄ ν¬κΈ°λ‚˜ 컨텐츠에 맞게 μ μ ˆν•œ κ°’μœΌλ‘œ μ‘°μ •ν•˜κ±°λ‚˜, μ œν•œμ„ 두지 μ•ŠλŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€.

-                .heightIn(max = 10_000.dp)
+                .fillMaxHeight()
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.heightIn(max = 10_000.dp)
.fillMaxHeight()

Comment on lines +116 to +120
@Preview
@Composable
fun NoticeCardPreview() {

}
Copy link

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

미리보기 ν•¨μˆ˜λ₯Ό κ΅¬ν˜„ν•˜μ„Έμš”.

λΉ„μ–΄μžˆλŠ” NoticeCardPreview ν•¨μˆ˜μ— μƒ˜ν”Œ 데이터λ₯Ό μΆ”κ°€ν•˜μ—¬ UIλ₯Ό 미리 확인할 수 μžˆλ„λ‘ κ΅¬ν˜„ν•˜μ„Έμš”.

 @Preview
 @Composable
 fun NoticeCardPreview() {
-
+    val sampleData = NoticeResponseModel(
+        noticeId = UUID.randomUUID(),
+        title = "곡지사항 제λͺ©",
+        content = "곡지사항 λ‚΄μš©μž…λ‹ˆλ‹€. 이것은 μƒ˜ν”Œ λ°μ΄ν„°μž…λ‹ˆλ‹€."
+    )
+    NoticeCardItem(data = sampleData)
 }
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@Preview
@Composable
fun NoticeCardPreview() {
}
@Preview
@Composable
fun NoticeCardPreview() {
val sampleData = NoticeResponseModel(
noticeId = UUID.randomUUID(),
title = "곡지사항 제λͺ©",
content = "곡지사항 λ‚΄μš©μž…λ‹ˆλ‹€. 이것은 μƒ˜ν”Œ λ°μ΄ν„°μž…λ‹ˆλ‹€."
)
NoticeCardItem(data = sampleData)
}

Comment on lines +64 to +67
var uuid by remember { mutableStateOf(UUID.randomUUID()) }
LaunchedEffect(Unit) {
noticeCallBack(uuid)
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

μž„μ˜μ˜ UUID μ‚¬μš©μ„ μž¬κ²€ν† ν•˜μ„Έμš”.

초기 곡지사항 λ‘œλ“œμ— UUID.randomUUID()λ₯Ό μ‚¬μš©ν•˜λŠ” 것은 μ˜λ„ν•˜μ§€ μ•Šμ€ λ™μž‘μ„ μœ λ°œν•  수 μžˆμŠ΅λ‹ˆλ‹€. μ‹€μ œ 데이터λ₯Ό κ°€μ Έμ˜€κΈ° μœ„ν•œ μ μ ˆν•œ IDλ₯Ό μ‚¬μš©ν•˜μ„Έμš”.

-    var uuid by remember { mutableStateOf(UUID.randomUUID()) }
+    var uuid by remember { mutableStateOf(DEFAULT_NOTICE_ID) }
     LaunchedEffect(Unit) {
         noticeCallBack(uuid)
     }
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
var uuid by remember { mutableStateOf(UUID.randomUUID()) }
LaunchedEffect(Unit) {
noticeCallBack(uuid)
}
var uuid by remember { mutableStateOf(DEFAULT_NOTICE_ID) }
LaunchedEffect(Unit) {
noticeCallBack(uuid)
}

Copy link
Collaborator

@xx-lvr xx-lvr left a comment

Choose a reason for hiding this comment

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

μˆ˜κ³ ν•˜μ…¨μ–΄μš”.

@kimjeakwan kimjeakwan merged commit 512b3d3 into develop Feb 20, 2025
2 checks passed
@kimjeakwan kimjeakwan deleted the feature/62-get-notice branch February 20, 2025 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants