Browse Source

fixed 会员等级编辑接口优化

fushengqian 3 weeks ago
parent
commit
33b7af298a

+ 4 - 1
fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendUserGradeController.java

@@ -195,7 +195,10 @@ public class BackendUserGradeController extends BaseController {
             return getFailureResult(201, "有效天数必须为正整数");
         }
         if (!CommonUtil.isNumeric(speedPoint) || Integer.parseInt(speedPoint) < 0) {
-            return getFailureResult(201, "积分加速必须为正整数");
+            return getFailureResult(201, "积分加速必须是数字");
+        }
+        if (!CommonUtil.isNumeric(catchValue)) {
+            return getFailureResult(201, "升级条件值必须是数字");
         }
         MtUserGrade mtUserGrade;
         if (StringUtil.isEmpty(id)) {

+ 4 - 9
fuint-utils/src/main/java/com/fuint/utils/StringUtil.java

@@ -4162,24 +4162,19 @@ public class StringUtil {
      * @param name 转换前的下划线大写方式命名的字符串
      * @return 转换后的驼峰式命名的字符串
      */
-    public static String convertToCamelCase(String name)
-    {
+    public static String convertToCamelCase(String name) {
         StringBuilder result = new StringBuilder();
         // 快速检查
-        if (name == null || name.isEmpty())
-        {
+        if (name == null || name.isEmpty()) {
             // 没必要转换
             return "";
-        }
-        else if (!name.contains("_"))
-        {
+        } else if (!name.contains("_")) {
             // 不含下划线,仅将首字母大写
             return name.substring(0, 1).toUpperCase() + name.substring(1);
         }
         // 用下划线将原始字符串分割
         String[] camels = name.split("_");
-        for (String camel : camels)
-        {
+        for (String camel : camels) {
             // 跳过原始字符串中开头、结尾的下换线或双重下划线
             if (camel.isEmpty())
             {