data方法传入字符串时,输出加单引号。

This commit is contained in:
gezuao
2023-11-24 14:04:37 +08:00
parent d518c969e3
commit 2f86e34f31
11 changed files with 101 additions and 50 deletions

View File

@@ -132,7 +132,7 @@ public abstract class ELWrapper {
* @return {@link ELWrapper}
*/
protected ELWrapper data(String dataName, String jsonString){
setData(jsonString);
setData("'" + jsonString + "'");
setDataName(dataName);
return this;
}

View File

@@ -67,12 +67,7 @@ public class NodeELWrapper extends ELWrapper {
@Override
public NodeELWrapper data(String dataName, String jsonString) {
// try {
// JsonUtil.parseObject(jsonString);
// } catch (Exception e){
// throw new RuntimeException("字符串不符合Json格式");
// }
setData(jsonString);
setData("'" + jsonString + "'");
setDataName(dataName);
return this;
}
@@ -114,7 +109,6 @@ public class NodeELWrapper extends ELWrapper {
}
if(this.getData() != null){
elContext.append(StrUtil.format(".data({})", this.getDataName()));
// paramContext.append(StrUtil.format("{} = '{}'\n", this.getDataName(), this.getData()));
paramContext.append(StrUtil.format("{} = {}", this.getDataName(), this.getData())).append(";\n");
}
if(this.getMaxWaitSeconds() != null){