fix: ScriptUtils加toDouble+PluginContext桩补字段匹配新脚本
This commit is contained in:
@@ -300,5 +300,11 @@ public class GroovyScriptEngine {
|
|||||||
public long parseHtmlSize(String s) {
|
public long parseHtmlSize(String s) {
|
||||||
return parseTraffic(s);
|
return parseTraffic(s);
|
||||||
}
|
}
|
||||||
|
/** 字符串转 double,失败返回 0 */
|
||||||
|
public double toDouble(String s) {
|
||||||
|
if (s == null || s.isBlank()) return 0;
|
||||||
|
try { return Double.parseDouble(s.replace(",", "")); }
|
||||||
|
catch (NumberFormatException e) { return 0; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,23 @@
|
|||||||
package com.par.core.adapter;
|
package com.par.core.adapter;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PluginContext 桩类,仅供 Groovy 脚本编译通过。
|
* PluginContext 桩类,仅供 Groovy 脚本编译通过。
|
||||||
* PAR 只调用脚本中的 parse() 方法,不会使用此类。
|
* PAR 只调用脚本中的 parse() 方法,不会使用此类。
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public class PluginContext {
|
public class PluginContext {
|
||||||
public Site site;
|
public Object site;
|
||||||
public Object httpClient;
|
public Object httpClient;
|
||||||
|
|
||||||
public static class Site {
|
|
||||||
public String authorization;
|
|
||||||
public String siteUrl;
|
public String siteUrl;
|
||||||
}
|
public String url;
|
||||||
|
public String auth;
|
||||||
|
public String authType;
|
||||||
|
public String body;
|
||||||
|
public Map<String, Object> params;
|
||||||
|
public boolean incomplete;
|
||||||
|
|
||||||
|
public String fetch() { return ""; }
|
||||||
|
public String post() { return ""; }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user