From ada585a4732e357b16a3df64fd7eea1ae243075c Mon Sep 17 00:00:00 2001 From: MinUk Date: Tue, 30 Jul 2024 13:50:24 +0900 Subject: [PATCH 1/3] =?UTF-8?q?M3-219=20Build=20:=20=EC=9A=B4=EC=98=81?= =?UTF-8?q?=EC=9A=A9=20=EB=A1=9C=EA=B7=B8=20=EA=B4=80=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/logback-spring.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index 939f1627..3d0d8c76 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -24,4 +24,10 @@ + + + + + + From b6213d24ddd95555c00c944adca8b7e906ba1db1 Mon Sep 17 00:00:00 2001 From: MinUk Date: Tue, 30 Jul 2024 15:07:39 +0900 Subject: [PATCH 2/3] =?UTF-8?q?M3-219=20Build=20:=20=EC=9A=B4=EC=98=81=20?= =?UTF-8?q?=EC=84=9C=EB=B2=84=20=EC=9A=A9=20=EC=8B=9C=ED=81=AC=EB=A6=BF=20?= =?UTF-8?q?=ED=82=A4=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd_prod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd_prod.yml b/.github/workflows/cd_prod.yml index 351bced2..dd564308 100644 --- a/.github/workflows/cd_prod.yml +++ b/.github/workflows/cd_prod.yml @@ -26,7 +26,7 @@ jobs: echo "SPRING_PROFILES_ACTIVE=prod" >> .env echo "X-NCP-APIGW-API-KEY-ID=${{ secrets.NAVER_APIKEYID }}" >> .env echo "X-NCP-APIGW-API-KEY=${{ secrets.NAVER_APIKEY }}" >> .env - echo "JWT_SECRET_KEY=${{ secrets.JWT_SECRET_KEY }}" >> .env + echo "JWT_SECRET_KEY=${{ secrets.JWT_SECRET_KEY_PROD }}" >> .env echo "KAKAO_APP_ID=${{ secrets.KAKAO_APP_ID }}" >> .env echo "REDIS_HOST=${{ secrets.REDIS_HOST_PROD }}" >> .env echo "AWS_ACCESS_KEY=${{ secrets.AWS_ACCESS_KEY_PROD }}" >> .env From 551f7ce12740daeeef6f3d530d64124bd7f52f66 Mon Sep 17 00:00:00 2001 From: Koo Min Date: Mon, 5 Aug 2024 16:19:41 +0900 Subject: [PATCH 3/3] =?UTF-8?q?M3-281=20Fix=20:=20=ED=94=BD=EC=85=80?= =?UTF-8?q?=EC=9D=98=20=EC=86=8C=EC=9C=A0=EC=A3=BC=EB=A5=BC=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20=ED=95=A0=20=EB=95=8C=20=EB=8F=99=EC=9D=BC=ED=95=9C?= =?UTF-8?q?=20=EC=86=8C=EC=9C=A0=EC=A3=BC=EC=9D=B4=EB=A9=B4=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=EB=82=A0=EC=A7=9C=EB=A5=BC=20=EB=B3=80=EA=B2=BD?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/entity/global/BaseTimeEntity.java | 3 +++ .../com/m3pro/groundflip/service/PixelService.java | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/m3pro/groundflip/domain/entity/global/BaseTimeEntity.java b/src/main/java/com/m3pro/groundflip/domain/entity/global/BaseTimeEntity.java index 5d6ed480..abac1d16 100644 --- a/src/main/java/com/m3pro/groundflip/domain/entity/global/BaseTimeEntity.java +++ b/src/main/java/com/m3pro/groundflip/domain/entity/global/BaseTimeEntity.java @@ -22,4 +22,7 @@ public class BaseTimeEntity { @LastModifiedDate private LocalDateTime modifiedAt; + public void updateModifiedAt() { + modifiedAt = LocalDateTime.now(); + } } diff --git a/src/main/java/com/m3pro/groundflip/service/PixelService.java b/src/main/java/com/m3pro/groundflip/service/PixelService.java index a9b5094d..8d797e23 100644 --- a/src/main/java/com/m3pro/groundflip/service/PixelService.java +++ b/src/main/java/com/m3pro/groundflip/service/PixelService.java @@ -151,13 +151,21 @@ private void occupyPixel(PixelOccupyRequest pixelOccupyRequest) { Pixel targetPixel = pixelRepository.findByXAndY(pixelOccupyRequest.getX(), pixelOccupyRequest.getY()) .orElseThrow(() -> new AppException(ErrorCode.PIXEL_NOT_FOUND)); updateRankingOnCache(targetPixel, occupyingUserId); - targetPixel.updateUserId(occupyingUserId); - pixelRepository.saveAndFlush(targetPixel); + updatePixelOwner(targetPixel, occupyingUserId); updatePixelAddress(targetPixel); eventPublisher.publishEvent(new PixelUserInsertEvent(targetPixel.getId(), occupyingUserId, communityId)); } + private void updatePixelOwner(Pixel targetPixel, Long occupyingUserId) { + if (Objects.equals(targetPixel.getUserId(), occupyingUserId)) { + targetPixel.updateModifiedAt(); + } else { + targetPixel.updateUserId(occupyingUserId); + } + pixelRepository.saveAndFlush(targetPixel); + } + /** * 픽셀의 주소를 업데이트한다.. * @param targetPixel 주소를 얻기 위한 픽셀