spring中当event事件被修改,就可以被监听类动态感知处理.将部分业务抽离出来
代码实现:
首先定义一个event 对象 继承 ApplicationEvent
定义一个 eventListen 事件监听对象 实现 ApplicationListener 范性为 事件对象
触发事件 定义一个接口来出来,实际业务代码出发也可以. pushEvent 是关键
实际接口

实现效果
