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

View File

@@ -31,16 +31,12 @@ object DatabaseModule {
AppDatabase::class.java, AppDatabase::class.java,
AppDatabase.DATABASE_NAME AppDatabase.DATABASE_NAME
) )
.addMigrations( .addMigrations(
AppDatabase.MIGRATION_1_2, AppDatabase.MIGRATION_1_2,
AppDatabase.MIGRATION_2_3, AppDatabase.MIGRATION_2_3,
AppDatabase.MIGRATION_3_4, AppDatabase.MIGRATION_3_4,
AppDatabase.MIGRATION_4_5 AppDatabase.MIGRATION_4_5
) )
AppDatabase.MIGRATION_1_2,
AppDatabase.MIGRATION_2_3,
AppDatabase.MIGRATION_3_4
)
.fallbackToDestructiveMigration() .fallbackToDestructiveMigration()
.build() .build()
} }

View File

@@ -4,28 +4,17 @@ package com.hotdeal.alarm.domain.model
* 핫딜 도메인 모델 * 핫딜 도메인 모델
*/ */
data class HotDeal( data class HotDeal(
val id: String, // siteName + "_" + postId val id: String, // siteName + "_" + postId
val siteName: String, // ppomppu, clien, ruriweb, coolenjoy, quasarzone val siteName: String, // ppomppu, clien, ruriweb, coolenjoy, quasarzone
val boardName: String, // ppomppu, ppomppu4, allsell, jirum, etc. val boardName: String, // ppomppu, ppomppu4, allsell, jirum, etc.
val title: String, // 게시글 제목 val title: String, // 게시글 제목
val url: String, // 게시글 URL 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 mallUrl: String? = null, // 쇼핑몰 URL (추출된 경우) val mallUrl: String? = null, // 쇼핑몰 URL (추출된 경우)
val createdAt: Long, // 수집 시간 (timestamp) val createdAt: Long, // 수집 시간 (timestamp)
val isNotified: Boolean = false, val isNotified: Boolean = false,
val isKeywordMatch: Boolean = false, val isKeywordMatch: Boolean = false,
val isFavorite: Boolean = false // 즐겨찾기 여부 val isFavorite: Boolean = false, // 즐겨찾기 여부
val isPopular: Boolean = false // 인기/핫 게시물 여부
) { ) {
/** /**
* 사이트 타입 반환 * 사이트 타입 반환