From 8c193758ca2ed876346b8c2c6ba308f2f176a1c1 Mon Sep 17 00:00:00 2001 From: H-Yeji Date: Fri, 1 Nov 2024 12:17:01 +0900 Subject: [PATCH 01/15] =?UTF-8?q?chore:=20openvidu-depl.yml=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- k8s/openvidu-depl.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/k8s/openvidu-depl.yml b/k8s/openvidu-depl.yml index 19068c06..0c37fc8d 100644 --- a/k8s/openvidu-depl.yml +++ b/k8s/openvidu-depl.yml @@ -35,9 +35,9 @@ spec: value: "api.inong.shop" - name: OPENVIDU_SERVER_CONTEXT_PATH value: "/openvidu" -# - name: CERTIFICATE_TYPE -# value: letsencrypt-prod -# - name: LETSENCRYPT_EMAIL -# value: clearrworld@gmail.com + - name: CERTIFICATE_TYPE + value: letsencrypt + - name: LETSENCRYPT_EMAIL + value: clearrworld@gmail.com # - name: OPENVIDU_SERVER_SSL # value: "true" From 9d142a42831a6b6cacfa7b796f563024860452a8 Mon Sep 17 00:00:00 2001 From: H-Yeji Date: Fri, 1 Nov 2024 12:38:41 +0900 Subject: [PATCH 02/15] chore --- k8s/ingress.yml | 2 +- k8s/openvidu-depl.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/k8s/ingress.yml b/k8s/ingress.yml index dfc020b8..88700a78 100644 --- a/k8s/ingress.yml +++ b/k8s/ingress.yml @@ -7,7 +7,7 @@ metadata: # nginx.ingress.kubernetes.io/ssl-passthrough: "true" # nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" # nginx.ingress.kubernetes.io/rewrite-target: /$1 # api-gateway에서 라우팅하므로 이부부은 주석 처리 되어야한다. -# nginx.ingress.kubernetes.io/websocket-services: "openvidu-service" # 웹소켓 지원 + nginx.ingress.kubernetes.io/websocket-services: "openvidu-service" # 웹소켓 지원 cert-manager.io/cluster-issuer: letsencrypt-prod spec: # 아래 tls 부분을 추가! diff --git a/k8s/openvidu-depl.yml b/k8s/openvidu-depl.yml index 0c37fc8d..dbea0a77 100644 --- a/k8s/openvidu-depl.yml +++ b/k8s/openvidu-depl.yml @@ -33,6 +33,8 @@ spec: name: inong-app-secrets - name: DOMAIN_OR_PUBLIC_IP value: "api.inong.shop" + - name: OPENVIDU_PUBLICURL + value: "https://api.inong.shop/openvidu" - name: OPENVIDU_SERVER_CONTEXT_PATH value: "/openvidu" - name: CERTIFICATE_TYPE From ad93443d1c7556c610174e10e4df1cdf83be3318 Mon Sep 17 00:00:00 2001 From: H-Yeji Date: Fri, 1 Nov 2024 16:10:49 +0900 Subject: [PATCH 03/15] Chore --- k8s/openvidu-depl.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/openvidu-depl.yml b/k8s/openvidu-depl.yml index dbea0a77..d720f4f3 100644 --- a/k8s/openvidu-depl.yml +++ b/k8s/openvidu-depl.yml @@ -34,7 +34,7 @@ spec: - name: DOMAIN_OR_PUBLIC_IP value: "api.inong.shop" - name: OPENVIDU_PUBLICURL - value: "https://api.inong.shop/openvidu" + value: "https://api.inong.shop:4443/" - name: OPENVIDU_SERVER_CONTEXT_PATH value: "/openvidu" - name: CERTIFICATE_TYPE From d81156ee54372419f34fe385add7111c10ef509c Mon Sep 17 00:00:00 2001 From: H-Yeji Date: Fri, 1 Nov 2024 16:41:12 +0900 Subject: [PATCH 04/15] =?UTF-8?q?chore:=20=EC=A0=9C=EB=B0=9C=20=EB=8F=8C?= =?UTF-8?q?=EC=95=84=EA=B0=80=EA=B2=8C=20=ED=95=B4=EC=A3=BC=EC=84=B8?= =?UTF-8?q?=EC=9A=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../samtuap/inong/domain/live/api/OpenViduController.java | 8 +++++++- k8s/openvidu-depl.yml | 7 ++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/backend/live/src/main/java/org/samtuap/inong/domain/live/api/OpenViduController.java b/backend/live/src/main/java/org/samtuap/inong/domain/live/api/OpenViduController.java index 343dcdea..ebd002b1 100644 --- a/backend/live/src/main/java/org/samtuap/inong/domain/live/api/OpenViduController.java +++ b/backend/live/src/main/java/org/samtuap/inong/domain/live/api/OpenViduController.java @@ -7,6 +7,7 @@ import org.samtuap.inong.domain.live.dto.LiveSessionRequest; import org.samtuap.inong.domain.live.dto.LiveSessionResponse; import org.samtuap.inong.domain.live.service.LiveService; +import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @@ -18,13 +19,18 @@ import io.openvidu.java.client.Session; @RestController -@RequiredArgsConstructor +//@RequiredArgsConstructor @Slf4j public class OpenViduController { private final OpenVidu openvidu; private final LiveService liveService; + public OpenViduController(@Value("${openvidu.secret}") String openviduSecret, LiveService liveService) { + this.openvidu = new OpenVidu("https://api.inong.shop:4443/", openviduSecret); + this.liveService = liveService; + } + /** * (1) create session : session id랑 live id랑 다름 */ diff --git a/k8s/openvidu-depl.yml b/k8s/openvidu-depl.yml index d720f4f3..47d36ead 100644 --- a/k8s/openvidu-depl.yml +++ b/k8s/openvidu-depl.yml @@ -34,12 +34,13 @@ spec: - name: DOMAIN_OR_PUBLIC_IP value: "api.inong.shop" - name: OPENVIDU_PUBLICURL - value: "https://api.inong.shop:4443/" +# value: "https://api.inong.shop/openvidu" + value: https://api.inong.shop:4443/ - name: OPENVIDU_SERVER_CONTEXT_PATH value: "/openvidu" - name: CERTIFICATE_TYPE value: letsencrypt - name: LETSENCRYPT_EMAIL value: clearrworld@gmail.com -# - name: OPENVIDU_SERVER_SSL -# value: "true" + - name: OPENVIDU_SERVER_SSL + value: "true" From 743bcd4eeedb327129a776f677b435a8500261c6 Mon Sep 17 00:00:00 2001 From: H-Yeji Date: Fri, 1 Nov 2024 17:09:37 +0900 Subject: [PATCH 05/15] =?UTF-8?q?chore:=20=ED=95=B4=EB=8B=AC=EB=9D=BC?= =?UTF-8?q?=EB=8A=94=EA=B1=B0=20=EB=8B=A4=ED=95=B4=EC=A4=AC=EC=9E=96?= =?UTF-8?q?=EC=95=84=20=EB=AD=90=EA=B0=80=20=EB=AC=B8=EC=A0=9C=EC=95=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../samtuap/inong/domain/live/api/OpenViduController.java | 7 +------ k8s/openvidu-depl.yml | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/backend/live/src/main/java/org/samtuap/inong/domain/live/api/OpenViduController.java b/backend/live/src/main/java/org/samtuap/inong/domain/live/api/OpenViduController.java index ebd002b1..1373dd6e 100644 --- a/backend/live/src/main/java/org/samtuap/inong/domain/live/api/OpenViduController.java +++ b/backend/live/src/main/java/org/samtuap/inong/domain/live/api/OpenViduController.java @@ -19,18 +19,13 @@ import io.openvidu.java.client.Session; @RestController -//@RequiredArgsConstructor +@RequiredArgsConstructor @Slf4j public class OpenViduController { private final OpenVidu openvidu; private final LiveService liveService; - public OpenViduController(@Value("${openvidu.secret}") String openviduSecret, LiveService liveService) { - this.openvidu = new OpenVidu("https://api.inong.shop:4443/", openviduSecret); - this.liveService = liveService; - } - /** * (1) create session : session id랑 live id랑 다름 */ diff --git a/k8s/openvidu-depl.yml b/k8s/openvidu-depl.yml index 47d36ead..b2e8130d 100644 --- a/k8s/openvidu-depl.yml +++ b/k8s/openvidu-depl.yml @@ -34,8 +34,8 @@ spec: - name: DOMAIN_OR_PUBLIC_IP value: "api.inong.shop" - name: OPENVIDU_PUBLICURL -# value: "https://api.inong.shop/openvidu" - value: https://api.inong.shop:4443/ + value: "https://api.inong.shop/openvidu" +# value: https://api.inong.shop:4443/ - name: OPENVIDU_SERVER_CONTEXT_PATH value: "/openvidu" - name: CERTIFICATE_TYPE From c5ba6d6e712d2204ad190c26552722a22903506f Mon Sep 17 00:00:00 2001 From: tteia Date: Fri, 1 Nov 2024 17:43:44 +0900 Subject: [PATCH 06/15] =?UTF-8?q?fix:=20=EC=98=81=EC=88=98=EC=A6=9D=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EC=BD=94=EB=93=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inong/domain/order/repository/OrderRepository.java | 8 ++++++++ .../inong/domain/receipt/service/ReceiptService.java | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/backend/order/src/main/java/org/samtuap/inong/domain/order/repository/OrderRepository.java b/backend/order/src/main/java/org/samtuap/inong/domain/order/repository/OrderRepository.java index c1e0b821..f810c474 100644 --- a/backend/order/src/main/java/org/samtuap/inong/domain/order/repository/OrderRepository.java +++ b/backend/order/src/main/java/org/samtuap/inong/domain/order/repository/OrderRepository.java @@ -1,11 +1,13 @@ package org.samtuap.inong.domain.order.repository; +import org.samtuap.inong.common.exception.BaseCustomException; import org.samtuap.inong.domain.order.dto.PackageOrderCount; import org.samtuap.inong.domain.order.dto.PackageProductOrderResponse; import org.samtuap.inong.domain.order.dto.SalesDataGetResponse; import org.samtuap.inong.domain.order.dto.TopPackageResponse; import org.samtuap.inong.domain.order.entity.Ordering; +import org.samtuap.inong.domain.receipt.entity.Receipt; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; @@ -16,6 +18,9 @@ import java.util.List; import java.util.Optional; +import static org.samtuap.inong.common.exceptionType.OrderExceptionType.ORDER_NOT_FOUND; +import static org.samtuap.inong.common.exceptionType.ReceiptExceptionType.RECEIPT_NOT_FOUND; + public interface OrderRepository extends JpaRepository { @Query(value = "SELECT o.package_id FROM ordering o " + @@ -38,4 +43,7 @@ public interface OrderRepository extends JpaRepository { @Query("SELECT new org.samtuap.inong.domain.order.dto.PackageOrderCount(o.packageId, COUNT(o.id)) FROM Ordering o WHERE o.farmId = :farmId AND o.createdAt >= :startAt AND o.createdAt <= :endAt GROUP BY o.packageId") List findAllByFarmIdAndBetweenStartAtAndEndAt(Long farmId, LocalDateTime startAt, LocalDateTime endAt); + default Ordering findByIdOrThrow(Long id) { + return findById(id).orElseThrow(() -> new BaseCustomException(ORDER_NOT_FOUND)); + } } diff --git a/backend/order/src/main/java/org/samtuap/inong/domain/receipt/service/ReceiptService.java b/backend/order/src/main/java/org/samtuap/inong/domain/receipt/service/ReceiptService.java index 0be8aea8..1ec9b48e 100644 --- a/backend/order/src/main/java/org/samtuap/inong/domain/receipt/service/ReceiptService.java +++ b/backend/order/src/main/java/org/samtuap/inong/domain/receipt/service/ReceiptService.java @@ -21,9 +21,9 @@ public class ReceiptService { private final ProductFeign productFeign; - public ReceiptInfoResponse getReceiptInfo(Long orderId) { - Ordering ordering = orderRepository.findById(orderId).orElseThrow(()-> new BaseCustomException(ORDER_NOT_FOUND)); - Receipt receipt = receiptRepository.findByOrderOrThrow(ordering); + public ReceiptInfoResponse getReceiptInfo(Long receiptId) { + Receipt receipt = receiptRepository.findByIdOrThrow(receiptId); + Ordering ordering = orderRepository.findByIdOrThrow(receipt.getOrder().getId()); PackageProductResponse product = productFeign.getPackageProduct(ordering.getPackageId()); return ReceiptInfoResponse.from(receipt, product); } From b6e34fcaace039aca6f8124e9a0a43bd389d82f3 Mon Sep 17 00:00:00 2001 From: H-Yeji Date: Fri, 1 Nov 2024 19:51:42 +0900 Subject: [PATCH 07/15] chore --- k8s/ingress.yml | 14 +++++++--- k8s/openvidu-depl.yml | 61 +++++++++++++++++++++++-------------------- 2 files changed, 43 insertions(+), 32 deletions(-) diff --git a/k8s/ingress.yml b/k8s/ingress.yml index 88700a78..430060de 100644 --- a/k8s/ingress.yml +++ b/k8s/ingress.yml @@ -3,11 +3,19 @@ kind: Ingress metadata: name: inong-ingress annotations: - kubernetes.io/ingress.class: nginx +# kubernetes.io/ingress.class: nginx # nginx.ingress.kubernetes.io/ssl-passthrough: "true" # nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" - # nginx.ingress.kubernetes.io/rewrite-target: /$1 # api-gateway에서 라우팅하므로 이부부은 주석 처리 되어야한다. - nginx.ingress.kubernetes.io/websocket-services: "openvidu-service" # 웹소켓 지원 +# # nginx.ingress.kubernetes.io/rewrite-target: /$1 # api-gateway에서 라우팅하므로 이부부은 주석 처리 되어야한다. +# nginx.ingress.kubernetes.io/websocket-services: "openvidu-service" # 웹소켓 지원 +# cert-manager.io/cluster-issuer: letsencrypt-prod + kubernetes.io/ingress.class: nginx + nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" + nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" + nginx.ingress.kubernetes.io/proxy-body-size: "0" + nginx.ingress.kubernetes.io/proxy-buffering: "off" + nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" + nginx.ingress.kubernetes.io/ssl-passthrough: "true" cert-manager.io/cluster-issuer: letsencrypt-prod spec: # 아래 tls 부분을 추가! diff --git a/k8s/openvidu-depl.yml b/k8s/openvidu-depl.yml index b2e8130d..330f01a2 100644 --- a/k8s/openvidu-depl.yml +++ b/k8s/openvidu-depl.yml @@ -15,32 +15,35 @@ spec: app: openvidu spec: containers: - - name: openvidu-server - image: openvidu/openvidu-server-kms:latest # -# image: openvidu/openvidu-dev - ports: - - containerPort: 4443 - env: - - name: OPENVIDU_URL - valueFrom: - secretKeyRef: - key: OPENVIDU_URL - name: inong-app-secrets - - name: OPENVIDU_SECRET - valueFrom: - secretKeyRef: - key: OPENVIDU_SECRET - name: inong-app-secrets - - name: DOMAIN_OR_PUBLIC_IP - value: "api.inong.shop" - - name: OPENVIDU_PUBLICURL - value: "https://api.inong.shop/openvidu" -# value: https://api.inong.shop:4443/ - - name: OPENVIDU_SERVER_CONTEXT_PATH - value: "/openvidu" - - name: CERTIFICATE_TYPE - value: letsencrypt - - name: LETSENCRYPT_EMAIL - value: clearrworld@gmail.com - - name: OPENVIDU_SERVER_SSL - value: "true" + - name: openvidu-server + image: openvidu/openvidu-server-kms:latest # + # image: openvidu/openvidu-dev + ports: + - containerPort: 4443 + env: + - name: DOMAIN_OR_PUBLIC_IP + value: "api.inong.shop" + - name: OPENVIDU_PUBLICURL +# value: "https://api.inong.shop:4443/" + value: "https://api.inong.shop/openvidu/" + - name: OPENVIDU_SERVER_CE_PATH + value: "/openvidu" + - name: OPENVIDU_SECRET + valueFrom: + secretKeyRef: + name: inong-app-secrets + key: OPENVIDU_SECRET + - name: CERTIFICATE_TYPE + value: "owncert" + - name: CERTIFICATE_CERTIFICATE + value: /etc/letsencrypt/tls.crt + - name: CERTIFICATE_PRIVATE_KEY + value: /etc/letsencrypt/tls.key + volumeMounts: + - name: tls-secret + mountPath: /etc/letsencrypt + readOnly: true + volumes: + - name: tls-secret + secret: + secretName: inong-com-tls \ No newline at end of file From 44cf79b567612e523a38275887fddf463ae2668d Mon Sep 17 00:00:00 2001 From: H-Yeji Date: Fri, 1 Nov 2024 20:18:24 +0900 Subject: [PATCH 08/15] chore --- k8s/ingress.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/k8s/ingress.yml b/k8s/ingress.yml index 430060de..96996570 100644 --- a/k8s/ingress.yml +++ b/k8s/ingress.yml @@ -3,19 +3,11 @@ kind: Ingress metadata: name: inong-ingress annotations: -# kubernetes.io/ingress.class: nginx + kubernetes.io/ingress.class: nginx # nginx.ingress.kubernetes.io/ssl-passthrough: "true" # nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" # # nginx.ingress.kubernetes.io/rewrite-target: /$1 # api-gateway에서 라우팅하므로 이부부은 주석 처리 되어야한다. -# nginx.ingress.kubernetes.io/websocket-services: "openvidu-service" # 웹소켓 지원 -# cert-manager.io/cluster-issuer: letsencrypt-prod - kubernetes.io/ingress.class: nginx - nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" - nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" - nginx.ingress.kubernetes.io/proxy-body-size: "0" - nginx.ingress.kubernetes.io/proxy-buffering: "off" - nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" - nginx.ingress.kubernetes.io/ssl-passthrough: "true" + nginx.ingress.kubernetes.io/websocket-services: "openvidu-service" # 웹소켓 지원 cert-manager.io/cluster-issuer: letsencrypt-prod spec: # 아래 tls 부분을 추가! From f4be569657ac56009fc03115c5c3eb1fb3643e89 Mon Sep 17 00:00:00 2001 From: H-Yeji Date: Fri, 1 Nov 2024 21:19:01 +0900 Subject: [PATCH 09/15] =?UTF-8?q?chore:=20openvidu=20=EB=8B=A4=EC=8B=9C=20?= =?UTF-8?q?=EB=B0=B0=ED=8F=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy_msa_k8s.yml | 9 +---- k8s/ingress.yml | 37 ++++++++------------- k8s/openvidu-depl.yml | 49 ---------------------------- k8s/openvidu-service.yml | 15 --------- 4 files changed, 14 insertions(+), 96 deletions(-) delete mode 100644 k8s/openvidu-depl.yml delete mode 100644 k8s/openvidu-service.yml diff --git a/.github/workflows/deploy_msa_k8s.yml b/.github/workflows/deploy_msa_k8s.yml index aca45d7e..4ccdacd7 100644 --- a/.github/workflows/deploy_msa_k8s.yml +++ b/.github/workflows/deploy_msa_k8s.yml @@ -118,11 +118,4 @@ jobs: - name: eks kubectl apply run: | kubectl apply -f ./backend/apigateway/k8s/apigateway-depl.yml - kubectl rollout restart deployment apigateway-deployment - - # openvidu - - name: eks kubectl apply - run: | - kubectl apply -f ./k8s/openvidu-depl.yml - kubectl apply -f ./k8s/openvidu-service.yml - kubectl rollout restart deployment openvidu-deployment \ No newline at end of file + kubectl rollout restart deployment apigateway-deployment \ No newline at end of file diff --git a/k8s/ingress.yml b/k8s/ingress.yml index 96996570..247b6448 100644 --- a/k8s/ingress.yml +++ b/k8s/ingress.yml @@ -4,32 +4,21 @@ metadata: name: inong-ingress annotations: kubernetes.io/ingress.class: nginx -# nginx.ingress.kubernetes.io/ssl-passthrough: "true" -# nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" -# # nginx.ingress.kubernetes.io/rewrite-target: /$1 # api-gateway에서 라우팅하므로 이부부은 주석 처리 되어야한다. - nginx.ingress.kubernetes.io/websocket-services: "openvidu-service" # 웹소켓 지원 cert-manager.io/cluster-issuer: letsencrypt-prod spec: # 아래 tls 부분을 추가! tls: - - hosts: - - "api.inong.shop" - secretName: inong-com-tls + - hosts: + - "api.inong.shop" + secretName: inong-com-tls rules: - - host: api.inong.shop - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: apigateway-service - port: - number: 80 # 서비스 포트를 적어 줘야 한다. - - path: /openvidu - pathType: Prefix - backend: - service: - name: openvidu-service - port: - number: 4443 \ No newline at end of file + - host: api.inong.shop + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: apigateway-service + port: + number: 80 # 서비스 포트를 적어 줘야 한다. \ No newline at end of file diff --git a/k8s/openvidu-depl.yml b/k8s/openvidu-depl.yml deleted file mode 100644 index 330f01a2..00000000 --- a/k8s/openvidu-depl.yml +++ /dev/null @@ -1,49 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: openvidu-deployment - labels: - app: openvidu -spec: - replicas: 1 - selector: - matchLabels: - app: openvidu - template: - metadata: - labels: - app: openvidu - spec: - containers: - - name: openvidu-server - image: openvidu/openvidu-server-kms:latest # - # image: openvidu/openvidu-dev - ports: - - containerPort: 4443 - env: - - name: DOMAIN_OR_PUBLIC_IP - value: "api.inong.shop" - - name: OPENVIDU_PUBLICURL -# value: "https://api.inong.shop:4443/" - value: "https://api.inong.shop/openvidu/" - - name: OPENVIDU_SERVER_CE_PATH - value: "/openvidu" - - name: OPENVIDU_SECRET - valueFrom: - secretKeyRef: - name: inong-app-secrets - key: OPENVIDU_SECRET - - name: CERTIFICATE_TYPE - value: "owncert" - - name: CERTIFICATE_CERTIFICATE - value: /etc/letsencrypt/tls.crt - - name: CERTIFICATE_PRIVATE_KEY - value: /etc/letsencrypt/tls.key - volumeMounts: - - name: tls-secret - mountPath: /etc/letsencrypt - readOnly: true - volumes: - - name: tls-secret - secret: - secretName: inong-com-tls \ No newline at end of file diff --git a/k8s/openvidu-service.yml b/k8s/openvidu-service.yml deleted file mode 100644 index 52054f2b..00000000 --- a/k8s/openvidu-service.yml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: openvidu-service - labels: - app: openvidu -spec: - selector: - app: openvidu - ports: - - protocol: TCP - port: 4443 # opeidu server가 보안 웹소켓 통신을 위해 기본으로 사용하는 포트 - targetPort: 4443 - type: ClusterIP - From 45cb73c19ffcd01f71c0771b0ca610f8f64f316b Mon Sep 17 00:00:00 2001 From: H-Yeji Date: Sat, 2 Nov 2024 18:04:58 +0900 Subject: [PATCH 10/15] =?UTF-8?q?chore:=20opensearch=20=EC=A3=BC=EC=84=9D?= =?UTF-8?q?=20=ED=95=B4=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/product/service/PackageProductService.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/product/src/main/java/org/samtuap/inong/domain/product/service/PackageProductService.java b/backend/product/src/main/java/org/samtuap/inong/domain/product/service/PackageProductService.java index 325d0a90..d42186af 100644 --- a/backend/product/src/main/java/org/samtuap/inong/domain/product/service/PackageProductService.java +++ b/backend/product/src/main/java/org/samtuap/inong/domain/product/service/PackageProductService.java @@ -19,6 +19,7 @@ import org.samtuap.inong.domain.product.repository.PackageProductRepository; import org.samtuap.inong.domain.seller.entity.Seller; import org.samtuap.inong.domain.seller.repository.SellerRepository; +import org.samtuap.inong.search.document.PackageProductDocument; import org.samtuap.inong.search.service.PackageProductSearchService; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; @@ -142,8 +143,8 @@ public PackageProductCreateResponse createPackageProduct(Long sellerId, PackageP packageProductImageService.saveImages(savedPackageProduct, imageUrls); // elasticsearch✔️ : open search에 인덱싱 -// PackageProductDocument packageProductDocument = PackageProductDocument.convertToDocument(savedPackageProduct); -// packageProductSearchService.indexProductDocument(packageProductDocument); + PackageProductDocument packageProductDocument = PackageProductDocument.convertToDocument(savedPackageProduct); + packageProductSearchService.indexProductDocument(packageProductDocument); // 저장된 엔티티를 DTO로 반환 return PackageProductCreateResponse.fromEntity(savedPackageProduct, imageUrls); @@ -174,7 +175,7 @@ public void deletePackage(Long sellerId, Long packageId) { } // elasticsearch✔️ : 삭제 -// packageProductSearchService.deleteProduct(String.valueOf(packageId)); + packageProductSearchService.deleteProduct(String.valueOf(packageId)); } @Transactional @@ -203,8 +204,8 @@ public void updatePackageProduct(Long sellerId, Long packageId, PackageProductUp } // elasticsearch✔️ : open search에 수정 -// PackageProductDocument updateProduct = PackageProductDocument.convertToDocument(packageProduct); -// packageProductSearchService.updateProduct(updateProduct); + PackageProductDocument updateProduct = PackageProductDocument.convertToDocument(packageProduct); + packageProductSearchService.updateProduct(updateProduct); } // Feign 요청 용 From 00edf74468b81d102fc5c9ad94478625abbca536 Mon Sep 17 00:00:00 2001 From: H-Yeji Date: Sat, 2 Nov 2024 18:55:10 +0900 Subject: [PATCH 11/15] =?UTF-8?q?chore:=20repository=EC=97=90=20=EC=96=B4?= =?UTF-8?q?=EB=85=B8=ED=85=8C=EC=9D=B4=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../samtuap/inong/domain/farm/repository/FarmRepository.java | 2 ++ .../domain/product/repository/PackageProductRepository.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/backend/product/src/main/java/org/samtuap/inong/domain/farm/repository/FarmRepository.java b/backend/product/src/main/java/org/samtuap/inong/domain/farm/repository/FarmRepository.java index 42075926..f85d7124 100644 --- a/backend/product/src/main/java/org/samtuap/inong/domain/farm/repository/FarmRepository.java +++ b/backend/product/src/main/java/org/samtuap/inong/domain/farm/repository/FarmRepository.java @@ -8,12 +8,14 @@ import org.springframework.data.jpa.domain.Specification; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; import java.util.List; import java.util.Optional; import static org.samtuap.inong.common.exceptionType.ProductExceptionType.FARM_NOT_FOUND; +@Repository public interface FarmRepository extends JpaRepository { default Farm findByIdOrThrow(Long farmId) { return findById(farmId).orElseThrow(() -> new BaseCustomException(FARM_NOT_FOUND)); diff --git a/backend/product/src/main/java/org/samtuap/inong/domain/product/repository/PackageProductRepository.java b/backend/product/src/main/java/org/samtuap/inong/domain/product/repository/PackageProductRepository.java index 91812e74..80924543 100644 --- a/backend/product/src/main/java/org/samtuap/inong/domain/product/repository/PackageProductRepository.java +++ b/backend/product/src/main/java/org/samtuap/inong/domain/product/repository/PackageProductRepository.java @@ -10,11 +10,13 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; import java.util.List; import static org.samtuap.inong.common.exceptionType.ProductExceptionType.PRODUCT_NOT_FOUND; +@Repository public interface PackageProductRepository extends JpaRepository { @Query("SELECT p FROM PackageProduct p WHERE p.id IN :ids") List findAllByIds(@Param("ids") List ids); From 3efedd17bdeb7ea7a0784c08433b5c0a21ab721b Mon Sep 17 00:00:00 2001 From: H-Yeji Date: Sat, 2 Nov 2024 20:12:37 +0900 Subject: [PATCH 12/15] =?UTF-8?q?chore:=20opensearch=EB=A5=BC=20=EC=9C=84?= =?UTF-8?q?=ED=95=9C=20db=20create?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/live/src/main/resources/application-prod.yml | 2 +- backend/member/src/main/resources/application-prod.yml | 2 +- backend/order/src/main/resources/application-prod.yml | 2 +- .../samtuap/inong/domain/farm/service/FarmService.java | 9 +++++---- .../inong/domain/seller/service/SellerService.java | 4 +++- backend/product/src/main/resources/application-prod.yml | 2 +- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/backend/live/src/main/resources/application-prod.yml b/backend/live/src/main/resources/application-prod.yml index c9935213..d92575f6 100644 --- a/backend/live/src/main/resources/application-prod.yml +++ b/backend/live/src/main/resources/application-prod.yml @@ -15,7 +15,7 @@ spring: driver-class-name: org.mariadb.jdbc.Driver jpa: hibernate: - ddl-auto: update + ddl-auto: create database: mysql database-platform: org.hibernate.dialect.MariaDBDialect generate-ddl: true diff --git a/backend/member/src/main/resources/application-prod.yml b/backend/member/src/main/resources/application-prod.yml index 089197f8..e95d667d 100644 --- a/backend/member/src/main/resources/application-prod.yml +++ b/backend/member/src/main/resources/application-prod.yml @@ -16,7 +16,7 @@ spring: tomcat.initial-size: 3 # 적절한 수치로 조정 jpa: hibernate: - ddl-auto: update + ddl-auto: create database: mysql database-platform: org.hibernate.dialect.MariaDBDialect generate-ddl: true diff --git a/backend/order/src/main/resources/application-prod.yml b/backend/order/src/main/resources/application-prod.yml index a3c8651a..11d824e0 100644 --- a/backend/order/src/main/resources/application-prod.yml +++ b/backend/order/src/main/resources/application-prod.yml @@ -15,7 +15,7 @@ spring: driver-class-name: org.mariadb.jdbc.Driver jpa: hibernate: - ddl-auto: update + ddl-auto: create database: mysql database-platform: org.hibernate.dialect.MariaDBDialect generate-ddl: true diff --git a/backend/product/src/main/java/org/samtuap/inong/domain/farm/service/FarmService.java b/backend/product/src/main/java/org/samtuap/inong/domain/farm/service/FarmService.java index 9d3078b2..144931e1 100644 --- a/backend/product/src/main/java/org/samtuap/inong/domain/farm/service/FarmService.java +++ b/backend/product/src/main/java/org/samtuap/inong/domain/farm/service/FarmService.java @@ -25,6 +25,7 @@ import org.samtuap.inong.domain.product.repository.PackageProductRepository; import org.samtuap.inong.domain.seller.dto.FarmCategoryResponse; import org.samtuap.inong.domain.seller.dto.SellerFarmInfoUpdateRequest; +import org.samtuap.inong.search.document.FarmDocument; import org.samtuap.inong.search.service.FarmSearchService; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; @@ -191,8 +192,8 @@ public FarmCreateResponse createFarm(FarmCreateRequest request, Long sellerId) { } // elasticsearch✔️ : open search에 인덱싱 -// FarmDocument farmDocument = FarmDocument.convertToDocument(farm); -// farmSearchService.indexFarmDocument(farmDocument); + FarmDocument farmDocument = FarmDocument.convertToDocument(farm); + farmSearchService.indexFarmDocument(farmDocument); return FarmCreateResponse.fromEntity(farm); } @@ -229,8 +230,8 @@ public void updateFarmInfo(Long sellerId, SellerFarmInfoUpdateRequest infoUpdate } // elasticsearch✔️ : open search에 수정 -// FarmDocument farmDocument = FarmDocument.convertToDocument(farm); -// farmSearchService.updateFarm(farmDocument); + FarmDocument farmDocument = FarmDocument.convertToDocument(farm); + farmSearchService.updateFarm(farmDocument); } public List getAllFarmCategories() { diff --git a/backend/product/src/main/java/org/samtuap/inong/domain/seller/service/SellerService.java b/backend/product/src/main/java/org/samtuap/inong/domain/seller/service/SellerService.java index 45d8e20e..8b31960e 100644 --- a/backend/product/src/main/java/org/samtuap/inong/domain/seller/service/SellerService.java +++ b/backend/product/src/main/java/org/samtuap/inong/domain/seller/service/SellerService.java @@ -15,6 +15,7 @@ import org.samtuap.inong.domain.seller.jwt.domain.JwtToken; import org.samtuap.inong.domain.seller.jwt.service.JwtService; import org.samtuap.inong.domain.seller.repository.SellerRepository; +import org.samtuap.inong.search.service.FarmSearchService; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import static org.samtuap.inong.common.exceptionType.SellerExceptionType.*; @@ -35,6 +36,7 @@ public class SellerService { private final JwtService jwtService; private final PackageProductRepository packageProductRepository; private final RedisTool redisUtil; + private final FarmSearchService farmSearchService; @Transactional public boolean verifyAuthCode(String email, String code) { @@ -113,7 +115,7 @@ public void withDraw(Long sellerId, String password) { // 농장 삭제 진행 farmRepository.delete(farm); // elasticsearch✔️ : 삭제 -// farmSearchService.deleteFarm(String.valueOf(farm.getId())); + farmSearchService.deleteFarm(String.valueOf(farm.getId())); } // 삭제되지 않은 패키지가 없으면 농장과 판매자 삭제 진행 diff --git a/backend/product/src/main/resources/application-prod.yml b/backend/product/src/main/resources/application-prod.yml index 8b6f1d66..f3014f5d 100644 --- a/backend/product/src/main/resources/application-prod.yml +++ b/backend/product/src/main/resources/application-prod.yml @@ -16,7 +16,7 @@ spring: jpa: hibernate: - ddl-auto: update + ddl-auto: create database: mysql database-platform: org.hibernate.dialect.MariaDBDialect generate-ddl: true From 3a00fc0d27941942b309fab376d06ff36469d1a9 Mon Sep 17 00:00:00 2001 From: H-Yeji Date: Sat, 2 Nov 2024 20:21:00 +0900 Subject: [PATCH 13/15] =?UTF-8?q?chore:=20=EC=95=88=EC=A0=84=EC=9D=84=20?= =?UTF-8?q?=EC=9C=84=ED=95=B4=20=EB=8B=A4=EC=8B=9C=20update=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/live/src/main/resources/application-prod.yml | 2 +- backend/member/src/main/resources/application-prod.yml | 2 +- backend/order/src/main/resources/application-prod.yml | 2 +- backend/product/src/main/resources/application-prod.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/live/src/main/resources/application-prod.yml b/backend/live/src/main/resources/application-prod.yml index d92575f6..c9935213 100644 --- a/backend/live/src/main/resources/application-prod.yml +++ b/backend/live/src/main/resources/application-prod.yml @@ -15,7 +15,7 @@ spring: driver-class-name: org.mariadb.jdbc.Driver jpa: hibernate: - ddl-auto: create + ddl-auto: update database: mysql database-platform: org.hibernate.dialect.MariaDBDialect generate-ddl: true diff --git a/backend/member/src/main/resources/application-prod.yml b/backend/member/src/main/resources/application-prod.yml index e95d667d..089197f8 100644 --- a/backend/member/src/main/resources/application-prod.yml +++ b/backend/member/src/main/resources/application-prod.yml @@ -16,7 +16,7 @@ spring: tomcat.initial-size: 3 # 적절한 수치로 조정 jpa: hibernate: - ddl-auto: create + ddl-auto: update database: mysql database-platform: org.hibernate.dialect.MariaDBDialect generate-ddl: true diff --git a/backend/order/src/main/resources/application-prod.yml b/backend/order/src/main/resources/application-prod.yml index 11d824e0..a3c8651a 100644 --- a/backend/order/src/main/resources/application-prod.yml +++ b/backend/order/src/main/resources/application-prod.yml @@ -15,7 +15,7 @@ spring: driver-class-name: org.mariadb.jdbc.Driver jpa: hibernate: - ddl-auto: create + ddl-auto: update database: mysql database-platform: org.hibernate.dialect.MariaDBDialect generate-ddl: true diff --git a/backend/product/src/main/resources/application-prod.yml b/backend/product/src/main/resources/application-prod.yml index f3014f5d..8b6f1d66 100644 --- a/backend/product/src/main/resources/application-prod.yml +++ b/backend/product/src/main/resources/application-prod.yml @@ -16,7 +16,7 @@ spring: jpa: hibernate: - ddl-auto: create + ddl-auto: update database: mysql database-platform: org.hibernate.dialect.MariaDBDialect generate-ddl: true From a070c6213192d627f36c121a88909b15edadc02f Mon Sep 17 00:00:00 2001 From: Sejeong Kim Date: Sun, 3 Nov 2024 15:07:38 +0900 Subject: [PATCH 14/15] =?UTF-8?q?fix:=20=EC=98=81=EC=88=98=EC=A6=9D?= =?UTF-8?q?=EA=B3=BC=20order=20id=20=EC=9D=BC=EC=B9=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/apigateway/build.gradle | 2 +- backend/live/build.gradle | 2 +- .../src/main/resources/application-local.yml | 4 +++ backend/member/build.gradle | 2 +- .../api/SubscriptionController.java | 7 ++-- .../service/SubscriptionService.java | 1 + backend/order/build.gradle | 2 +- .../inong/common/client/MemberFeign.java | 2 ++ .../common/scheduler/PaymentScheduler.java | 2 +- .../domain/order/service/OrderService.java | 6 ++-- .../inong/domain/receipt/entity/Receipt.java | 1 - backend/product/build.gradle | 2 +- .../src/main/resources/application-local.yml | 2 +- k8s/.env | 36 +++++++++++++++++++ k8s/cert2.yml | 14 ++++++++ 15 files changed, 70 insertions(+), 15 deletions(-) create mode 100644 k8s/.env create mode 100644 k8s/cert2.yml diff --git a/backend/apigateway/build.gradle b/backend/apigateway/build.gradle index e0d94d33..76b2d18b 100644 --- a/backend/apigateway/build.gradle +++ b/backend/apigateway/build.gradle @@ -24,7 +24,7 @@ ext { dependencies { compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' -// implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' + implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' implementation 'org.springframework.cloud:spring-cloud-starter-gateway' implementation 'org.springframework.boot:spring-boot-starter-data-redis' implementation 'org.springframework.boot:spring-boot-starter-webflux' diff --git a/backend/live/build.gradle b/backend/live/build.gradle index 0accb13f..97be38c9 100644 --- a/backend/live/build.gradle +++ b/backend/live/build.gradle @@ -31,7 +31,7 @@ dependencies { compileOnly 'org.projectlombok:lombok' runtimeOnly 'org.mariadb.jdbc:mariadb-java-client' annotationProcessor 'org.projectlombok:lombok' -// implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' + implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' implementation 'org.springframework.cloud:spring-cloud-starter-openfeign' implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0' implementation 'org.springframework.kafka:spring-kafka' diff --git a/backend/live/src/main/resources/application-local.yml b/backend/live/src/main/resources/application-local.yml index 96d99d79..c073307c 100644 --- a/backend/live/src/main/resources/application-local.yml +++ b/backend/live/src/main/resources/application-local.yml @@ -2,6 +2,10 @@ server: port: 0 spring: + data: + redis: + port: 6379 + host: localhost config: activate: on-profile: local diff --git a/backend/member/build.gradle b/backend/member/build.gradle index 50c721d6..44b5154b 100644 --- a/backend/member/build.gradle +++ b/backend/member/build.gradle @@ -34,7 +34,7 @@ dependencies { compileOnly 'org.projectlombok:lombok' runtimeOnly 'org.mariadb.jdbc:mariadb-java-client' annotationProcessor 'org.projectlombok:lombok' -// implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' + implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' implementation 'org.springframework.cloud:spring-cloud-starter-openfeign' implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0' implementation 'org.springframework.kafka:spring-kafka' diff --git a/backend/member/src/main/java/org/samtuap/inong/domain/subscription/api/SubscriptionController.java b/backend/member/src/main/java/org/samtuap/inong/domain/subscription/api/SubscriptionController.java index 3cdbbcb6..06843ab7 100644 --- a/backend/member/src/main/java/org/samtuap/inong/domain/subscription/api/SubscriptionController.java +++ b/backend/member/src/main/java/org/samtuap/inong/domain/subscription/api/SubscriptionController.java @@ -6,15 +6,13 @@ import org.samtuap.inong.domain.member.dto.MemberSubscriptionListResponse; import org.samtuap.inong.domain.member.dto.MemberSubscriptionResponse; import org.samtuap.inong.domain.member.dto.PaymentMethodGetResponse; -import org.samtuap.inong.domain.subscription.dto.BillingKeyRegisterRequest; -import org.samtuap.inong.domain.subscription.dto.SubscribeProductRequest; -import org.samtuap.inong.domain.subscription.dto.SubscriptionGetResponse; -import org.samtuap.inong.domain.subscription.dto.SubscriptionListGetResponse; +import org.samtuap.inong.domain.subscription.dto.*; import org.samtuap.inong.domain.subscription.service.SubscriptionService; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; +import java.time.LocalDate; import java.util.List; import java.util.Optional; @@ -75,4 +73,5 @@ public ResponseEntity subscribeProduct(@Valid @RequestBody SubscribeProduc public Optional subscribeProduct(@PathVariable("productId") Long productId, @RequestHeader("myId") Long memberId) { return subscriptionService.getSubscriptionByProductId(productId, memberId); } + } diff --git a/backend/member/src/main/java/org/samtuap/inong/domain/subscription/service/SubscriptionService.java b/backend/member/src/main/java/org/samtuap/inong/domain/subscription/service/SubscriptionService.java index cca1842a..1f59d9b1 100644 --- a/backend/member/src/main/java/org/samtuap/inong/domain/subscription/service/SubscriptionService.java +++ b/backend/member/src/main/java/org/samtuap/inong/domain/subscription/service/SubscriptionService.java @@ -53,6 +53,7 @@ public void registerPaymentMethod(Long memberId, BillingKeyRegisterRequest reque } + @Transactional public SubscriptionListGetResponse getSubscriptionToPay() { List subscriptions = subscriptionRepository.findAllByPayDate(LocalDate.now()); diff --git a/backend/order/build.gradle b/backend/order/build.gradle index 9d7e1be4..309623b4 100644 --- a/backend/order/build.gradle +++ b/backend/order/build.gradle @@ -32,7 +32,7 @@ dependencies { runtimeOnly 'org.mariadb.jdbc:mariadb-java-client' annotationProcessor 'org.projectlombok:lombok' implementation 'io.jsonwebtoken:jjwt:0.9.1' -// implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' + implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' implementation 'org.springframework.cloud:spring-cloud-starter-openfeign' implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0' implementation 'org.springframework.kafka:spring-kafka' diff --git a/backend/order/src/main/java/org/samtuap/inong/common/client/MemberFeign.java b/backend/order/src/main/java/org/samtuap/inong/common/client/MemberFeign.java index 6a9258ad..d85dfa3c 100644 --- a/backend/order/src/main/java/org/samtuap/inong/common/client/MemberFeign.java +++ b/backend/order/src/main/java/org/samtuap/inong/common/client/MemberFeign.java @@ -10,6 +10,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; +import java.time.LocalDate; import java.util.List; import java.util.Optional; @@ -36,4 +37,5 @@ public interface MemberFeign { @GetMapping(value = "/subscription/product/{productId}") Optional getSubscriptionByProductId(@PathVariable("productId") Long productId, @RequestHeader("myId") Long memberId); + } diff --git a/backend/order/src/main/java/org/samtuap/inong/common/scheduler/PaymentScheduler.java b/backend/order/src/main/java/org/samtuap/inong/common/scheduler/PaymentScheduler.java index c894e3e7..1f8bc026 100644 --- a/backend/order/src/main/java/org/samtuap/inong/common/scheduler/PaymentScheduler.java +++ b/backend/order/src/main/java/org/samtuap/inong/common/scheduler/PaymentScheduler.java @@ -15,7 +15,7 @@ public class PaymentScheduler { private final OrderService orderService; @SchedulerLock(name = "shedLock_regular_payment", lockAtLeastFor = "1m", lockAtMostFor = "59m") - @Scheduled(cron = "0 0 13 * * *") + @Scheduled(cron = "0 0 7 * * *") public void regularPayment() { orderService.regularPay(); } diff --git a/backend/order/src/main/java/org/samtuap/inong/domain/order/service/OrderService.java b/backend/order/src/main/java/org/samtuap/inong/domain/order/service/OrderService.java index 3e8c0bf6..a17cea63 100644 --- a/backend/order/src/main/java/org/samtuap/inong/domain/order/service/OrderService.java +++ b/backend/order/src/main/java/org/samtuap/inong/domain/order/service/OrderService.java @@ -147,15 +147,14 @@ public PaymentResponse makeOrder(Long memberId, PaymentRequest reqDto, boolean i // 4. 최초 결제하기 String paymentId = kakaoPay(memberInfo, packageProduct, paidAmount, order); + log.info("line 150 >>>>>>>> {}", savedOrder.getId()); + // 5. 영수증 만들기 makeReceipt(savedOrder, packageProduct, paidAmount, paymentId); // 6. orderCount 증가 이벤트 발행 kafkaTemplate.send("order-count-topic", new KafkaOrderCountUpdateRequest(packageProduct.farmId(), packageProduct.id(), INCREASE)); - // 7. subscription payDate 변경 TODO - - // 8. 알림 발송 KafkaNotificationRequest notification = KafkaNotificationRequest.builder() @@ -289,6 +288,7 @@ public void regularPay() { } } + @Transactional public void makeReceipt(Ordering order, PackageProductResponse packageProduct, Long paidAmount, String paymentId) { Long beforePrice = packageProduct.price(); Long discountPrice = beforePrice - paidAmount; diff --git a/backend/order/src/main/java/org/samtuap/inong/domain/receipt/entity/Receipt.java b/backend/order/src/main/java/org/samtuap/inong/domain/receipt/entity/Receipt.java index b63f34c5..c7b972f9 100644 --- a/backend/order/src/main/java/org/samtuap/inong/domain/receipt/entity/Receipt.java +++ b/backend/order/src/main/java/org/samtuap/inong/domain/receipt/entity/Receipt.java @@ -22,7 +22,6 @@ @SQLRestriction("deleted_at is NULL") public class Receipt extends BaseEntity { @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "order_id") diff --git a/backend/product/build.gradle b/backend/product/build.gradle index ec8cf3d7..dbef528e 100644 --- a/backend/product/build.gradle +++ b/backend/product/build.gradle @@ -29,7 +29,7 @@ dependencies { runtimeOnly 'org.mariadb.jdbc:mariadb-java-client' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' -// implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' + implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0' implementation 'org.springframework.kafka:spring-kafka' implementation 'org.mindrot:jbcrypt:0.4' diff --git a/backend/product/src/main/resources/application-local.yml b/backend/product/src/main/resources/application-local.yml index 93293ccf..b805a10e 100644 --- a/backend/product/src/main/resources/application-local.yml +++ b/backend/product/src/main/resources/application-local.yml @@ -33,7 +33,7 @@ spring: data: redis: port: 6379 - host: 127.0.0.1 + host: localhost elasticsearch: uris: ${SPRING_ELASTICSEARCH_URIS} username: ${SPRING_ELASTICSEARCH_USERNAME} diff --git a/k8s/.env b/k8s/.env new file mode 100644 index 00000000..1c22315f --- /dev/null +++ b/k8s/.env @@ -0,0 +1,36 @@ +# OpenVidu configuration +# ---------------------- + +# 도메인 이름. 만약 도메인이 없다면 public IP주소로 설정 +DOMAIN_OR_PUBLIC_IP=https://openvidu.inong.shop + +# OpenVidu 서버에 연결하고 사용자가 OpenVidu 대시보드에 액세스하는 데 사용되는 OpenVidu Secret +OPENVIDU_SECRET=OPENVIDU_SECRET + +# Certificate type: +# - selfsigned: Self signed certificate. Not recommended for production use. +# Users will see an ERROR when connected to web page. +# - owncert: Valid certificate purchased in a Internet services company. +# Please put the certificates files inside folder ./owncert +# with names certificate.key and certificate.cert +# - letsencrypt: Generate a new certificate using letsencrypt. Please set the +# required contact email for Let's Encrypt in LETSENCRYPT_EMAIL +# variable. +# certbot에서 발급받은 ssl 인증서를 사용할 것이므로 letsencrypt +CERTIFICATE_TYPE=letsencrypt + +# If CERTIFICATE_TYPE=letsencrypt, you need to configure a valid email for notifications +LETSENCRYPT_EMAIL=clearrworld@gmail.com + +# Proxy configuration +# If you want to change the ports on which openvidu listens, uncomment the following lines + +# Allows any request to http://DOMAIN_OR_PUBLIC_IP:HTTP_PORT/ to be automatically +# redirected to https://DOMAIN_OR_PUBLIC_IP:HTTPS_PORT/. +# WARNING: the default port 80 cannot be changed during the first boot +# if you have chosen to deploy with the option CERTIFICATE_TYPE=letsencrypt +HTTP_PORT=8442 + +# Changes the port of all services exposed by OpenVidu. +# SDKs, REST clients and browsers will have to connect to this port +HTTPS_PORT=8443 diff --git a/k8s/cert2.yml b/k8s/cert2.yml new file mode 100644 index 00000000..6fc730af --- /dev/null +++ b/k8s/cert2.yml @@ -0,0 +1,14 @@ +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: inong-vue-app-tls +spec: + secretName: inong-vue-app-tls + duration: 2160h + renewBefore: 360h + issuerRef: + name: letsencrypt-prod + kind: ClusterIssuer + commonName: dev.inong.shop + dnsNames: + - dev.inong.shop From 12910346717d5f1ee436741a3b38509515ddc42b Mon Sep 17 00:00:00 2001 From: Sejeong Kim Date: Mon, 4 Nov 2024 09:59:30 +0900 Subject: [PATCH 15/15] =?UTF-8?q?del:=20=ED=95=84=EC=9A=94=EC=97=86?= =?UTF-8?q?=EB=8A=94=20=ED=8C=8C=EC=9D=BC=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- k8s/.env | 36 ------------------------------------ k8s/cert2.yml | 14 -------------- 2 files changed, 50 deletions(-) delete mode 100644 k8s/.env delete mode 100644 k8s/cert2.yml diff --git a/k8s/.env b/k8s/.env deleted file mode 100644 index 1c22315f..00000000 --- a/k8s/.env +++ /dev/null @@ -1,36 +0,0 @@ -# OpenVidu configuration -# ---------------------- - -# 도메인 이름. 만약 도메인이 없다면 public IP주소로 설정 -DOMAIN_OR_PUBLIC_IP=https://openvidu.inong.shop - -# OpenVidu 서버에 연결하고 사용자가 OpenVidu 대시보드에 액세스하는 데 사용되는 OpenVidu Secret -OPENVIDU_SECRET=OPENVIDU_SECRET - -# Certificate type: -# - selfsigned: Self signed certificate. Not recommended for production use. -# Users will see an ERROR when connected to web page. -# - owncert: Valid certificate purchased in a Internet services company. -# Please put the certificates files inside folder ./owncert -# with names certificate.key and certificate.cert -# - letsencrypt: Generate a new certificate using letsencrypt. Please set the -# required contact email for Let's Encrypt in LETSENCRYPT_EMAIL -# variable. -# certbot에서 발급받은 ssl 인증서를 사용할 것이므로 letsencrypt -CERTIFICATE_TYPE=letsencrypt - -# If CERTIFICATE_TYPE=letsencrypt, you need to configure a valid email for notifications -LETSENCRYPT_EMAIL=clearrworld@gmail.com - -# Proxy configuration -# If you want to change the ports on which openvidu listens, uncomment the following lines - -# Allows any request to http://DOMAIN_OR_PUBLIC_IP:HTTP_PORT/ to be automatically -# redirected to https://DOMAIN_OR_PUBLIC_IP:HTTPS_PORT/. -# WARNING: the default port 80 cannot be changed during the first boot -# if you have chosen to deploy with the option CERTIFICATE_TYPE=letsencrypt -HTTP_PORT=8442 - -# Changes the port of all services exposed by OpenVidu. -# SDKs, REST clients and browsers will have to connect to this port -HTTPS_PORT=8443 diff --git a/k8s/cert2.yml b/k8s/cert2.yml deleted file mode 100644 index 6fc730af..00000000 --- a/k8s/cert2.yml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: inong-vue-app-tls -spec: - secretName: inong-vue-app-tls - duration: 2160h - renewBefore: 360h - issuerRef: - name: letsencrypt-prod - kind: ClusterIssuer - commonName: dev.inong.shop - dnsNames: - - dev.inong.shop