Search in sources :

Example 1 with PlatformEnum

use of com.zyd.blog.business.enums.PlatformEnum in project OneBlog by zhangyd-c.

the class BussinessLogAspect method handle.

private void handle(ProceedingJoinPoint point) throws Exception {
    Method currentMethod = AspectUtil.INSTANCE.getMethod(point);
    // 获取操作名称
    BussinessLog annotation = currentMethod.getAnnotation(BussinessLog.class);
    boolean save = annotation.save();
    PlatformEnum platform = annotation.platform();
    String bussinessName = AspectUtil.INSTANCE.parseParams(point.getArgs(), annotation.value());
    String ua = RequestUtil.getUa();
    log.info("{} | {} - {} {} - {}", bussinessName, RequestUtil.getIp(), RequestUtil.getMethod(), RequestUtil.getRequestUrl(), ua);
    if (!save) {
        return;
    }
    logService.asyncSaveSystemLog(platform, bussinessName);
}
Also used : Method(java.lang.reflect.Method) BussinessLog(com.zyd.blog.business.annotation.BussinessLog) PlatformEnum(com.zyd.blog.business.enums.PlatformEnum)

Aggregations

BussinessLog (com.zyd.blog.business.annotation.BussinessLog)1 PlatformEnum (com.zyd.blog.business.enums.PlatformEnum)1 Method (java.lang.reflect.Method)1