linzhijie
2021-03-11 93af1c6ffb9ae0e894689ad3a37b548e57d54cff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package com.ots.project.exam.listener;
 
import com.ots.project.exam.service.UserEventLogService;
import lombok.AllArgsConstructor;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
 
@Component
@AllArgsConstructor
public class UserLogListener implements ApplicationListener<UserEvent> {
 
    //这个入库的用代码生成
    private UserEventLogService userEventLogService;
 
    @Override
    public void onApplicationEvent(UserEvent userEvent) {
        userEventLogService.insertByFilter(userEvent.getUserEventLog());
    }
 
}