From a53aa786e1d994b9a11b9105317501298d5676f1 Mon Sep 17 00:00:00 2001 From: guqing <38999863+guqing@users.noreply.github.com> Date: Sat, 28 Sep 2024 18:43:42 +0800 Subject: [PATCH] chore: reorganize package structure for content stats updater (#6699) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /milestone 2.20.x /area core #### What this PR does / why we need it: 将内容管理相关的数据更新类归档到 content 包下,如访问量和评论量统计 #### Does this PR introduce a user-facing change? ```release-note None ``` --- .../run/halo/app/content/comment/AbstractCommentService.java | 4 ++-- .../java/run/halo/app/content/comment/CommentServiceImpl.java | 2 +- .../java/run/halo/app/content/comment/ReplyServiceImpl.java | 2 +- .../main/java/run/halo/app/content/impl/PostServiceImpl.java | 4 ++-- .../java/run/halo/app/content/impl/SinglePageServiceImpl.java | 4 ++-- .../halo/app/{metrics => content/stats}/PostStatsUpdater.java | 2 +- .../app/{metrics => content/stats}/ReplyEventReconciler.java | 2 +- .../run/halo/app/content/{ => stats}/TagPostCountUpdater.java | 3 ++- .../{metrics => content/stats}/VisitedEventReconciler.java | 3 ++- .../app/{metrics => content/stats}/VotedEventReconciler.java | 3 ++- .../halo/app/{metrics => core/counter}/CounterService.java | 2 +- .../app/{metrics => core/counter}/CounterServiceImpl.java | 2 +- .../run/halo/app/{metrics => core/counter}/MeterUtils.java | 2 +- .../java/run/halo/app/core/reconciler/CommentReconciler.java | 2 +- .../run/halo/app/core/reconciler/PostCounterReconciler.java | 2 +- .../java/run/halo/app/core/reconciler/PostReconciler.java | 4 ++-- .../run/halo/app/core/reconciler/SinglePageReconciler.java | 4 ++-- .../java/run/halo/app/event/post/PostStatsChangedEvent.java | 2 +- .../app/theme/finders/impl/CommentPublicQueryServiceImpl.java | 4 ++-- .../app/theme/finders/impl/PostPublicQueryServiceImpl.java | 4 ++-- .../theme/finders/impl/SinglePageConversionServiceImpl.java | 4 ++-- .../run/halo/app/content/comment/CommentServiceImplTest.java | 4 ++-- .../halo/app/{metrics => core/counter}/MeterUtilsTest.java | 2 +- .../halo/app/core/reconciler/SinglePageReconcilerTest.java | 3 +-- .../theme/finders/impl/CommentPublicQueryServiceImplTest.java | 2 +- .../run/halo/app/theme/finders/impl/PostFinderImplTest.java | 2 +- 26 files changed, 38 insertions(+), 36 deletions(-) rename application/src/main/java/run/halo/app/{metrics => content/stats}/PostStatsUpdater.java (98%) rename application/src/main/java/run/halo/app/{metrics => content/stats}/ReplyEventReconciler.java (99%) rename application/src/main/java/run/halo/app/content/{ => stats}/TagPostCountUpdater.java (98%) rename application/src/main/java/run/halo/app/{metrics => content/stats}/VisitedEventReconciler.java (98%) rename application/src/main/java/run/halo/app/{metrics => content/stats}/VotedEventReconciler.java (98%) rename application/src/main/java/run/halo/app/{metrics => core/counter}/CounterService.java (88%) rename application/src/main/java/run/halo/app/{metrics => core/counter}/CounterServiceImpl.java (95%) rename application/src/main/java/run/halo/app/{metrics => core/counter}/MeterUtils.java (99%) rename application/src/test/java/run/halo/app/{metrics => core/counter}/MeterUtilsTest.java (99%) diff --git a/application/src/main/java/run/halo/app/content/comment/AbstractCommentService.java b/application/src/main/java/run/halo/app/content/comment/AbstractCommentService.java index 3ebc08df8f..9c054ea399 100644 --- a/application/src/main/java/run/halo/app/content/comment/AbstractCommentService.java +++ b/application/src/main/java/run/halo/app/content/comment/AbstractCommentService.java @@ -5,14 +5,14 @@ import org.springframework.security.core.context.ReactiveSecurityContextHolder; import org.springframework.util.Assert; import reactor.core.publisher.Mono; +import run.halo.app.core.counter.CounterService; +import run.halo.app.core.counter.MeterUtils; import run.halo.app.core.extension.User; import run.halo.app.core.extension.content.Comment; import run.halo.app.core.extension.content.Reply; import run.halo.app.core.user.service.RoleService; import run.halo.app.core.user.service.UserService; import run.halo.app.extension.ReactiveExtensionClient; -import run.halo.app.metrics.CounterService; -import run.halo.app.metrics.MeterUtils; import run.halo.app.security.authorization.AuthorityUtils; @RequiredArgsConstructor diff --git a/application/src/main/java/run/halo/app/content/comment/CommentServiceImpl.java b/application/src/main/java/run/halo/app/content/comment/CommentServiceImpl.java index 76e985aae7..202298d1cf 100644 --- a/application/src/main/java/run/halo/app/content/comment/CommentServiceImpl.java +++ b/application/src/main/java/run/halo/app/content/comment/CommentServiceImpl.java @@ -16,6 +16,7 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.util.retry.Retry; +import run.halo.app.core.counter.CounterService; import run.halo.app.core.extension.content.Comment; import run.halo.app.core.user.service.RoleService; import run.halo.app.core.user.service.UserService; @@ -29,7 +30,6 @@ import run.halo.app.extension.router.selector.FieldSelector; import run.halo.app.infra.SystemConfigurableEnvironmentFetcher; import run.halo.app.infra.exception.AccessDeniedException; -import run.halo.app.metrics.CounterService; import run.halo.app.plugin.extensionpoint.ExtensionGetter; /** diff --git a/application/src/main/java/run/halo/app/content/comment/ReplyServiceImpl.java b/application/src/main/java/run/halo/app/content/comment/ReplyServiceImpl.java index 54687b9292..fc72507a2c 100644 --- a/application/src/main/java/run/halo/app/content/comment/ReplyServiceImpl.java +++ b/application/src/main/java/run/halo/app/content/comment/ReplyServiceImpl.java @@ -20,6 +20,7 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.util.retry.Retry; +import run.halo.app.core.counter.CounterService; import run.halo.app.core.extension.content.Comment; import run.halo.app.core.extension.content.Reply; import run.halo.app.core.user.service.RoleService; @@ -31,7 +32,6 @@ import run.halo.app.extension.ReactiveExtensionClient; import run.halo.app.extension.router.selector.FieldSelector; import run.halo.app.infra.exception.RequestRestrictedException; -import run.halo.app.metrics.CounterService; /** * A default implementation of {@link ReplyService}. diff --git a/application/src/main/java/run/halo/app/content/impl/PostServiceImpl.java b/application/src/main/java/run/halo/app/content/impl/PostServiceImpl.java index b8a12c0f04..5e805ac9ac 100644 --- a/application/src/main/java/run/halo/app/content/impl/PostServiceImpl.java +++ b/application/src/main/java/run/halo/app/content/impl/PostServiceImpl.java @@ -30,6 +30,8 @@ import run.halo.app.content.PostRequest; import run.halo.app.content.PostService; import run.halo.app.content.Stats; +import run.halo.app.core.counter.CounterService; +import run.halo.app.core.counter.MeterUtils; import run.halo.app.core.extension.content.Category; import run.halo.app.core.extension.content.Post; import run.halo.app.core.extension.content.Snapshot; @@ -43,8 +45,6 @@ import run.halo.app.extension.router.selector.FieldSelector; import run.halo.app.infra.Condition; import run.halo.app.infra.ConditionStatus; -import run.halo.app.metrics.CounterService; -import run.halo.app.metrics.MeterUtils; /** * A default implementation of {@link PostService}. diff --git a/application/src/main/java/run/halo/app/content/impl/SinglePageServiceImpl.java b/application/src/main/java/run/halo/app/content/impl/SinglePageServiceImpl.java index 868ca69dfc..5fafa17562 100644 --- a/application/src/main/java/run/halo/app/content/impl/SinglePageServiceImpl.java +++ b/application/src/main/java/run/halo/app/content/impl/SinglePageServiceImpl.java @@ -25,6 +25,8 @@ import run.halo.app.content.SinglePageRequest; import run.halo.app.content.SinglePageService; import run.halo.app.content.Stats; +import run.halo.app.core.counter.CounterService; +import run.halo.app.core.counter.MeterUtils; import run.halo.app.core.extension.content.Post; import run.halo.app.core.extension.content.SinglePage; import run.halo.app.core.extension.content.Snapshot; @@ -34,8 +36,6 @@ import run.halo.app.extension.Ref; import run.halo.app.infra.Condition; import run.halo.app.infra.ConditionStatus; -import run.halo.app.metrics.CounterService; -import run.halo.app.metrics.MeterUtils; /** * Single page service implementation. diff --git a/application/src/main/java/run/halo/app/metrics/PostStatsUpdater.java b/application/src/main/java/run/halo/app/content/stats/PostStatsUpdater.java similarity index 98% rename from application/src/main/java/run/halo/app/metrics/PostStatsUpdater.java rename to application/src/main/java/run/halo/app/content/stats/PostStatsUpdater.java index f417c6e1ca..2a61889743 100644 --- a/application/src/main/java/run/halo/app/metrics/PostStatsUpdater.java +++ b/application/src/main/java/run/halo/app/content/stats/PostStatsUpdater.java @@ -1,4 +1,4 @@ -package run.halo.app.metrics; +package run.halo.app.content.stats; import java.time.Duration; import java.time.Instant; diff --git a/application/src/main/java/run/halo/app/metrics/ReplyEventReconciler.java b/application/src/main/java/run/halo/app/content/stats/ReplyEventReconciler.java similarity index 99% rename from application/src/main/java/run/halo/app/metrics/ReplyEventReconciler.java rename to application/src/main/java/run/halo/app/content/stats/ReplyEventReconciler.java index 9f0c5f4624..3a20f7af84 100644 --- a/application/src/main/java/run/halo/app/metrics/ReplyEventReconciler.java +++ b/application/src/main/java/run/halo/app/content/stats/ReplyEventReconciler.java @@ -1,4 +1,4 @@ -package run.halo.app.metrics; +package run.halo.app.content.stats; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; import static run.halo.app.extension.index.query.QueryFactory.and; diff --git a/application/src/main/java/run/halo/app/content/TagPostCountUpdater.java b/application/src/main/java/run/halo/app/content/stats/TagPostCountUpdater.java similarity index 98% rename from application/src/main/java/run/halo/app/content/TagPostCountUpdater.java rename to application/src/main/java/run/halo/app/content/stats/TagPostCountUpdater.java index 481da4559e..6221b2b03b 100644 --- a/application/src/main/java/run/halo/app/content/TagPostCountUpdater.java +++ b/application/src/main/java/run/halo/app/content/stats/TagPostCountUpdater.java @@ -1,4 +1,4 @@ -package run.halo.app.content; +package run.halo.app.content.stats; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; import static run.halo.app.extension.index.query.QueryFactory.and; @@ -12,6 +12,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.context.event.EventListener; import org.springframework.stereotype.Component; +import run.halo.app.content.AbstractEventReconciler; import run.halo.app.core.extension.content.Post; import run.halo.app.core.extension.content.Tag; import run.halo.app.core.extension.content.Tag.TagStatus; diff --git a/application/src/main/java/run/halo/app/metrics/VisitedEventReconciler.java b/application/src/main/java/run/halo/app/content/stats/VisitedEventReconciler.java similarity index 98% rename from application/src/main/java/run/halo/app/metrics/VisitedEventReconciler.java rename to application/src/main/java/run/halo/app/content/stats/VisitedEventReconciler.java index 968777a2cb..42b1932dd0 100644 --- a/application/src/main/java/run/halo/app/metrics/VisitedEventReconciler.java +++ b/application/src/main/java/run/halo/app/content/stats/VisitedEventReconciler.java @@ -1,4 +1,4 @@ -package run.halo.app.metrics; +package run.halo.app.content.stats; import java.time.Duration; import java.time.Instant; @@ -14,6 +14,7 @@ import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; +import run.halo.app.core.counter.MeterUtils; import run.halo.app.core.extension.Counter; import run.halo.app.event.post.VisitedEvent; import run.halo.app.extension.ExtensionClient; diff --git a/application/src/main/java/run/halo/app/metrics/VotedEventReconciler.java b/application/src/main/java/run/halo/app/content/stats/VotedEventReconciler.java similarity index 98% rename from application/src/main/java/run/halo/app/metrics/VotedEventReconciler.java rename to application/src/main/java/run/halo/app/content/stats/VotedEventReconciler.java index 915d498f4b..ed60a4130d 100644 --- a/application/src/main/java/run/halo/app/metrics/VotedEventReconciler.java +++ b/application/src/main/java/run/halo/app/content/stats/VotedEventReconciler.java @@ -1,4 +1,4 @@ -package run.halo.app.metrics; +package run.halo.app.content.stats; import java.time.Duration; import java.time.Instant; @@ -10,6 +10,7 @@ import org.springframework.context.event.EventListener; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; +import run.halo.app.core.counter.MeterUtils; import run.halo.app.core.extension.Counter; import run.halo.app.event.post.DownvotedEvent; import run.halo.app.event.post.UpvotedEvent; diff --git a/application/src/main/java/run/halo/app/metrics/CounterService.java b/application/src/main/java/run/halo/app/core/counter/CounterService.java similarity index 88% rename from application/src/main/java/run/halo/app/metrics/CounterService.java rename to application/src/main/java/run/halo/app/core/counter/CounterService.java index 8dcf3b9597..f3940c796f 100644 --- a/application/src/main/java/run/halo/app/metrics/CounterService.java +++ b/application/src/main/java/run/halo/app/core/counter/CounterService.java @@ -1,4 +1,4 @@ -package run.halo.app.metrics; +package run.halo.app.core.counter; import reactor.core.publisher.Mono; import run.halo.app.core.extension.Counter; diff --git a/application/src/main/java/run/halo/app/metrics/CounterServiceImpl.java b/application/src/main/java/run/halo/app/core/counter/CounterServiceImpl.java similarity index 95% rename from application/src/main/java/run/halo/app/metrics/CounterServiceImpl.java rename to application/src/main/java/run/halo/app/core/counter/CounterServiceImpl.java index 64727b5be2..d1be85fc77 100644 --- a/application/src/main/java/run/halo/app/metrics/CounterServiceImpl.java +++ b/application/src/main/java/run/halo/app/core/counter/CounterServiceImpl.java @@ -1,4 +1,4 @@ -package run.halo.app.metrics; +package run.halo.app.core.counter; import org.springframework.stereotype.Service; import reactor.core.publisher.Mono; diff --git a/application/src/main/java/run/halo/app/metrics/MeterUtils.java b/application/src/main/java/run/halo/app/core/counter/MeterUtils.java similarity index 99% rename from application/src/main/java/run/halo/app/metrics/MeterUtils.java rename to application/src/main/java/run/halo/app/core/counter/MeterUtils.java index c61c77345f..49b5356f31 100644 --- a/application/src/main/java/run/halo/app/metrics/MeterUtils.java +++ b/application/src/main/java/run/halo/app/core/counter/MeterUtils.java @@ -1,4 +1,4 @@ -package run.halo.app.metrics; +package run.halo.app.core.counter; import io.micrometer.core.instrument.Counter; import io.micrometer.core.instrument.MeterRegistry; diff --git a/application/src/main/java/run/halo/app/core/reconciler/CommentReconciler.java b/application/src/main/java/run/halo/app/core/reconciler/CommentReconciler.java index abcca19475..a651a09b5a 100644 --- a/application/src/main/java/run/halo/app/core/reconciler/CommentReconciler.java +++ b/application/src/main/java/run/halo/app/core/reconciler/CommentReconciler.java @@ -18,6 +18,7 @@ import org.springframework.stereotype.Component; import run.halo.app.content.comment.ReplyNotificationSubscriptionHelper; import run.halo.app.content.comment.ReplyService; +import run.halo.app.core.counter.MeterUtils; import run.halo.app.core.extension.Counter; import run.halo.app.core.extension.content.Comment; import run.halo.app.core.extension.content.Constant; @@ -36,7 +37,6 @@ import run.halo.app.extension.controller.Reconciler; import run.halo.app.extension.index.query.Query; import run.halo.app.extension.router.selector.FieldSelector; -import run.halo.app.metrics.MeterUtils; /** * Reconciler for {@link Comment}. diff --git a/application/src/main/java/run/halo/app/core/reconciler/PostCounterReconciler.java b/application/src/main/java/run/halo/app/core/reconciler/PostCounterReconciler.java index 24f8ada281..1e43f0c387 100644 --- a/application/src/main/java/run/halo/app/core/reconciler/PostCounterReconciler.java +++ b/application/src/main/java/run/halo/app/core/reconciler/PostCounterReconciler.java @@ -5,6 +5,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.context.ApplicationEventPublisher; import org.springframework.stereotype.Component; +import run.halo.app.core.counter.MeterUtils; import run.halo.app.core.extension.Counter; import run.halo.app.core.extension.content.Post; import run.halo.app.event.post.PostStatsChangedEvent; @@ -14,7 +15,6 @@ import run.halo.app.extension.controller.ControllerBuilder; import run.halo.app.extension.controller.Reconciler; import run.halo.app.extension.router.selector.FieldSelector; -import run.halo.app.metrics.MeterUtils; @Component @RequiredArgsConstructor diff --git a/application/src/main/java/run/halo/app/core/reconciler/PostReconciler.java b/application/src/main/java/run/halo/app/core/reconciler/PostReconciler.java index 5018b89aa7..9ada817e00 100644 --- a/application/src/main/java/run/halo/app/core/reconciler/PostReconciler.java +++ b/application/src/main/java/run/halo/app/core/reconciler/PostReconciler.java @@ -39,6 +39,8 @@ import run.halo.app.content.PostService; import run.halo.app.content.comment.CommentService; import run.halo.app.content.permalinks.PostPermalinkPolicy; +import run.halo.app.core.counter.CounterService; +import run.halo.app.core.counter.MeterUtils; import run.halo.app.core.extension.content.Constant; import run.halo.app.core.extension.content.Post; import run.halo.app.core.extension.content.Post.PostPhase; @@ -65,8 +67,6 @@ import run.halo.app.infra.Condition; import run.halo.app.infra.ConditionStatus; import run.halo.app.infra.utils.HaloUtils; -import run.halo.app.metrics.CounterService; -import run.halo.app.metrics.MeterUtils; import run.halo.app.notification.NotificationCenter; import run.halo.app.plugin.extensionpoint.ExtensionGetter; diff --git a/application/src/main/java/run/halo/app/core/reconciler/SinglePageReconciler.java b/application/src/main/java/run/halo/app/core/reconciler/SinglePageReconciler.java index d35a3cef65..a09d2b6966 100644 --- a/application/src/main/java/run/halo/app/core/reconciler/SinglePageReconciler.java +++ b/application/src/main/java/run/halo/app/core/reconciler/SinglePageReconciler.java @@ -23,6 +23,8 @@ import run.halo.app.content.NotificationReasonConst; import run.halo.app.content.SinglePageService; import run.halo.app.content.comment.CommentService; +import run.halo.app.core.counter.CounterService; +import run.halo.app.core.counter.MeterUtils; import run.halo.app.core.extension.content.Post; import run.halo.app.core.extension.content.SinglePage; import run.halo.app.core.extension.content.Snapshot; @@ -43,8 +45,6 @@ import run.halo.app.infra.ConditionStatus; import run.halo.app.infra.ExternalUrlSupplier; import run.halo.app.infra.utils.JsonUtils; -import run.halo.app.metrics.CounterService; -import run.halo.app.metrics.MeterUtils; import run.halo.app.notification.NotificationCenter; import run.halo.app.plugin.extensionpoint.ExtensionGetter; diff --git a/application/src/main/java/run/halo/app/event/post/PostStatsChangedEvent.java b/application/src/main/java/run/halo/app/event/post/PostStatsChangedEvent.java index aa936b821d..f574bca8e5 100644 --- a/application/src/main/java/run/halo/app/event/post/PostStatsChangedEvent.java +++ b/application/src/main/java/run/halo/app/event/post/PostStatsChangedEvent.java @@ -3,9 +3,9 @@ import lombok.Getter; import org.apache.commons.lang3.StringUtils; import org.springframework.context.ApplicationEvent; +import run.halo.app.core.counter.MeterUtils; import run.halo.app.core.extension.Counter; import run.halo.app.core.extension.content.Post; -import run.halo.app.metrics.MeterUtils; @Getter public class PostStatsChangedEvent extends ApplicationEvent { diff --git a/application/src/main/java/run/halo/app/theme/finders/impl/CommentPublicQueryServiceImpl.java b/application/src/main/java/run/halo/app/theme/finders/impl/CommentPublicQueryServiceImpl.java index be5f9e91f1..c32cdcbc73 100644 --- a/application/src/main/java/run/halo/app/theme/finders/impl/CommentPublicQueryServiceImpl.java +++ b/application/src/main/java/run/halo/app/theme/finders/impl/CommentPublicQueryServiceImpl.java @@ -24,6 +24,8 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import run.halo.app.content.comment.OwnerInfo; +import run.halo.app.core.counter.CounterService; +import run.halo.app.core.counter.MeterUtils; import run.halo.app.core.extension.User; import run.halo.app.core.extension.content.Comment; import run.halo.app.core.extension.content.Reply; @@ -38,8 +40,6 @@ import run.halo.app.extension.index.query.Query; import run.halo.app.extension.router.selector.FieldSelector; import run.halo.app.infra.AnonymousUserConst; -import run.halo.app.metrics.CounterService; -import run.halo.app.metrics.MeterUtils; import run.halo.app.theme.finders.CommentPublicQueryService; import run.halo.app.theme.finders.vo.CommentStatsVo; import run.halo.app.theme.finders.vo.CommentVo; diff --git a/application/src/main/java/run/halo/app/theme/finders/impl/PostPublicQueryServiceImpl.java b/application/src/main/java/run/halo/app/theme/finders/impl/PostPublicQueryServiceImpl.java index 201444d2cc..babe512a2f 100644 --- a/application/src/main/java/run/halo/app/theme/finders/impl/PostPublicQueryServiceImpl.java +++ b/application/src/main/java/run/halo/app/theme/finders/impl/PostPublicQueryServiceImpl.java @@ -11,13 +11,13 @@ import reactor.core.publisher.Mono; import run.halo.app.content.ContentWrapper; import run.halo.app.content.PostService; +import run.halo.app.core.counter.CounterService; +import run.halo.app.core.counter.MeterUtils; import run.halo.app.core.extension.content.Post; import run.halo.app.extension.ListOptions; import run.halo.app.extension.ListResult; import run.halo.app.extension.PageRequest; import run.halo.app.extension.ReactiveExtensionClient; -import run.halo.app.metrics.CounterService; -import run.halo.app.metrics.MeterUtils; import run.halo.app.plugin.extensionpoint.ExtensionGetter; import run.halo.app.theme.ReactivePostContentHandler; import run.halo.app.theme.finders.CategoryFinder; diff --git a/application/src/main/java/run/halo/app/theme/finders/impl/SinglePageConversionServiceImpl.java b/application/src/main/java/run/halo/app/theme/finders/impl/SinglePageConversionServiceImpl.java index a7e497a097..23d485d432 100644 --- a/application/src/main/java/run/halo/app/theme/finders/impl/SinglePageConversionServiceImpl.java +++ b/application/src/main/java/run/halo/app/theme/finders/impl/SinglePageConversionServiceImpl.java @@ -19,14 +19,14 @@ import reactor.core.publisher.Mono; import run.halo.app.content.ContentWrapper; import run.halo.app.content.SinglePageService; +import run.halo.app.core.counter.CounterService; +import run.halo.app.core.counter.MeterUtils; import run.halo.app.core.extension.content.SinglePage; import run.halo.app.extension.ListOptions; import run.halo.app.extension.ListResult; import run.halo.app.extension.PageRequest; import run.halo.app.extension.PageRequestImpl; import run.halo.app.extension.ReactiveExtensionClient; -import run.halo.app.metrics.CounterService; -import run.halo.app.metrics.MeterUtils; import run.halo.app.plugin.extensionpoint.ExtensionGetter; import run.halo.app.theme.ReactiveSinglePageContentHandler; import run.halo.app.theme.ReactiveSinglePageContentHandler.SinglePageContentContext; diff --git a/application/src/test/java/run/halo/app/content/comment/CommentServiceImplTest.java b/application/src/test/java/run/halo/app/content/comment/CommentServiceImplTest.java index f9a2f0bbb6..47a14342b9 100644 --- a/application/src/test/java/run/halo/app/content/comment/CommentServiceImplTest.java +++ b/application/src/test/java/run/halo/app/content/comment/CommentServiceImplTest.java @@ -29,6 +29,8 @@ import reactor.core.publisher.Mono; import reactor.test.StepVerifier; import run.halo.app.content.TestPost; +import run.halo.app.core.counter.CounterService; +import run.halo.app.core.counter.MeterUtils; import run.halo.app.core.extension.Counter; import run.halo.app.core.extension.User; import run.halo.app.core.extension.content.Comment; @@ -44,8 +46,6 @@ import run.halo.app.infra.SystemConfigurableEnvironmentFetcher; import run.halo.app.infra.SystemSetting; import run.halo.app.infra.utils.JsonUtils; -import run.halo.app.metrics.CounterService; -import run.halo.app.metrics.MeterUtils; import run.halo.app.plugin.extensionpoint.ExtensionGetter; import run.halo.app.security.authorization.AuthorityUtils; diff --git a/application/src/test/java/run/halo/app/metrics/MeterUtilsTest.java b/application/src/test/java/run/halo/app/core/counter/MeterUtilsTest.java similarity index 99% rename from application/src/test/java/run/halo/app/metrics/MeterUtilsTest.java rename to application/src/test/java/run/halo/app/core/counter/MeterUtilsTest.java index 8c83c68573..c7d5442720 100644 --- a/application/src/test/java/run/halo/app/metrics/MeterUtilsTest.java +++ b/application/src/test/java/run/halo/app/core/counter/MeterUtilsTest.java @@ -1,4 +1,4 @@ -package run.halo.app.metrics; +package run.halo.app.core.counter; import static org.assertj.core.api.Assertions.assertThat; diff --git a/application/src/test/java/run/halo/app/core/reconciler/SinglePageReconcilerTest.java b/application/src/test/java/run/halo/app/core/reconciler/SinglePageReconcilerTest.java index 6b7ce7fbb9..8e2c7ac1df 100644 --- a/application/src/test/java/run/halo/app/core/reconciler/SinglePageReconcilerTest.java +++ b/application/src/test/java/run/halo/app/core/reconciler/SinglePageReconcilerTest.java @@ -30,16 +30,15 @@ import run.halo.app.content.NotificationReasonConst; import run.halo.app.content.SinglePageService; import run.halo.app.content.TestPost; +import run.halo.app.core.counter.CounterService; import run.halo.app.core.extension.content.Post; import run.halo.app.core.extension.content.SinglePage; import run.halo.app.core.extension.content.Snapshot; import run.halo.app.core.extension.notification.Subscription; -import run.halo.app.core.reconciler.SinglePageReconciler; import run.halo.app.extension.ExtensionClient; import run.halo.app.extension.Metadata; import run.halo.app.extension.controller.Reconciler; import run.halo.app.infra.ExternalUrlSupplier; -import run.halo.app.metrics.CounterService; import run.halo.app.notification.NotificationCenter; import run.halo.app.plugin.extensionpoint.ExtensionGetter; diff --git a/application/src/test/java/run/halo/app/theme/finders/impl/CommentPublicQueryServiceImplTest.java b/application/src/test/java/run/halo/app/theme/finders/impl/CommentPublicQueryServiceImplTest.java index 54fbf17eaa..a27a027059 100644 --- a/application/src/test/java/run/halo/app/theme/finders/impl/CommentPublicQueryServiceImplTest.java +++ b/application/src/test/java/run/halo/app/theme/finders/impl/CommentPublicQueryServiceImplTest.java @@ -20,6 +20,7 @@ import org.skyscreamer.jsonassert.JSONAssert; import org.springframework.test.context.junit.jupiter.SpringExtension; import reactor.core.publisher.Mono; +import run.halo.app.core.counter.CounterService; import run.halo.app.core.extension.Counter; import run.halo.app.core.extension.User; import run.halo.app.core.extension.content.Comment; @@ -32,7 +33,6 @@ import run.halo.app.extension.Ref; import run.halo.app.infra.AnonymousUserConst; import run.halo.app.infra.utils.JsonUtils; -import run.halo.app.metrics.CounterService; /** * Tests for {@link CommentFinderImpl}. diff --git a/application/src/test/java/run/halo/app/theme/finders/impl/PostFinderImplTest.java b/application/src/test/java/run/halo/app/theme/finders/impl/PostFinderImplTest.java index b6d383cf1e..d119c2278e 100644 --- a/application/src/test/java/run/halo/app/theme/finders/impl/PostFinderImplTest.java +++ b/application/src/test/java/run/halo/app/theme/finders/impl/PostFinderImplTest.java @@ -19,12 +19,12 @@ import org.springframework.data.domain.Sort; import reactor.core.publisher.Mono; import run.halo.app.content.PostService; +import run.halo.app.core.counter.CounterService; import run.halo.app.core.extension.content.Post; import run.halo.app.extension.ListResult; import run.halo.app.extension.Metadata; import run.halo.app.extension.PageRequest; import run.halo.app.extension.ReactiveExtensionClient; -import run.halo.app.metrics.CounterService; import run.halo.app.theme.finders.CategoryFinder; import run.halo.app.theme.finders.ContributorFinder; import run.halo.app.theme.finders.PostPublicQueryService;