This commit is contained in:
2024-02-26 17:48:13 +08:00
parent 3e612af044
commit bf0b4af434
4 changed files with 32 additions and 1 deletions

View File

@@ -2,6 +2,13 @@ package top.fatweb.oxygen.api.annotation
import java.lang.annotation.Inherited
/**
* Trim string annotation
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.CLASS, AnnotationTarget.PROPERTY)
@Retention(AnnotationRetention.RUNTIME)
@Inherited

View File

@@ -13,7 +13,7 @@ import top.fatweb.oxygen.api.vo.permission.LoginVo
import top.fatweb.oxygen.api.vo.permission.RegisterVo
/**
* Event log record aspect
* Event log record interceptor
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0

View File

@@ -31,6 +31,8 @@ import java.util.concurrent.Executor
* @since 1.0.0
* @see Executor
* @see ISysLogService
* @see HandlerInterceptor
* @see ResponseBodyAdvice
*/
@ControllerAdvice
class SysLogInterceptor(

View File

@@ -11,13 +11,35 @@ import kotlin.reflect.KMutableProperty
import kotlin.reflect.full.*
import kotlin.reflect.jvm.isAccessible
/**
* Trim string interceptor
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
* @see HandlerInterceptor
*/
@Component
@Aspect
class TrimInterceptor : HandlerInterceptor {
/**
* Trim pointcut
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
@Pointcut("@annotation(top.fatweb.oxygen.api.annotation.Trim)")
fun trimPointcut() {
}
/**
* Do before trim pointcut
*
* @param joinPoint Join point
* @return Arguments
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
* @see JoinPoint
*/
@Before("trimPointcut()")
fun doBefore(joinPoint: JoinPoint): Any {
val args = joinPoint.args