package com.cool.bang.core.aspect;

import com.cool.bang.modules.system.domain.po.Log;
import com.cool.bang.modules.system.service.ILogService;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;

/**
 * Async Log (日志异步保存)
 *
 * @author PeiZhi Guo
 * 2021-04-23 10:12
 */
@Component
@EnableAsync
public class AsyncLog {

    @Resource
    private ILogService sysLogService;

    /**
     * 执 行 日 志 入 库 操 作
     * */
    @Async
    public void record(Log sysLog){
        sysLogService.save(sysLog);
    }
}
