From 39f8dad3c0523712a82fd71d4769e94285b8b927 Mon Sep 17 00:00:00 2001 From: Chinwat K Date: Fri, 22 Mar 2024 22:04:35 +0700 Subject: [PATCH] feature-toggle - apply on promotion controller --- .../com/kampus/kbazaar/promotion/PromotionController.java | 5 +++++ kbazaar/src/main/resources/application.properties | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/kbazaar/src/main/java/com/kampus/kbazaar/promotion/PromotionController.java b/kbazaar/src/main/java/com/kampus/kbazaar/promotion/PromotionController.java index 2a836c1..f5fade1 100644 --- a/kbazaar/src/main/java/com/kampus/kbazaar/promotion/PromotionController.java +++ b/kbazaar/src/main/java/com/kampus/kbazaar/promotion/PromotionController.java @@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import java.util.List; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -13,6 +14,10 @@ @RestController @RequestMapping("/api/v1") +@ConditionalOnProperty( + value = "feature.toggle.promotion-api", + havingValue = "true", + matchIfMissing = true) public class PromotionController { private PromotionService promotionService; diff --git a/kbazaar/src/main/resources/application.properties b/kbazaar/src/main/resources/application.properties index 3042185..bc1ae2c 100644 --- a/kbazaar/src/main/resources/application.properties +++ b/kbazaar/src/main/resources/application.properties @@ -18,5 +18,6 @@ spring.sql.init.schema-locations=classpath:sql/schema/*.sql spring.sql.init.data-locations=classpath:sql/data/*.sql security.jwt.secret= +#feature.toggle.promotion-api=false # swagger -springdoc.swagger-ui.enabled=true \ No newline at end of file +springdoc.swagger-ui.enabled=true