This commit is contained in:
2023-12-18 18:28:38 +08:00
parent 0f5d1fad4b
commit aa4d70ce99
8 changed files with 81 additions and 1 deletions

View File

@@ -5,6 +5,15 @@ import org.springframework.core.annotation.AliasFor
import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController 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 = "") @Tag(name = "")
@RequestMapping @RequestMapping
@RestController @RestController

View File

@@ -5,6 +5,14 @@ import org.springframework.core.annotation.AliasFor
import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController 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 = "") @Tag(name = "")
@RequestMapping @RequestMapping
@RestController @RestController

View File

@@ -2,6 +2,12 @@ package top.fatweb.api.annotation
import top.fatweb.api.entity.system.EventLog import top.fatweb.api.entity.system.EventLog
/**
* Event log record annotation
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
@Target(AnnotationTarget.FUNCTION) @Target(AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
annotation class EventLogRecord( annotation class EventLogRecord(

View File

@@ -5,6 +5,15 @@ import org.springframework.core.annotation.AliasFor
import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController 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 @Hidden
@RequestMapping @RequestMapping
@RestController @RestController

View File

@@ -13,6 +13,12 @@ import top.fatweb.api.entity.system.EventLog
import top.fatweb.api.service.system.IEventLogService import top.fatweb.api.service.system.IEventLogService
import top.fatweb.api.util.WebUtil import top.fatweb.api.util.WebUtil
/**
* Event log record aspect
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
@Aspect @Aspect
@Component @Component
class EventLogAspect( class EventLogAspect(

View File

@@ -1,10 +1,18 @@
package top.fatweb.api.config package top.fatweb.api.config
import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations
import org.springframework.context.annotation.Configuration import org.springframework.context.annotation.Configuration
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer import org.springframework.web.servlet.config.annotation.PathMatchConfigurer
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
import top.fatweb.api.annotation.ApiController import top.fatweb.api.annotation.ApiController
/**
* Web MVC configurer configuration
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
* @see WebMvcRegistrations
*/
@Configuration @Configuration
class WebMvcConfigurerConfig : WebMvcConfigurer { class WebMvcConfigurerConfig : WebMvcConfigurer {
override fun configurePathMatch(configurer: PathMatchConfigurer) { override fun configurePathMatch(configurer: PathMatchConfigurer) {

View File

@@ -6,7 +6,7 @@ import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandl
import top.fatweb.api.util.ApiResponseMappingHandlerMapping import top.fatweb.api.util.ApiResponseMappingHandlerMapping
/** /**
* Web MVC configuration * Web MVC registrations configuration
* *
* @author FatttSnake, fatttsnake@gmail.com * @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0 * @since 1.0.0

View File

@@ -2,12 +2,46 @@ package top.fatweb.api.vo.system
import java.time.LocalDateTime import java.time.LocalDateTime
/**
* Online information value object
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
data class OnlineInfoVo( data class OnlineInfoVo(
/**
* Number of user currently online
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
val current: Long, val current: Long,
/**
* Online number history
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
* @see HistoryVo
*/
val history: List<HistoryVo> val history: List<HistoryVo>
) { ) {
data class HistoryVo ( data class HistoryVo (
/**
* Time
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
* @see LocalDateTime
*/
val time: LocalDateTime, val time: LocalDateTime,
/**
* Record
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
val record: String val record: String
) )
} }