From 52cdfbe6d9bf1cd833a305e62ff000ad53a26cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=A5=8E=E5=85=B4?= <2220574228@qq.com> Date: Sun, 14 Dec 2025 14:29:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E5=A4=A7=E5=B0=8F=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/CamelCaseMapPlugin.java | 57 ------------------- .../infrastructure/util/CamelCaseUtils.java | 54 ------------------ .../config/CamelCaseMapPlugin.java | 57 ------------------- .../infrastructure/util/CamelCaseUtils.java | 54 ------------------ .../config/CamelCaseMapPlugin.java | 57 ------------------- .../infrastructure/util/CamelCaseUtils.java | 54 ------------------ .../domain/config/CamelCaseMapPlugin.java | 57 ------------------- .../product/domain/util/CamelCaseUtils.java | 54 ------------------ .../main/resources/mapper/menu/MenuMapper.xml | 4 +- .../config/CamelCaseMapPlugin.java | 57 ------------------- .../infrastructure/utils/CamelCaseUtils.java | 54 ------------------ .../config/CamelCaseMapPlugin.java | 57 ------------------- .../infrastructure/util/CamelCaseUtils.java | 54 ------------------ 13 files changed, 2 insertions(+), 668 deletions(-) delete mode 100644 mhd-modules/mhd-system/src/main/java/com/mhd/basic/infrastructure/config/CamelCaseMapPlugin.java delete mode 100644 mhd-modules/mhd-system/src/main/java/com/mhd/basic/infrastructure/util/CamelCaseUtils.java delete mode 100644 mhd-user-center/src/main/java/com/mhd/user/infrastructure/config/CamelCaseMapPlugin.java delete mode 100644 mhd-user-center/src/main/java/com/mhd/user/infrastructure/util/CamelCaseUtils.java delete mode 100644 mhd_finance/src/main/java/com/linke/finance/infrastructure/config/CamelCaseMapPlugin.java delete mode 100644 mhd_finance/src/main/java/com/linke/finance/infrastructure/util/CamelCaseUtils.java delete mode 100644 mhd_product/src/main/java/com/linke/product/domain/config/CamelCaseMapPlugin.java delete mode 100644 mhd_product/src/main/java/com/linke/product/domain/util/CamelCaseUtils.java delete mode 100644 mhd_thrid_party/src/main/java/com/linke/thirdParty/infrastructure/config/CamelCaseMapPlugin.java delete mode 100644 mhd_thrid_party/src/main/java/com/linke/thirdParty/infrastructure/utils/CamelCaseUtils.java delete mode 100644 mhd_transport/src/main/java/com/linke/transport/infrastructure/config/CamelCaseMapPlugin.java delete mode 100644 mhd_transport/src/main/java/com/linke/transport/infrastructure/util/CamelCaseUtils.java diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/infrastructure/config/CamelCaseMapPlugin.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/infrastructure/config/CamelCaseMapPlugin.java deleted file mode 100644 index ba41cf91d..000000000 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/infrastructure/config/CamelCaseMapPlugin.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.mhd.basic.infrastructure.config; - -import com.mhd.basic.infrastructure.util.CamelCaseUtils; -import org.apache.ibatis.executor.resultset.ResultSetHandler; -import org.apache.ibatis.plugin.*; -import org.springframework.stereotype.Component; - -import java.sql.Statement; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -/** - * MyBatis插件:拦截Map类型结果,转换Key为驼峰 - */ -@Intercepts({@Signature( - type = ResultSetHandler.class, - method = "handleResultSets", - args = {Statement.class} -)}) -@Component -public class CamelCaseMapPlugin implements Interceptor { - - @Override - public Object intercept(Invocation invocation) throws Throwable { - // 执行原方法获取结果 - Object result = invocation.proceed(); - // 处理结果:如果是List且元素是Map,转换Key - if (result instanceof List) { - List> list = (List>) result; - for (int i = 0; i < list.size(); i++) { - Object item = list.get(i); - if (item instanceof Map) { - @SuppressWarnings("unchecked") - Map map = (Map) item; - // 转换Key为驼峰 - list.set(i, CamelCaseUtils.convertMapKeyToCamel(map)); - } - } - } - return result; - } - - @Override - public Object plugin(Object target) { - // 只拦截ResultSetHandler类型 - if (target instanceof ResultSetHandler) { - return Plugin.wrap(target, this); - } - return target; - } - - @Override - public void setProperties(Properties properties) { - // 可配置参数,此处无需处理 - } -} \ No newline at end of file diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/infrastructure/util/CamelCaseUtils.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/infrastructure/util/CamelCaseUtils.java deleted file mode 100644 index 63f799bad..000000000 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/infrastructure/util/CamelCaseUtils.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.mhd.basic.infrastructure.util; - -import org.apache.commons.lang3.StringUtils; - -import java.util.HashMap; -import java.util.Map; - -/** - * 字符串工具类扩展:下划线/大写转驼峰 - */ -public class CamelCaseUtils { - - /** - * 大写下划线转驼峰(如:USER_NAME → userName) - */ - public static String toCamelCase(String str) { - if (StringUtils.isBlank(str)) { - return str; - } - // 先转小写,再处理下划线 - str = str.toLowerCase(); - StringBuilder sb = new StringBuilder(); - boolean nextUpperCase = false; - for (int i = 0; i < str.length(); i++) { - char c = str.charAt(i); - if (c == '_') { - nextUpperCase = true; - } else { - if (nextUpperCase) { - sb.append(Character.toUpperCase(c)); - nextUpperCase = false; - } else { - sb.append(c); - } - } - } - return sb.toString(); - } - - /** - * 批量转换Map的Key为驼峰 - */ - public static Map convertMapKeyToCamel(Map map) { - if (map == null || map.isEmpty()) { - return map; - } - Map newMap = new HashMap<>(map.size()); - for (Map.Entry entry : map.entrySet()) { - String camelKey = toCamelCase(entry.getKey()); - newMap.put(camelKey, entry.getValue()); - } - return newMap; - } -} \ No newline at end of file diff --git a/mhd-user-center/src/main/java/com/mhd/user/infrastructure/config/CamelCaseMapPlugin.java b/mhd-user-center/src/main/java/com/mhd/user/infrastructure/config/CamelCaseMapPlugin.java deleted file mode 100644 index fd6b3fc2c..000000000 --- a/mhd-user-center/src/main/java/com/mhd/user/infrastructure/config/CamelCaseMapPlugin.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.mhd.user.infrastructure.config; - -import com.mhd.user.infrastructure.util.CamelCaseUtils; -import org.apache.ibatis.executor.resultset.ResultSetHandler; -import org.apache.ibatis.plugin.*; -import org.springframework.stereotype.Component; - -import java.sql.Statement; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -/** - * MyBatis插件:拦截Map类型结果,转换Key为驼峰 - */ -@Intercepts({@Signature( - type = ResultSetHandler.class, - method = "handleResultSets", - args = {Statement.class} -)}) -@Component -public class CamelCaseMapPlugin implements Interceptor { - - @Override - public Object intercept(Invocation invocation) throws Throwable { - // 执行原方法获取结果 - Object result = invocation.proceed(); - // 处理结果:如果是List且元素是Map,转换Key - if (result instanceof List) { - List> list = (List>) result; - for (int i = 0; i < list.size(); i++) { - Object item = list.get(i); - if (item instanceof Map) { - @SuppressWarnings("unchecked") - Map map = (Map) item; - // 转换Key为驼峰 - list.set(i, CamelCaseUtils.convertMapKeyToCamel(map)); - } - } - } - return result; - } - - @Override - public Object plugin(Object target) { - // 只拦截ResultSetHandler类型 - if (target instanceof ResultSetHandler) { - return Plugin.wrap(target, this); - } - return target; - } - - @Override - public void setProperties(Properties properties) { - // 可配置参数,此处无需处理 - } -} \ No newline at end of file diff --git a/mhd-user-center/src/main/java/com/mhd/user/infrastructure/util/CamelCaseUtils.java b/mhd-user-center/src/main/java/com/mhd/user/infrastructure/util/CamelCaseUtils.java deleted file mode 100644 index e10b3ad75..000000000 --- a/mhd-user-center/src/main/java/com/mhd/user/infrastructure/util/CamelCaseUtils.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.mhd.user.infrastructure.util; - -import org.apache.commons.lang3.StringUtils; - -import java.util.HashMap; -import java.util.Map; - -/** - * 字符串工具类扩展:下划线/大写转驼峰 - */ -public class CamelCaseUtils { - - /** - * 大写下划线转驼峰(如:USER_NAME → userName) - */ - public static String toCamelCase(String str) { - if (StringUtils.isBlank(str)) { - return str; - } - // 先转小写,再处理下划线 - str = str.toLowerCase(); - StringBuilder sb = new StringBuilder(); - boolean nextUpperCase = false; - for (int i = 0; i < str.length(); i++) { - char c = str.charAt(i); - if (c == '_') { - nextUpperCase = true; - } else { - if (nextUpperCase) { - sb.append(Character.toUpperCase(c)); - nextUpperCase = false; - } else { - sb.append(c); - } - } - } - return sb.toString(); - } - - /** - * 批量转换Map的Key为驼峰 - */ - public static Map convertMapKeyToCamel(Map map) { - if (map == null || map.isEmpty()) { - return map; - } - Map newMap = new HashMap<>(map.size()); - for (Map.Entry entry : map.entrySet()) { - String camelKey = toCamelCase(entry.getKey()); - newMap.put(camelKey, entry.getValue()); - } - return newMap; - } -} \ No newline at end of file diff --git a/mhd_finance/src/main/java/com/linke/finance/infrastructure/config/CamelCaseMapPlugin.java b/mhd_finance/src/main/java/com/linke/finance/infrastructure/config/CamelCaseMapPlugin.java deleted file mode 100644 index 524382f43..000000000 --- a/mhd_finance/src/main/java/com/linke/finance/infrastructure/config/CamelCaseMapPlugin.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.linke.finance.infrastructure.config; - -import com.linke.finance.infrastructure.util.CamelCaseUtils; -import org.apache.ibatis.executor.resultset.ResultSetHandler; -import org.apache.ibatis.plugin.*; -import org.springframework.stereotype.Component; - -import java.sql.Statement; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -/** - * MyBatis插件:拦截Map类型结果,转换Key为驼峰 - */ -@Intercepts({@Signature( - type = ResultSetHandler.class, - method = "handleResultSets", - args = {Statement.class} -)}) -@Component -public class CamelCaseMapPlugin implements Interceptor { - - @Override - public Object intercept(Invocation invocation) throws Throwable { - // 执行原方法获取结果 - Object result = invocation.proceed(); - // 处理结果:如果是List且元素是Map,转换Key - if (result instanceof List) { - List> list = (List>) result; - for (int i = 0; i < list.size(); i++) { - Object item = list.get(i); - if (item instanceof Map) { - @SuppressWarnings("unchecked") - Map map = (Map) item; - // 转换Key为驼峰 - list.set(i, CamelCaseUtils.convertMapKeyToCamel(map)); - } - } - } - return result; - } - - @Override - public Object plugin(Object target) { - // 只拦截ResultSetHandler类型 - if (target instanceof ResultSetHandler) { - return Plugin.wrap(target, this); - } - return target; - } - - @Override - public void setProperties(Properties properties) { - // 可配置参数,此处无需处理 - } -} \ No newline at end of file diff --git a/mhd_finance/src/main/java/com/linke/finance/infrastructure/util/CamelCaseUtils.java b/mhd_finance/src/main/java/com/linke/finance/infrastructure/util/CamelCaseUtils.java deleted file mode 100644 index c344f2535..000000000 --- a/mhd_finance/src/main/java/com/linke/finance/infrastructure/util/CamelCaseUtils.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.linke.finance.infrastructure.util; - -import org.apache.commons.lang3.StringUtils; - -import java.util.HashMap; -import java.util.Map; - -/** - * 字符串工具类扩展:下划线/大写转驼峰 - */ -public class CamelCaseUtils { - - /** - * 大写下划线转驼峰(如:USER_NAME → userName) - */ - public static String toCamelCase(String str) { - if (StringUtils.isBlank(str)) { - return str; - } - // 先转小写,再处理下划线 - str = str.toLowerCase(); - StringBuilder sb = new StringBuilder(); - boolean nextUpperCase = false; - for (int i = 0; i < str.length(); i++) { - char c = str.charAt(i); - if (c == '_') { - nextUpperCase = true; - } else { - if (nextUpperCase) { - sb.append(Character.toUpperCase(c)); - nextUpperCase = false; - } else { - sb.append(c); - } - } - } - return sb.toString(); - } - - /** - * 批量转换Map的Key为驼峰 - */ - public static Map convertMapKeyToCamel(Map map) { - if (map == null || map.isEmpty()) { - return map; - } - Map newMap = new HashMap<>(map.size()); - for (Map.Entry entry : map.entrySet()) { - String camelKey = toCamelCase(entry.getKey()); - newMap.put(camelKey, entry.getValue()); - } - return newMap; - } -} \ No newline at end of file diff --git a/mhd_product/src/main/java/com/linke/product/domain/config/CamelCaseMapPlugin.java b/mhd_product/src/main/java/com/linke/product/domain/config/CamelCaseMapPlugin.java deleted file mode 100644 index c00d8d9f1..000000000 --- a/mhd_product/src/main/java/com/linke/product/domain/config/CamelCaseMapPlugin.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.linke.product.domain.config; - -import com.linke.product.domain.util.CamelCaseUtils; -import org.apache.ibatis.executor.resultset.ResultSetHandler; -import org.apache.ibatis.plugin.*; -import org.springframework.stereotype.Component; - -import java.sql.Statement; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -/** - * MyBatis插件:拦截Map类型结果,转换Key为驼峰 - */ -@Intercepts({@Signature( - type = ResultSetHandler.class, - method = "handleResultSets", - args = {Statement.class} -)}) -@Component -public class CamelCaseMapPlugin implements Interceptor { - - @Override - public Object intercept(Invocation invocation) throws Throwable { - // 执行原方法获取结果 - Object result = invocation.proceed(); - // 处理结果:如果是List且元素是Map,转换Key - if (result instanceof List) { - List> list = (List>) result; - for (int i = 0; i < list.size(); i++) { - Object item = list.get(i); - if (item instanceof Map) { - @SuppressWarnings("unchecked") - Map map = (Map) item; - // 转换Key为驼峰 - list.set(i, CamelCaseUtils.convertMapKeyToCamel(map)); - } - } - } - return result; - } - - @Override - public Object plugin(Object target) { - // 只拦截ResultSetHandler类型 - if (target instanceof ResultSetHandler) { - return Plugin.wrap(target, this); - } - return target; - } - - @Override - public void setProperties(Properties properties) { - // 可配置参数,此处无需处理 - } -} \ No newline at end of file diff --git a/mhd_product/src/main/java/com/linke/product/domain/util/CamelCaseUtils.java b/mhd_product/src/main/java/com/linke/product/domain/util/CamelCaseUtils.java deleted file mode 100644 index 64768e1fe..000000000 --- a/mhd_product/src/main/java/com/linke/product/domain/util/CamelCaseUtils.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.linke.product.domain.util; - -import org.apache.commons.lang3.StringUtils; - -import java.util.HashMap; -import java.util.Map; - -/** - * 字符串工具类扩展:下划线/大写转驼峰 - */ -public class CamelCaseUtils { - - /** - * 大写下划线转驼峰(如:USER_NAME → userName) - */ - public static String toCamelCase(String str) { - if (StringUtils.isBlank(str)) { - return str; - } - // 先转小写,再处理下划线 - str = str.toLowerCase(); - StringBuilder sb = new StringBuilder(); - boolean nextUpperCase = false; - for (int i = 0; i < str.length(); i++) { - char c = str.charAt(i); - if (c == '_') { - nextUpperCase = true; - } else { - if (nextUpperCase) { - sb.append(Character.toUpperCase(c)); - nextUpperCase = false; - } else { - sb.append(c); - } - } - } - return sb.toString(); - } - - /** - * 批量转换Map的Key为驼峰 - */ - public static Map convertMapKeyToCamel(Map map) { - if (map == null || map.isEmpty()) { - return map; - } - Map newMap = new HashMap<>(map.size()); - for (Map.Entry entry : map.entrySet()) { - String camelKey = toCamelCase(entry.getKey()); - newMap.put(camelKey, entry.getValue()); - } - return newMap; - } -} \ No newline at end of file diff --git a/mhd_product/src/main/resources/mapper/menu/MenuMapper.xml b/mhd_product/src/main/resources/mapper/menu/MenuMapper.xml index 2e49952ab..a41bf6c67 100644 --- a/mhd_product/src/main/resources/mapper/menu/MenuMapper.xml +++ b/mhd_product/src/main/resources/mapper/menu/MenuMapper.xml @@ -273,8 +273,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"