diff --git a/src/main/java/com/loafle/overflow/commons/service/MessagePublisher.java b/src/main/java/com/loafle/overflow/commons/service/MessagePublisher.java index f5200e7..75f7c06 100644 --- a/src/main/java/com/loafle/overflow/commons/service/MessagePublisher.java +++ b/src/main/java/com/loafle/overflow/commons/service/MessagePublisher.java @@ -6,4 +6,6 @@ public interface MessagePublisher { void publishToMember(final String channel, final String memberID, final String method, final Object... params); void publishToDomain(final String channel, final Domain domain, final String method, final Object... params); void publishToDomainByProbeKey(final String channel, final String probeKey, final String method, final Object... params); + void publishToProbe(final String channel, final String key, final String method, final Object... params); + } diff --git a/src/main/java/com/loafle/overflow/module/noauthprobe/service/NoAuthProbeService.java b/src/main/java/com/loafle/overflow/module/noauthprobe/service/NoAuthProbeService.java index c4bc0dd..54c6b74 100644 --- a/src/main/java/com/loafle/overflow/module/noauthprobe/service/NoAuthProbeService.java +++ b/src/main/java/com/loafle/overflow/module/noauthprobe/service/NoAuthProbeService.java @@ -104,11 +104,17 @@ public class NoAuthProbeService { this.probeService.regist(probe); this.noAuthProbeDAO.save(noAuthProbe); + + messagePublisher.publishToProbe("/auth", noAuthProbe.getTempProbeKey(), "NoAuthProbeService.acceptNoAuthProbe", probe.getProbeKey()); + return this.readAllByDomain(noAuthProbe.getDomain()); } public List denyNoauthProbe(NoAuthProbe noAuthProbe) { this.noAuthProbeDAO.save(noAuthProbe); + + messagePublisher.publishToProbe("/auth", noAuthProbe.getTempProbeKey(), "NoAuthProbeService.denyNoauthProbe"); + return this.readAllByDomain(noAuthProbe.getDomain()); } diff --git a/src/main/java/com/loafle/overflow/redis/service/RedisMessagePublisher.java b/src/main/java/com/loafle/overflow/redis/service/RedisMessagePublisher.java index 58f9ca3..7f18209 100644 --- a/src/main/java/com/loafle/overflow/redis/service/RedisMessagePublisher.java +++ b/src/main/java/com/loafle/overflow/redis/service/RedisMessagePublisher.java @@ -54,6 +54,12 @@ public class RedisMessagePublisher implements MessagePublisher { this.publish(channel, message, method, params); } + public void publishToProbe(final String channel, final String key, final String method, final Object... params) { + PublishMessage message = new PublishMessage(); + message.addTarget(key); + this.publish(channel, message, method, params); + } + @Cacheable("memberListByDomain") protected List getMemberListByDomain(final Domain domain) { return this.getMemberList(memberService.readAllByDomain(domain));