From 484eb2bbc5f6a36f569eb590943c4ba0e261a2ee Mon Sep 17 00:00:00 2001 From: Fatead <893051689@qq.com> Date: Fri, 13 Aug 2021 14:26:15 +0800 Subject: [PATCH] A better annotation suggestion change the annotation from @component to @service, it is more appropriate here. This class is mainly responsible for the realization of business logic, which is recommended to use @service in the Spring framework. Moreover it can help you to achieve IOC. --- .../spring/reactive/security/service/MessageService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/rapha/spring/reactive/security/service/MessageService.java b/src/main/java/io/rapha/spring/reactive/security/service/MessageService.java index a5321f7..7962832 100644 --- a/src/main/java/io/rapha/spring/reactive/security/service/MessageService.java +++ b/src/main/java/io/rapha/spring/reactive/security/service/MessageService.java @@ -20,10 +20,10 @@ package io.rapha.spring.reactive.security.service; import io.rapha.spring.reactive.security.domain.FormattedMessage; -import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; import reactor.core.publisher.Flux; -@Component +@Service public class MessageService { public Flux getDefaultMessage(){