Skip to content

Commit

Permalink
🔀 :: (#208) 이미지 추가 전으로 롤백
Browse files Browse the repository at this point in the history
🔀 :: (#208) 이미지 추가 전으로 롤백
  • Loading branch information
lyutvs authored Mar 21, 2023
2 parents e981c5d + 58639b7 commit 2db88d5
Show file tree
Hide file tree
Showing 18 changed files with 9 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@ class Category(
val destination: String,

val defaultActivated: Boolean,

val categoryImageUrl: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import java.util.UUID

interface CategoryApi {
fun queryNotificationCategory(defaultActivated: Boolean): CategoryListResponse
fun createCategory(name: String, destination: String, defaultActivated: Boolean, categoryImage: String)
fun createCategory(name: String, destination: String, defaultActivated: Boolean)
fun removeCategory(categoryId: UUID)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ class CategoryElement(
val id: UUID,
val name: String,
val destination: String,
val categoryImage: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,17 @@ class CategoryApiImpl(
override fun queryNotificationCategory(defaultActivated: Boolean): CategoryListResponse {
return CategoryListResponse(
queryCategoryRepositorySpi.findAllByDefaultActivated(defaultActivated)
.map { CategoryElement(it.id, it.name, it.destination, it.categoryImageUrl) }
.map { CategoryElement(it.id, it.name, it.destination) }
.toList()
)
}

override fun createCategory(name: String, destination: String, defaultActivated: Boolean, categoryImage: String) {
override fun createCategory(name: String, destination: String, defaultActivated: Boolean) {
updateCategoryRepositorySpi.saveCategory(
Category(
name = name,
destination = destination,
defaultActivated = defaultActivated,
categoryImageUrl = categoryImage
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class DetailElement(
val sentAt: LocalDateTime,
val isRead: Boolean,
val userId: UUID,
val name: String,
val categoryName: String,
val destination: String,
val categoryImage: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,8 @@ class DetailApiImpl(
sentAt = it.sentAt,
isRead = it.isRead,
userId = it.userId,
name = it.name,
categoryName = it.name,
destination = it.destination,
categoryImage = it.categoryImage
)
}
.toList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ class DetailModel(
val name: String,

val destination: String,

val categoryImage: String,
) {
var isRead: Boolean = isRead
private set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class SettingApiImpl(
id = it.id,
name = it.name,
destination = it.destination,
categoryImage = it.categoryImageUrl
)
}
.toList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class InMemoryDetailRepository(
it.value.userId,
category.name,
category.destination,
category.categoryImageUrl
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ class CategoryImplTest {
val name = "Test name"
val destination = "Test destination"
val defaultActivated = true
val categoryImage = "https://~~"

category.createCategory(
name = name,
destination = destination,
defaultActivated = defaultActivated,
categoryImage = categoryImage,
)

updateCategorySpi.findAllByDefaultActivated(true)
Expand All @@ -45,13 +43,11 @@ class CategoryImplTest {
val name = "Test name"
val destination = "Test destination"
val defaultActivated = false
val categoryImage = "https://~~"

category.createCategory(
name = name,
destination = destination,
defaultActivated = defaultActivated,
categoryImage = categoryImage,
)

Assertions.assertThat(updateCategorySpi.findAllByDefaultActivated(true).size).isEqualTo(0)
Expand All @@ -65,7 +61,6 @@ class CategoryImplTest {
"Test category",
"Test destination",
true,
"https://~~"
)
)
assertThat(category.queryNotificationCategory(true).categories.size)
Expand All @@ -80,7 +75,6 @@ class CategoryImplTest {
"Test category",
"Test destination",
false,
"https://~~"
)
)

Expand All @@ -96,7 +90,6 @@ class CategoryImplTest {
"Test category",
"Test destination",
false,
"https://~~"
)
)
assertThat(category.queryNotificationCategory(false).categories.size)
Expand All @@ -111,7 +104,6 @@ class CategoryImplTest {
"Test category",
"Test destination",
true,
"https://~~"
)
)

Expand All @@ -125,15 +117,13 @@ class CategoryImplTest {
val name = "Test name"
val destination = "Test destination"
val defaultActivated = false
val categoryImage = "https://~~"

updateCategorySpi.saveCategory(
Category(
id = id,
name = name,
destination = destination,
defaultActivated = defaultActivated,
categoryImageUrl = categoryImage,
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class DetailApiImplTest {
"Test category",
"Test destination",
true,
"https://~~"
)
val userId = UUID.randomUUID()

Expand Down Expand Up @@ -60,14 +59,12 @@ class DetailApiImplTest {
val content = "Test Content"
val destination = "/test"
val categoryName = "Test Category"
val categoryImage = "https://~~"

val category = Category(
id = UUID.randomUUID(),
name = categoryName,
destination = destination,
defaultActivated = true,
categoryImageUrl = categoryImage,
)

categorySpi.saveCategory(category)
Expand Down Expand Up @@ -105,7 +102,6 @@ class DetailApiImplTest {
name = categoryName,
destination = destination,
defaultActivated = true,
categoryImageUrl = categoryImage
)

categorySpi.saveCategory(category)
Expand Down Expand Up @@ -134,14 +130,12 @@ class DetailApiImplTest {
val content = "Test Content"
val destination = "/test"
val categoryName = "Test Category"
val categoryImage = "https://~~"

val category = Category(
id = UUID.randomUUID(),
name = categoryName,
destination = destination,
defaultActivated = false,
categoryImageUrl = categoryImage
)

categorySpi.saveCategory(category)
Expand Down Expand Up @@ -180,14 +174,12 @@ class DetailApiImplTest {
val content = "Test Content"
val destination = "/test"
val categoryName = "Test Category"
val categoryImage = "https://~~"

val category = Category(
id = UUID.randomUUID(),
name = categoryName,
destination = destination,
defaultActivated = true,
categoryImageUrl = categoryImage
)

categorySpi.saveCategory(category)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SettingApiImplTest {
val userId = UUID.randomUUID()
val categoryId = UUID.randomUUID()

val category = Category(categoryId, "Test name", "Test destination", false, "https://~~")
val category = Category(categoryId, "Test name", "Test destination", false)

settingSpi.saveCategory(category)

Expand All @@ -45,7 +45,7 @@ class SettingApiImplTest {
val userId = UUID.randomUUID()
val categoryId = UUID.randomUUID()
categorySpi.saveCategory(
Category(categoryId, "Test name", "Test destination", false, "https://~~")
Category(categoryId, "Test name", "Test destination", false)
)
Assertions.assertThat(settingApi.deActivateCategory(categoryId, userId))
.isEqualTo(201)
Expand All @@ -58,7 +58,7 @@ class SettingApiImplTest {
val userId = UUID.randomUUID()
val categoryId = UUID.randomUUID()
categorySpi.saveCategory(
Category(categoryId, "Test name", "Test destination", false, "https://~~")
Category(categoryId, "Test name", "Test destination", false)
)
assertThat(settingApi.activateCategory(categoryId, userId))
.isEqualTo(201)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,4 @@ class CategoryEntity(
@OneToMany(mappedBy = "settingId.categoryEntity", fetch = FetchType.LAZY)
val settingList: List<SettingEntity> = emptyList(),

categoryImageUrl: String,

) : BaseUUIDEntity(id) {

@field:NotNull
var categoryImageUrl = categoryImageUrl
protected set
}
) : BaseUUIDEntity(id)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class CategoryMapperImpl: CategoryMapper {
name = category.name,
destination = category.destination,
defaultActivated = category.defaultActivated,
categoryImageUrl = category.categoryImageUrl
)
}

Expand All @@ -23,7 +22,6 @@ class CategoryMapperImpl: CategoryMapper {
name = categoryEntity.name,
destination = categoryEntity.destination,
defaultActivated = categoryEntity.defaultActivated,
categoryImageUrl = categoryEntity.categoryImageUrl
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class CategoryController(
name = request.name,
destination = request.destination,
defaultActivated = request.defaultActivated,
categoryImage = request.categoryImage
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,4 @@ class CreateCategoryRequest {

var defaultActivated by Delegates.notNull<Boolean>()
private set

@NotNull
lateinit var categoryImage: String
private set
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class CustomDetailRepositoryImpl(
detailEntity.userId,
categoryEntity.name,
categoryEntity.destination,
categoryEntity.categoryImageUrl
)
)
.from(detailEntity)
Expand All @@ -47,7 +46,6 @@ class CustomDetailRepositoryImpl(
userId = it.userId,
name = it.name,
destination = it.destination,
categoryImage = it.categoryImage
)
}
.toList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class DetailVO @QueryProjection constructor(

val destination: String,

val categoryImage: String,
) {
var isRead: Boolean = isRead
private set
Expand Down

0 comments on commit 2db88d5

Please sign in to comment.