Commit a29e38e6 authored by Quxl's avatar Quxl

x

parent d765f15b
...@@ -23,6 +23,7 @@ import com.egolm.common.StringUtil; ...@@ -23,6 +23,7 @@ import com.egolm.common.StringUtil;
import com.egolm.common.bean.Rjx; import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.JdbcTemplate; import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.sentinel.config.ExceptionHandler; import com.egolm.sentinel.config.ExceptionHandler;
import com.egolm.sentinel.config.XRException;
@RestController @RestController
public class SqlTestController { public class SqlTestController {
...@@ -57,12 +58,17 @@ public class SqlTestController { ...@@ -57,12 +58,17 @@ public class SqlTestController {
if(StringUtil.isNotBlank(parameters)) { if(StringUtil.isNotBlank(parameters)) {
List<String> parametersSplitAry = Arrays.asList(parameters.split(",\\s+")); List<String> parametersSplitAry = Arrays.asList(parameters.split(",\\s+"));
for(String arg : parametersSplitAry) { for(String arg : parametersSplitAry) {
arg = arg.trim();
if(arg.matches("[0-9]+")) { if(arg.matches("[0-9]+")) {
argList.add(Long.valueOf(arg)); argList.add(Long.valueOf(arg));
} else if(arg.matches("([0-9]+)?\\.[0-9]+")) { } else if(arg.matches("([0-9]+)?\\.[0-9]+")) {
argList.add(Double.valueOf(arg)); argList.add(Double.valueOf(arg));
} else if(arg.startsWith("\"") && arg.endsWith("\"")) {
argList.add(StringUtil.trim(arg, "\""));
} else if(arg.startsWith("'") && arg.endsWith("'")) {
argList.add(StringUtil.trim(arg, "'"));
} else { } else {
argList.add(arg.trim()); throw new XRException("参数错误");
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment