From 66cc9a8bb9b69aa1f82f358a3661e28106d37abc Mon Sep 17 00:00:00 2001 From: Azmi Touil Date: Thu, 10 Oct 2024 15:40:58 +0200 Subject: [PATCH] feat: Enhance Spring Bean API Definition - MEED-7576 - Meeds-io/meeds#2469 This change will allow to define API/Impl Spring Beans without having to declare the API as a Service Bean and the Implementation as Primary. --- .../github/gamification/services/GithubConsumerService.java | 2 -- .../github/gamification/services/GithubTriggerService.java | 2 -- .../io/meeds/github/gamification/services/WebhookService.java | 2 -- .../gamification/services/impl/GithubConsumerServiceImpl.java | 2 -- .../gamification/services/impl/GithubTriggerServiceImpl.java | 2 -- .../github/gamification/services/impl/WebhookServiceImpl.java | 2 -- 6 files changed, 12 deletions(-) diff --git a/gamification-github-services/src/main/java/io/meeds/github/gamification/services/GithubConsumerService.java b/gamification-github-services/src/main/java/io/meeds/github/gamification/services/GithubConsumerService.java index c25dfc29..681432c8 100644 --- a/gamification-github-services/src/main/java/io/meeds/github/gamification/services/GithubConsumerService.java +++ b/gamification-github-services/src/main/java/io/meeds/github/gamification/services/GithubConsumerService.java @@ -19,14 +19,12 @@ import io.meeds.github.gamification.model.RemoteOrganization; import io.meeds.github.gamification.model.WebHook; -import org.cometd.annotation.Service; import org.exoplatform.commons.exception.ObjectNotFoundException; import io.meeds.github.gamification.model.RemoteRepository; import io.meeds.github.gamification.model.TokenStatus; import java.util.List; -@Service public interface GithubConsumerService { /** diff --git a/gamification-github-services/src/main/java/io/meeds/github/gamification/services/GithubTriggerService.java b/gamification-github-services/src/main/java/io/meeds/github/gamification/services/GithubTriggerService.java index 5254d489..dbfbdea7 100644 --- a/gamification-github-services/src/main/java/io/meeds/github/gamification/services/GithubTriggerService.java +++ b/gamification-github-services/src/main/java/io/meeds/github/gamification/services/GithubTriggerService.java @@ -18,9 +18,7 @@ package io.meeds.github.gamification.services; import io.meeds.github.gamification.plugin.GithubTriggerPlugin; -import org.cometd.annotation.Service; -@Service public interface GithubTriggerService { /** diff --git a/gamification-github-services/src/main/java/io/meeds/github/gamification/services/WebhookService.java b/gamification-github-services/src/main/java/io/meeds/github/gamification/services/WebhookService.java index 8f78e4b4..553cd835 100644 --- a/gamification-github-services/src/main/java/io/meeds/github/gamification/services/WebhookService.java +++ b/gamification-github-services/src/main/java/io/meeds/github/gamification/services/WebhookService.java @@ -19,7 +19,6 @@ package io.meeds.github.gamification.services; import io.meeds.github.gamification.model.WebHook; -import org.cometd.annotation.Service; import org.exoplatform.commons.ObjectAlreadyExistsException; import org.exoplatform.commons.exception.ObjectNotFoundException; import io.meeds.github.gamification.model.RemoteRepository; @@ -28,7 +27,6 @@ import java.util.List; -@Service public interface WebhookService { /** diff --git a/gamification-github-services/src/main/java/io/meeds/github/gamification/services/impl/GithubConsumerServiceImpl.java b/gamification-github-services/src/main/java/io/meeds/github/gamification/services/impl/GithubConsumerServiceImpl.java index c4230341..7ddfae7c 100644 --- a/gamification-github-services/src/main/java/io/meeds/github/gamification/services/impl/GithubConsumerServiceImpl.java +++ b/gamification-github-services/src/main/java/io/meeds/github/gamification/services/impl/GithubConsumerServiceImpl.java @@ -25,12 +25,10 @@ import io.meeds.github.gamification.services.GithubConsumerService; import io.meeds.github.gamification.storage.GithubConsumerStorage; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Service; import java.util.List; -@Primary @Service public class GithubConsumerServiceImpl implements GithubConsumerService { diff --git a/gamification-github-services/src/main/java/io/meeds/github/gamification/services/impl/GithubTriggerServiceImpl.java b/gamification-github-services/src/main/java/io/meeds/github/gamification/services/impl/GithubTriggerServiceImpl.java index 13d909a6..cadf8aa3 100644 --- a/gamification-github-services/src/main/java/io/meeds/github/gamification/services/impl/GithubTriggerServiceImpl.java +++ b/gamification-github-services/src/main/java/io/meeds/github/gamification/services/impl/GithubTriggerServiceImpl.java @@ -37,7 +37,6 @@ import org.exoplatform.social.core.manager.IdentityManager; import org.picocontainer.Startable; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Service; import java.util.*; @@ -46,7 +45,6 @@ import static io.meeds.github.gamification.utils.Utils.*; -@Primary @Service public class GithubTriggerServiceImpl implements GithubTriggerService, Startable { diff --git a/gamification-github-services/src/main/java/io/meeds/github/gamification/services/impl/WebhookServiceImpl.java b/gamification-github-services/src/main/java/io/meeds/github/gamification/services/impl/WebhookServiceImpl.java index 241a850a..e1ecdfdf 100644 --- a/gamification-github-services/src/main/java/io/meeds/github/gamification/services/impl/WebhookServiceImpl.java +++ b/gamification-github-services/src/main/java/io/meeds/github/gamification/services/impl/WebhookServiceImpl.java @@ -43,14 +43,12 @@ import org.exoplatform.services.log.Log; import org.json.JSONObject; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Primary; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import static io.meeds.github.gamification.utils.Utils.*; -@Primary @Service public class WebhookServiceImpl implements WebhookService {