fix: 빌드 에러 수정 - 중복 코드 제거

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
sanjeok77
2026-03-11 22:10:26 +09:00
parent 37f8d92352
commit 00bdec3ca7
3 changed files with 38 additions and 91 deletions

View File

@@ -16,19 +16,6 @@ import com.hotdeal.alarm.domain.model.HotDeal
]
)
data class HotDealEntity(
@PrimaryKey
val id: String,
val siteName: String,
val boardName: String,
val title: String,
val url: String,
val mallUrl: String?,
val createdAt: Long,
val isNotified: Boolean = false,
val isKeywordMatch: Boolean = false,
val isFavorite: Boolean = false, // 즐겨찾기 여부
val isPopular: Boolean = false // 인기/핫 게시물 여부
) {
@PrimaryKey
val id: String,
val siteName: String,
@@ -36,29 +23,16 @@ data class HotDealEntity(
val title: String,
val url: String,
val mallUrl: String?,
val createdAt: Long,
val isNotified: Boolean = false,
val isKeywordMatch: Boolean = false,
val isFavorite: Boolean = false // 즐겨찾기 여부
val createdAt: Long,
val isNotified: Boolean = false,
val isKeywordMatch: Boolean = false,
val isFavorite: Boolean = false, // 즐겨찾기 여부
val isPopular: Boolean = false // 인기/핫 게시물 여부
) {
/**
* Domain 모델로 변환
*/
fun toDomain(): HotDeal {
return HotDeal(
id = id,
siteName = siteName,
boardName = boardName,
title = title,
url = url,
mallUrl = mallUrl,
createdAt = createdAt,
isNotified = isNotified,
isKeywordMatch = isKeywordMatch,
isFavorite = isFavorite,
isPopular = isPopular
)
}
fun toDomain(): HotDeal {
return HotDeal(
id = id,
siteName = siteName,
@@ -67,9 +41,10 @@ data class HotDealEntity(
url = url,
mallUrl = mallUrl,
createdAt = createdAt,
isNotified = isNotified,
isKeywordMatch = isKeywordMatch,
isFavorite = isFavorite
isNotified = isNotified,
isKeywordMatch = isKeywordMatch,
isFavorite = isFavorite,
isPopular = isPopular
)
}
@@ -77,21 +52,7 @@ data class HotDealEntity(
/**
* Domain 모델에서 Entity 생성
*/
fun fromDomain(domain: HotDeal): HotDealEntity {
return HotDealEntity(
id = domain.id,
siteName = domain.siteName,
boardName = domain.boardName,
title = domain.title,
url = domain.url,
mallUrl = domain.mallUrl,
createdAt = domain.createdAt,
isNotified = domain.isNotified,
isKeywordMatch = domain.isKeywordMatch,
isFavorite = domain.isFavorite,
isPopular = domain.isPopular
)
}
fun fromDomain(domain: HotDeal): HotDealEntity {
return HotDealEntity(
id = domain.id,
siteName = domain.siteName,
@@ -100,9 +61,10 @@ data class HotDealEntity(
url = domain.url,
mallUrl = domain.mallUrl,
createdAt = domain.createdAt,
isNotified = domain.isNotified,
isKeywordMatch = domain.isKeywordMatch,
isFavorite = domain.isFavorite
isNotified = domain.isNotified,
isKeywordMatch = domain.isKeywordMatch,
isFavorite = domain.isFavorite,
isPopular = domain.isPopular
)
}
}

View File

@@ -20,7 +20,7 @@ import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object DatabaseModule {
@Provides
@Singleton
fun provideDatabase(
@@ -31,35 +31,31 @@ object DatabaseModule {
AppDatabase::class.java,
AppDatabase.DATABASE_NAME
)
.addMigrations(
AppDatabase.MIGRATION_1_2,
AppDatabase.MIGRATION_2_3,
AppDatabase.MIGRATION_3_4,
AppDatabase.MIGRATION_4_5
)
AppDatabase.MIGRATION_1_2,
AppDatabase.MIGRATION_2_3,
AppDatabase.MIGRATION_3_4
)
.addMigrations(
AppDatabase.MIGRATION_1_2,
AppDatabase.MIGRATION_2_3,
AppDatabase.MIGRATION_3_4,
AppDatabase.MIGRATION_4_5
)
.fallbackToDestructiveMigration()
.build()
}
@Provides
fun provideHotDealDao(database: AppDatabase): HotDealDao {
return database.hotDealDao()
}
@Provides
fun provideSiteConfigDao(database: AppDatabase): SiteConfigDao {
return database.siteConfigDao()
}
@Provides
fun provideKeywordDao(database: AppDatabase): KeywordDao {
return database.keywordDao()
}
@Provides
@Singleton
fun provideAppSettings(

View File

@@ -4,35 +4,24 @@ package com.hotdeal.alarm.domain.model
* 핫딜 도메인 모델
*/
data class HotDeal(
val id: String, // siteName + "_" + postId
val siteName: String, // ppomppu, clien, ruriweb, coolenjoy, quasarzone
val boardName: String, // ppomppu, ppomppu4, allsell, jirum, etc.
val title: String, // 게시글 제목
val url: String, // 게시글 URL
val mallUrl: String? = null, // 쇼핑몰 URL (추출된 경우)
val createdAt: Long, // 수집 시간 (timestamp)
val isNotified: Boolean = false,
val isKeywordMatch: Boolean = false,
val isFavorite: Boolean = false, // 즐겨찾기 여부
val isPopular: Boolean = false // 인기/핫 게시물 여부
) {
val id: String, // siteName + "_" + postId
val siteName: String, // ppomppu, clien, ruriweb, coolenjoy, quasarzone
val boardName: String, // ppomppu, ppomppu4, allsell, jirum, etc.
val title: String, // 게시글 제목
val url: String, // 게시글 URL
val id: String, // siteName + "_" + postId
val siteName: String, // ppomppu, clien, ruriweb, coolenjoy, quasarzone
val boardName: String, // ppomppu, ppomppu4, allsell, jirum, etc.
val title: String, // 게시글 제목
val url: String, // 게시글 URL
val mallUrl: String? = null, // 쇼핑몰 URL (추출된 경우)
val createdAt: Long, // 수집 시간 (timestamp)
val isNotified: Boolean = false,
val isKeywordMatch: Boolean = false,
val isFavorite: Boolean = false // 즐겨찾기 여부
val createdAt: Long, // 수집 시간 (timestamp)
val isNotified: Boolean = false,
val isKeywordMatch: Boolean = false,
val isFavorite: Boolean = false, // 즐겨찾기 여부
val isPopular: Boolean = false // 인기/핫 게시물 여부
) {
/**
* 사이트 타입 반환
*/
val siteType: SiteType?
get() = SiteType.fromName(siteName)
/**
* 게시판 표시 이름 반환 (ppomppu8 → 알리뽐뿌)
*/
@@ -41,7 +30,7 @@ data class HotDeal(
val site = siteType ?: return boardName
return site.boards.find { it.id == boardName }?.displayName ?: boardName
}
/**
* 사이트 표시 이름 + 게시판 표시 이름 (예: 뽐뿌 - 알리뽐뿌)
*/