puzhibing
2026-05-12 08cc6d5cf7e93b75cfabe7dcc2aeaa9afa1117eb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.xiaopeng.common.log.service;
 
import com.xiaopeng.api.feignClient.operation.SysLogClient;
import com.xiaopeng.api.model.operation.SysOperLog;
import com.xiaopeng.api.model.operation.XpAdminOperationLog;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
 
/**
 * 异步调用日志服务
 * 
 * @author xiaopeng
 */
@Service
public class AsyncLogService {
 
    @Resource
    private SysLogClient sysLogClient;
 
    /**
     * 保存系统日志记录
     */
    @Async
    public void saveSysLog(SysOperLog sysOperLog) throws Exception {
        sysLogClient.saveLog(sysOperLog);
    }
 
    /**
     * 保存管理后台操作记录
     */
    @Async
    public void saveAdminOperationLog(XpAdminOperationLog adminOperationLog) {
        sysLogClient.saveAdminOperationLog(adminOperationLog);
    }
}