linzhijie
2021-03-11 c33914ba0a98c823c4b4d7da21cdd476906c9924
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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());
    }
}