Commit a29e38e6 authored by Quxl's avatar Quxl

x

parent d765f15b
......@@ -23,6 +23,7 @@ import com.egolm.common.StringUtil;
import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.sentinel.config.ExceptionHandler;
import com.egolm.sentinel.config.XRException;
@RestController
public class SqlTestController {
......@@ -57,12 +58,17 @@ public class SqlTestController {
if(StringUtil.isNotBlank(parameters)) {
List<String> parametersSplitAry = Arrays.asList(parameters.split(",\\s+"));
for(String arg : parametersSplitAry) {
arg = arg.trim();
if(arg.matches("[0-9]+")) {
argList.add(Long.valueOf(arg));
} else if(arg.matches("([0-9]+)?\\.[0-9]+")) {
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 {
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