feat:() 添加数据库事件

dev.processing
晨哀 2024-10-04 10:25:26 +08:00
parent 98560aacdc
commit 0a2fc7a9ce
1 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,34 @@
package com.muyu.processing.listener;
import cn.hutool.json.JSONObject;
import com.muyu.processing.basic.EventCustom;
import com.muyu.processing.basic.EventListener;
import java.util.ArrayList;
/**
*
* @Author
* @Packagecom.muyu.processing.listener
* @Projectcar-cloud-server
* @nameAddDatabaseListener
* @Date2024/9/29 22:25
*/
public class AddDatabaseListener implements EventListener {
@Override
public void onEvent(EventCustom event) {
JSONObject jsonObject = event.getData();
ArrayList<Object> keys = new ArrayList<>();
ArrayList<Object> values = new ArrayList<>();
jsonObject.forEach((key, value) ->{
keys.add(key);
values.add(value);
});
// 添加数据库
}
@Override
public void onApplicationEvent(EventCustom event) {
onEvent(event);
}
}