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