From f4cf30159dced2bbab170789fcec56df1f083001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=83=9C=EC=9A=A9?= Date: Thu, 17 Oct 2024 20:32:32 +0900 Subject: [PATCH] =?UTF-8?q?Fix=20|=20CAKK-94=20|=20=ED=95=84=EC=9A=94=20?= =?UTF-8?q?=EC=97=86=EB=8A=94=20dto=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../response/cake/CakeImageListResponse.kt | 9 ------- .../kotlin/com/cakk/core/mapper/CakeMapper.kt | 27 ++++++------------- .../param/cake/CakeImageResponseParam.java | 8 ------ 3 files changed, 8 insertions(+), 36 deletions(-) delete mode 100644 cakk-core/src/main/kotlin/com/cakk/core/dto/response/cake/CakeImageListResponse.kt delete mode 100644 cakk-domain/mysql/src/main/java/com/cakk/domain/mysql/dto/param/cake/CakeImageResponseParam.java diff --git a/cakk-core/src/main/kotlin/com/cakk/core/dto/response/cake/CakeImageListResponse.kt b/cakk-core/src/main/kotlin/com/cakk/core/dto/response/cake/CakeImageListResponse.kt deleted file mode 100644 index 3440bf27..00000000 --- a/cakk-core/src/main/kotlin/com/cakk/core/dto/response/cake/CakeImageListResponse.kt +++ /dev/null @@ -1,9 +0,0 @@ -package com.cakk.core.dto.response.cake - -import com.cakk.domain.mysql.dto.param.cake.CakeImageResponseParam - -data class CakeImageListResponse( - val cakeImages: List, - val lastCakeId: Long?, - val size: Int -) diff --git a/cakk-core/src/main/kotlin/com/cakk/core/mapper/CakeMapper.kt b/cakk-core/src/main/kotlin/com/cakk/core/mapper/CakeMapper.kt index 30d80eb5..eb49394c 100644 --- a/cakk-core/src/main/kotlin/com/cakk/core/mapper/CakeMapper.kt +++ b/cakk-core/src/main/kotlin/com/cakk/core/mapper/CakeMapper.kt @@ -3,25 +3,14 @@ package com.cakk.core.mapper import java.util.* import com.cakk.core.dto.response.cake.CakeDetailResponse -import com.cakk.core.dto.response.cake.CakeImageListResponse import com.cakk.core.dto.response.cake.CakeImageWithShopInfoListResponse import com.cakk.core.dto.response.like.HeartCakeImageListResponse import com.cakk.domain.mysql.dto.param.cake.CakeDetailParam -import com.cakk.domain.mysql.dto.param.cake.CakeImageResponseParam import com.cakk.domain.mysql.dto.param.cake.CakeImageWithShopInfoResponseParam import com.cakk.domain.mysql.dto.param.like.HeartCakeImageResponseParam import com.cakk.domain.mysql.dto.param.tag.TagParam import com.cakk.domain.mysql.entity.cake.Cake -fun supplyCakeImageListResponse(cakeImages: List): CakeImageListResponse { - val size = cakeImages.size - - return CakeImageListResponse( - cakeImages, - if (cakeImages.isEmpty()) null else cakeImages[size - 1].cakeId, - cakeImages.size - ) -} fun supplyCakeImageWithShopInfoListResponse( cakeImages: List @@ -35,23 +24,23 @@ fun supplyCakeImageWithShopInfoListResponse( ) } -fun supplyCakeImageListResponse( - cakeImages: List, +fun supplyCakeImageWithShopInfoListResponse( + cakeImages: List, cakeIds: List -): CakeImageListResponse { - val sortedCakeImages: MutableList = ArrayList() +): CakeImageWithShopInfoListResponse { + val sortedCakeImages: MutableList = ArrayList() for (cakeId in cakeIds) { cakeImages.stream() - .filter { cakeImage: CakeImageResponseParam -> cakeImage.cakeId == cakeId } + .filter { cakeImage: CakeImageWithShopInfoResponseParam -> cakeImage.cakeId == cakeId } .findFirst() - .ifPresent { e: CakeImageResponseParam -> sortedCakeImages.add(e) } + .ifPresent { e: CakeImageWithShopInfoResponseParam -> sortedCakeImages.add(e) } } - return CakeImageListResponse( + return CakeImageWithShopInfoListResponse( sortedCakeImages, null, - sortedCakeImages.size + cakeImages.size ) } diff --git a/cakk-domain/mysql/src/main/java/com/cakk/domain/mysql/dto/param/cake/CakeImageResponseParam.java b/cakk-domain/mysql/src/main/java/com/cakk/domain/mysql/dto/param/cake/CakeImageResponseParam.java deleted file mode 100644 index 6dd5e69c..00000000 --- a/cakk-domain/mysql/src/main/java/com/cakk/domain/mysql/dto/param/cake/CakeImageResponseParam.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.cakk.domain.mysql.dto.param.cake; - -public record CakeImageResponseParam( - Long cakeShopId, - Long cakeId, - String cakeImageUrl -) { -}