From aa4d70ce99ad4234d537727dfdab2e813a2e342f Mon Sep 17 00:00:00 2001 From: FatttSnake Date: Mon, 18 Dec 2023 18:28:38 +0800 Subject: [PATCH] Add kdoc --- .../fatweb/api/annotation/ApiController.kt | 9 +++++ .../fatweb/api/annotation/BaseController.kt | 8 +++++ .../fatweb/api/annotation/EventLogRecord.kt | 6 ++++ .../fatweb/api/annotation/HiddenController.kt | 9 +++++ .../top/fatweb/api/aop/EventLogAspect.kt | 6 ++++ .../api/config/WebMvcConfigurerConfig.kt | 8 +++++ .../api/config/WebMvcRegistrationsConfig.kt | 2 +- .../top/fatweb/api/vo/system/OnlineInfoVo.kt | 34 +++++++++++++++++++ 8 files changed, 81 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/top/fatweb/api/annotation/ApiController.kt b/src/main/kotlin/top/fatweb/api/annotation/ApiController.kt index 5649f5e..0382a56 100644 --- a/src/main/kotlin/top/fatweb/api/annotation/ApiController.kt +++ b/src/main/kotlin/top/fatweb/api/annotation/ApiController.kt @@ -5,6 +5,15 @@ import org.springframework.core.annotation.AliasFor import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController +/** + * API controller annotation + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + * @see Tag + * @see RequestMapping + * @see RestController + */ @Tag(name = "") @RequestMapping @RestController diff --git a/src/main/kotlin/top/fatweb/api/annotation/BaseController.kt b/src/main/kotlin/top/fatweb/api/annotation/BaseController.kt index 1d810f5..029fa05 100644 --- a/src/main/kotlin/top/fatweb/api/annotation/BaseController.kt +++ b/src/main/kotlin/top/fatweb/api/annotation/BaseController.kt @@ -5,6 +5,14 @@ import org.springframework.core.annotation.AliasFor import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController +/** + * Base controller annotation + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + * @see RequestMapping + * @see RestController + */ @Tag(name = "") @RequestMapping @RestController diff --git a/src/main/kotlin/top/fatweb/api/annotation/EventLogRecord.kt b/src/main/kotlin/top/fatweb/api/annotation/EventLogRecord.kt index 2cdda01..4eb87e0 100644 --- a/src/main/kotlin/top/fatweb/api/annotation/EventLogRecord.kt +++ b/src/main/kotlin/top/fatweb/api/annotation/EventLogRecord.kt @@ -2,6 +2,12 @@ package top.fatweb.api.annotation import top.fatweb.api.entity.system.EventLog +/** + * Event log record annotation + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ @Target(AnnotationTarget.FUNCTION) @Retention(AnnotationRetention.RUNTIME) annotation class EventLogRecord( diff --git a/src/main/kotlin/top/fatweb/api/annotation/HiddenController.kt b/src/main/kotlin/top/fatweb/api/annotation/HiddenController.kt index ef121b3..5e593e5 100644 --- a/src/main/kotlin/top/fatweb/api/annotation/HiddenController.kt +++ b/src/main/kotlin/top/fatweb/api/annotation/HiddenController.kt @@ -5,6 +5,15 @@ import org.springframework.core.annotation.AliasFor import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController +/** + * Hidden controller annotation + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + * @see Hidden + * @see RequestMapping + * @see RestController + */ @Hidden @RequestMapping @RestController diff --git a/src/main/kotlin/top/fatweb/api/aop/EventLogAspect.kt b/src/main/kotlin/top/fatweb/api/aop/EventLogAspect.kt index 87fb550..44c3a54 100644 --- a/src/main/kotlin/top/fatweb/api/aop/EventLogAspect.kt +++ b/src/main/kotlin/top/fatweb/api/aop/EventLogAspect.kt @@ -13,6 +13,12 @@ import top.fatweb.api.entity.system.EventLog import top.fatweb.api.service.system.IEventLogService import top.fatweb.api.util.WebUtil +/** + * Event log record aspect + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ @Aspect @Component class EventLogAspect( diff --git a/src/main/kotlin/top/fatweb/api/config/WebMvcConfigurerConfig.kt b/src/main/kotlin/top/fatweb/api/config/WebMvcConfigurerConfig.kt index ceed4df..f2453a8 100644 --- a/src/main/kotlin/top/fatweb/api/config/WebMvcConfigurerConfig.kt +++ b/src/main/kotlin/top/fatweb/api/config/WebMvcConfigurerConfig.kt @@ -1,10 +1,18 @@ package top.fatweb.api.config +import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations import org.springframework.context.annotation.Configuration import org.springframework.web.servlet.config.annotation.PathMatchConfigurer import org.springframework.web.servlet.config.annotation.WebMvcConfigurer import top.fatweb.api.annotation.ApiController +/** + * Web MVC configurer configuration + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + * @see WebMvcRegistrations + */ @Configuration class WebMvcConfigurerConfig : WebMvcConfigurer { override fun configurePathMatch(configurer: PathMatchConfigurer) { diff --git a/src/main/kotlin/top/fatweb/api/config/WebMvcRegistrationsConfig.kt b/src/main/kotlin/top/fatweb/api/config/WebMvcRegistrationsConfig.kt index 6fcf518..d5a1a26 100644 --- a/src/main/kotlin/top/fatweb/api/config/WebMvcRegistrationsConfig.kt +++ b/src/main/kotlin/top/fatweb/api/config/WebMvcRegistrationsConfig.kt @@ -6,7 +6,7 @@ import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandl import top.fatweb.api.util.ApiResponseMappingHandlerMapping /** - * Web MVC configuration + * Web MVC registrations configuration * * @author FatttSnake, fatttsnake@gmail.com * @since 1.0.0 diff --git a/src/main/kotlin/top/fatweb/api/vo/system/OnlineInfoVo.kt b/src/main/kotlin/top/fatweb/api/vo/system/OnlineInfoVo.kt index 9164ff3..982671e 100644 --- a/src/main/kotlin/top/fatweb/api/vo/system/OnlineInfoVo.kt +++ b/src/main/kotlin/top/fatweb/api/vo/system/OnlineInfoVo.kt @@ -2,12 +2,46 @@ package top.fatweb.api.vo.system import java.time.LocalDateTime +/** + * Online information value object + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ data class OnlineInfoVo( + /** + * Number of user currently online + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ val current: Long, + + /** + * Online number history + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + * @see HistoryVo + */ val history: List ) { data class HistoryVo ( + /** + * Time + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + * @see LocalDateTime + */ val time: LocalDateTime, + + /** + * Record + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ val record: String ) }