---添加事件监听测试
This commit is contained in:
@ -0,0 +1,34 @@
|
||||
package com.xjrsoft.module;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.pictc.listener.ListenerParameterContext;
|
||||
import com.pictc.listener.ListenerR;
|
||||
import com.pictc.listener.PEventListener;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ListenerDemo {
|
||||
|
||||
@PEventListener("#source == 'lng_upload_file'")
|
||||
public ListenerR<Long> add(ListenerParameterContext context){
|
||||
log.info("表名:{}",context.getSource());
|
||||
Map<String,Object> data = (Map<String, Object>) context.getData();
|
||||
log.info("数据:{}",data);
|
||||
return ListenerR.success(1L);
|
||||
}
|
||||
|
||||
|
||||
@PEventListener
|
||||
public ListenerR<Long> add2(ListenerParameterContext context){
|
||||
Map<String,Object> data = (Map<String, Object>) context.getData();
|
||||
log.info("表名:{}",context.getSource());
|
||||
log.info("数据:{}",data);
|
||||
return ListenerR.success(1L);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user