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 import java.lang.annotation.Inherited
/**
* Trim string annotation
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.CLASS, AnnotationTarget.PROPERTY) @Target(AnnotationTarget.FUNCTION, AnnotationTarget.CLASS, AnnotationTarget.PROPERTY)
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
@Inherited @Inherited

View File

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

View File

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

View File

@@ -11,13 +11,35 @@ import kotlin.reflect.KMutableProperty
import kotlin.reflect.full.* import kotlin.reflect.full.*
import kotlin.reflect.jvm.isAccessible import kotlin.reflect.jvm.isAccessible
/**
* Trim string interceptor
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
* @see HandlerInterceptor
*/
@Component @Component
@Aspect @Aspect
class TrimInterceptor : HandlerInterceptor { class TrimInterceptor : HandlerInterceptor {
/**
* Trim pointcut
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
@Pointcut("@annotation(top.fatweb.oxygen.api.annotation.Trim)") @Pointcut("@annotation(top.fatweb.oxygen.api.annotation.Trim)")
fun trimPointcut() { 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()") @Before("trimPointcut()")
fun doBefore(joinPoint: JoinPoint): Any { fun doBefore(joinPoint: JoinPoint): Any {
val args = joinPoint.args val args = joinPoint.args