From c7a8265b90d841aa06d18481fd22d8357e5a6e2b Mon Sep 17 00:00:00 2001 From: lyutvs Date: Mon, 20 Mar 2023 21:55:56 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20::=20=EB=8B=A4?= =?UTF-8?q?=EC=8B=9C=20=EB=A1=A4=EB=B0=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../github/v1servicenotification/category/Category.kt | 2 -- .../v1servicenotification/category/api/CategoryApi.kt | 2 +- .../category/api/response/CategoryElement.kt | 1 - .../category/service/CategoryApiImpl.kt | 5 ++--- .../detail/api/dto/response/DetailElement.kt | 1 - .../detail/service/DetailApiImpl.kt | 1 - .../detail/spi/dto/DetailModel.kt | 2 -- .../setting/service/SettingApiImpl.kt | 1 - .../stubs/InMemoryDetailRepository.kt | 1 - .../v1servicenotification/category/CategoryImplTest.kt | 10 ---------- .../v1servicenotification/detail/DetailApiImplTest.kt | 8 -------- .../setting/SettingApiImplTest.kt | 6 +++--- .../domain/category/domain/CategoryEntity.kt | 9 +-------- .../domain/category/mapper/CategoryMapperImpl.kt | 2 -- .../domain/category/presentation/CategoryController.kt | 1 - .../presentation/dto/request/CreateCategoryRequest.kt | 4 ---- .../domain/repository/CustomDetailRepositoryImpl.kt | 2 -- .../domain/detail/domain/repository/vo/DetailVO.kt | 1 - 18 files changed, 7 insertions(+), 52 deletions(-) diff --git a/notification-domain/src/main/kotlin/io/github/v1servicenotification/category/Category.kt b/notification-domain/src/main/kotlin/io/github/v1servicenotification/category/Category.kt index 9ee26c5a..6b80768a 100644 --- a/notification-domain/src/main/kotlin/io/github/v1servicenotification/category/Category.kt +++ b/notification-domain/src/main/kotlin/io/github/v1servicenotification/category/Category.kt @@ -12,6 +12,4 @@ class Category( val destination: String, val defaultActivated: Boolean, - - val categoryImageUrl: String, ) diff --git a/notification-domain/src/main/kotlin/io/github/v1servicenotification/category/api/CategoryApi.kt b/notification-domain/src/main/kotlin/io/github/v1servicenotification/category/api/CategoryApi.kt index d988bc51..d4248f69 100644 --- a/notification-domain/src/main/kotlin/io/github/v1servicenotification/category/api/CategoryApi.kt +++ b/notification-domain/src/main/kotlin/io/github/v1servicenotification/category/api/CategoryApi.kt @@ -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) } diff --git a/notification-domain/src/main/kotlin/io/github/v1servicenotification/category/api/response/CategoryElement.kt b/notification-domain/src/main/kotlin/io/github/v1servicenotification/category/api/response/CategoryElement.kt index 73390fb2..fe85c685 100644 --- a/notification-domain/src/main/kotlin/io/github/v1servicenotification/category/api/response/CategoryElement.kt +++ b/notification-domain/src/main/kotlin/io/github/v1servicenotification/category/api/response/CategoryElement.kt @@ -6,5 +6,4 @@ class CategoryElement( val id: UUID, val name: String, val destination: String, - val categoryImage: String, ) diff --git a/notification-domain/src/main/kotlin/io/github/v1servicenotification/category/service/CategoryApiImpl.kt b/notification-domain/src/main/kotlin/io/github/v1servicenotification/category/service/CategoryApiImpl.kt index d0fed27d..54c43e9a 100644 --- a/notification-domain/src/main/kotlin/io/github/v1servicenotification/category/service/CategoryApiImpl.kt +++ b/notification-domain/src/main/kotlin/io/github/v1servicenotification/category/service/CategoryApiImpl.kt @@ -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 ) ) } diff --git a/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/api/dto/response/DetailElement.kt b/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/api/dto/response/DetailElement.kt index 2c4c1a59..f41d35f8 100644 --- a/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/api/dto/response/DetailElement.kt +++ b/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/api/dto/response/DetailElement.kt @@ -12,5 +12,4 @@ class DetailElement( val userId: UUID, val name: String, val destination: String, - val categoryImage: String, ) diff --git a/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/service/DetailApiImpl.kt b/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/service/DetailApiImpl.kt index 42ac0916..fb1261a4 100644 --- a/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/service/DetailApiImpl.kt +++ b/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/service/DetailApiImpl.kt @@ -92,7 +92,6 @@ class DetailApiImpl( userId = it.userId, name = it.name, destination = it.destination, - categoryImage = it.categoryImage ) } .toList() diff --git a/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/spi/dto/DetailModel.kt b/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/spi/dto/DetailModel.kt index 71ce9e07..8daf0bd5 100644 --- a/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/spi/dto/DetailModel.kt +++ b/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/spi/dto/DetailModel.kt @@ -19,8 +19,6 @@ class DetailModel( val name: String, val destination: String, - - val categoryImage: String, ) { var isRead: Boolean = isRead private set diff --git a/notification-domain/src/main/kotlin/io/github/v1servicenotification/setting/service/SettingApiImpl.kt b/notification-domain/src/main/kotlin/io/github/v1servicenotification/setting/service/SettingApiImpl.kt index 977959cd..e8c66535 100644 --- a/notification-domain/src/main/kotlin/io/github/v1servicenotification/setting/service/SettingApiImpl.kt +++ b/notification-domain/src/main/kotlin/io/github/v1servicenotification/setting/service/SettingApiImpl.kt @@ -50,7 +50,6 @@ class SettingApiImpl( id = it.id, name = it.name, destination = it.destination, - categoryImage = it.categoryImageUrl ) } .toList() diff --git a/notification-domain/src/main/kotlin/io/github/v1servicenotification/stubs/InMemoryDetailRepository.kt b/notification-domain/src/main/kotlin/io/github/v1servicenotification/stubs/InMemoryDetailRepository.kt index 2c4b9576..6568fad4 100644 --- a/notification-domain/src/main/kotlin/io/github/v1servicenotification/stubs/InMemoryDetailRepository.kt +++ b/notification-domain/src/main/kotlin/io/github/v1servicenotification/stubs/InMemoryDetailRepository.kt @@ -35,7 +35,6 @@ class InMemoryDetailRepository( it.value.userId, category.name, category.destination, - category.categoryImageUrl ) } } diff --git a/notification-domain/src/test/kotlin/io/github/v1servicenotification/category/CategoryImplTest.kt b/notification-domain/src/test/kotlin/io/github/v1servicenotification/category/CategoryImplTest.kt index bba0a13c..2f83a295 100644 --- a/notification-domain/src/test/kotlin/io/github/v1servicenotification/category/CategoryImplTest.kt +++ b/notification-domain/src/test/kotlin/io/github/v1servicenotification/category/CategoryImplTest.kt @@ -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) @@ -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) @@ -65,7 +61,6 @@ class CategoryImplTest { "Test category", "Test destination", true, - "https://~~" ) ) assertThat(category.queryNotificationCategory(true).categories.size) @@ -80,7 +75,6 @@ class CategoryImplTest { "Test category", "Test destination", false, - "https://~~" ) ) @@ -96,7 +90,6 @@ class CategoryImplTest { "Test category", "Test destination", false, - "https://~~" ) ) assertThat(category.queryNotificationCategory(false).categories.size) @@ -111,7 +104,6 @@ class CategoryImplTest { "Test category", "Test destination", true, - "https://~~" ) ) @@ -125,7 +117,6 @@ class CategoryImplTest { val name = "Test name" val destination = "Test destination" val defaultActivated = false - val categoryImage = "https://~~" updateCategorySpi.saveCategory( Category( @@ -133,7 +124,6 @@ class CategoryImplTest { name = name, destination = destination, defaultActivated = defaultActivated, - categoryImageUrl = categoryImage, ) ) diff --git a/notification-domain/src/test/kotlin/io/github/v1servicenotification/detail/DetailApiImplTest.kt b/notification-domain/src/test/kotlin/io/github/v1servicenotification/detail/DetailApiImplTest.kt index 8737e7a2..9deaeb47 100644 --- a/notification-domain/src/test/kotlin/io/github/v1servicenotification/detail/DetailApiImplTest.kt +++ b/notification-domain/src/test/kotlin/io/github/v1servicenotification/detail/DetailApiImplTest.kt @@ -32,7 +32,6 @@ class DetailApiImplTest { "Test category", "Test destination", true, - "https://~~" ) val userId = UUID.randomUUID() @@ -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) @@ -105,7 +102,6 @@ class DetailApiImplTest { name = categoryName, destination = destination, defaultActivated = true, - categoryImageUrl = categoryImage ) categorySpi.saveCategory(category) @@ -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) @@ -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) diff --git a/notification-domain/src/test/kotlin/io/github/v1servicenotification/setting/SettingApiImplTest.kt b/notification-domain/src/test/kotlin/io/github/v1servicenotification/setting/SettingApiImplTest.kt index 51a64f6e..28181e34 100644 --- a/notification-domain/src/test/kotlin/io/github/v1servicenotification/setting/SettingApiImplTest.kt +++ b/notification-domain/src/test/kotlin/io/github/v1servicenotification/setting/SettingApiImplTest.kt @@ -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) @@ -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) @@ -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) diff --git a/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/category/domain/CategoryEntity.kt b/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/category/domain/CategoryEntity.kt index 79e05e7c..63df33d6 100644 --- a/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/category/domain/CategoryEntity.kt +++ b/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/category/domain/CategoryEntity.kt @@ -30,11 +30,4 @@ class CategoryEntity( @OneToMany(mappedBy = "settingId.categoryEntity", fetch = FetchType.LAZY) val settingList: List = emptyList(), - categoryImageUrl: String, - -) : BaseUUIDEntity(id) { - - @field:NotNull - var categoryImageUrl = categoryImageUrl - protected set -} +) : BaseUUIDEntity(id) diff --git a/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/category/mapper/CategoryMapperImpl.kt b/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/category/mapper/CategoryMapperImpl.kt index 4fc79fda..8fbb3de6 100644 --- a/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/category/mapper/CategoryMapperImpl.kt +++ b/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/category/mapper/CategoryMapperImpl.kt @@ -13,7 +13,6 @@ class CategoryMapperImpl: CategoryMapper { name = category.name, destination = category.destination, defaultActivated = category.defaultActivated, - categoryImageUrl = category.categoryImageUrl ) } @@ -23,7 +22,6 @@ class CategoryMapperImpl: CategoryMapper { name = categoryEntity.name, destination = categoryEntity.destination, defaultActivated = categoryEntity.defaultActivated, - categoryImageUrl = categoryEntity.categoryImageUrl ) } } \ No newline at end of file diff --git a/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/category/presentation/CategoryController.kt b/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/category/presentation/CategoryController.kt index 75458d7d..e5289b48 100644 --- a/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/category/presentation/CategoryController.kt +++ b/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/category/presentation/CategoryController.kt @@ -38,7 +38,6 @@ class CategoryController( name = request.name, destination = request.destination, defaultActivated = request.defaultActivated, - categoryImage = request.categoryImage ) } diff --git a/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/category/presentation/dto/request/CreateCategoryRequest.kt b/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/category/presentation/dto/request/CreateCategoryRequest.kt index 671cf57b..0b98495a 100644 --- a/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/category/presentation/dto/request/CreateCategoryRequest.kt +++ b/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/category/presentation/dto/request/CreateCategoryRequest.kt @@ -15,8 +15,4 @@ class CreateCategoryRequest { var defaultActivated by Delegates.notNull() private set - - @NotNull - lateinit var categoryImage: String - private set } diff --git a/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/detail/domain/repository/CustomDetailRepositoryImpl.kt b/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/detail/domain/repository/CustomDetailRepositoryImpl.kt index be367c54..cd5788c4 100644 --- a/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/detail/domain/repository/CustomDetailRepositoryImpl.kt +++ b/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/detail/domain/repository/CustomDetailRepositoryImpl.kt @@ -30,7 +30,6 @@ class CustomDetailRepositoryImpl( detailEntity.userId, categoryEntity.name, categoryEntity.destination, - categoryEntity.categoryImageUrl ) ) .from(detailEntity) @@ -47,7 +46,6 @@ class CustomDetailRepositoryImpl( userId = it.userId, name = it.name, destination = it.destination, - categoryImage = it.categoryImage ) } .toList() diff --git a/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/detail/domain/repository/vo/DetailVO.kt b/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/detail/domain/repository/vo/DetailVO.kt index fa9a391f..038a452c 100644 --- a/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/detail/domain/repository/vo/DetailVO.kt +++ b/notification-infrastructure/src/main/kotlin/io/github/v1servicenotification/domain/detail/domain/repository/vo/DetailVO.kt @@ -21,7 +21,6 @@ class DetailVO @QueryProjection constructor( val destination: String, - val categoryImage: String, ) { var isRead: Boolean = isRead private set From 58639b739cc0ecad272cf33c48aa7aa07042a92a Mon Sep 17 00:00:00 2001 From: lyutvs Date: Mon, 20 Mar 2023 22:32:17 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20::=20response=EB=AA=85?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detail/api/dto/response/DetailElement.kt | 2 +- .../v1servicenotification/detail/service/DetailApiImpl.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/api/dto/response/DetailElement.kt b/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/api/dto/response/DetailElement.kt index f41d35f8..795bcd14 100644 --- a/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/api/dto/response/DetailElement.kt +++ b/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/api/dto/response/DetailElement.kt @@ -10,6 +10,6 @@ class DetailElement( val sentAt: LocalDateTime, val isRead: Boolean, val userId: UUID, - val name: String, + val categoryName: String, val destination: String, ) diff --git a/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/service/DetailApiImpl.kt b/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/service/DetailApiImpl.kt index fb1261a4..c73a4ffd 100644 --- a/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/service/DetailApiImpl.kt +++ b/notification-domain/src/main/kotlin/io/github/v1servicenotification/detail/service/DetailApiImpl.kt @@ -90,7 +90,7 @@ class DetailApiImpl( sentAt = it.sentAt, isRead = it.isRead, userId = it.userId, - name = it.name, + categoryName = it.name, destination = it.destination, ) }