From 0a2fc7a9ce1ac3a18601a09a398f67c0158693fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=A8=E5=93=80?= <2076029107@qq.com> Date: Fri, 4 Oct 2024 10:25:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:()=20=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../listener/AddDatabaseListener.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 cloud-modules/cloud-modules-processing/src/main/java/com/muyu/processing/listener/AddDatabaseListener.java diff --git a/cloud-modules/cloud-modules-processing/src/main/java/com/muyu/processing/listener/AddDatabaseListener.java b/cloud-modules/cloud-modules-processing/src/main/java/com/muyu/processing/listener/AddDatabaseListener.java new file mode 100644 index 0000000..006d5f2 --- /dev/null +++ b/cloud-modules/cloud-modules-processing/src/main/java/com/muyu/processing/listener/AddDatabaseListener.java @@ -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:杨鹏 + * @Package:com.muyu.processing.listener + * @Project:car-cloud-server + * @name:AddDatabaseListener + * @Date:2024/9/29 22:25 + */ +public class AddDatabaseListener implements EventListener { + @Override + public void onEvent(EventCustom event) { + JSONObject jsonObject = event.getData(); + ArrayList keys = new ArrayList<>(); + ArrayList values = new ArrayList<>(); + jsonObject.forEach((key, value) ->{ + keys.add(key); + values.add(value); + }); + // 添加数据库 + } + + @Override + public void onApplicationEvent(EventCustom event) { + onEvent(event); + } +}