---添加事件监听测试

This commit is contained in:
2025-12-16 14:18:43 +08:00
parent 8c9dcae89e
commit e110d372f8
9 changed files with 140 additions and 30 deletions

View File

@ -33,7 +33,7 @@ public class UpdateLngBBankDto implements Serializable {
/**
* 助记码(自动生成4位0001……)
*/
@LogField(name="助记码(自动生成4位0001……)",index=1)
@LogField(name="助记码",index=1)
@ApiModelProperty("助记码(自动生成4位0001……)")
private String code;

View File

@ -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);
}
}