Browse Source
1. 规则引擎将枚举变量替换为枚举值返回给客户端。 2. 决策引擎增加血缘关系查询 前端核心发布: 8.2.134 1. 修改错误处理机制 2. 决策引擎增加血缘关系查询main
9 changed files with 217 additions and 18 deletions
@ -1,11 +1,11 @@ |
|||||
package io.sc.engine.rule.server.blood.service; |
package io.sc.engine.rule.server.blood.service; |
||||
|
|
||||
import io.sc.engine.rule.server.model.vo.ModelVo; |
|
||||
import io.sc.engine.rule.server.resource.vo.ResourceVo; |
import io.sc.engine.rule.server.resource.vo.ResourceVo; |
||||
import io.sc.platform.orm.service.support.QueryParameter; |
import io.sc.platform.orm.service.support.QueryParameter; |
||||
|
|
||||
import java.util.List; |
import java.util.List; |
||||
|
|
||||
public interface BloodService { |
public interface BloodService { |
||||
public List<ResourceVo> findByCodeOrNameContains(QueryParameter queryParameter) throws Exception; |
public List<ResourceVo> findResourcesByParameterCodeAndNameAndType(QueryParameter queryParameter) throws Exception; |
||||
|
public List<ResourceVo> findResourcesByIndicator(String libCode,Integer libVersion,String IndicatorCode) throws Exception; |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,30 @@ |
|||||
|
package io.sc.platform.jdbc.util; |
||||
|
|
||||
|
/** |
||||
|
* 防止 SQL 注入工具类 |
||||
|
*/ |
||||
|
public class SqlInjectionPreventer { |
||||
|
private static final String[] STRING_ESCAPED_CHARACTERS = { |
||||
|
"'", "\"", "\\", "&", ",", ";", " " |
||||
|
}; |
||||
|
|
||||
|
public static String escapeString(String input) { |
||||
|
StringBuilder escaped = new StringBuilder(); |
||||
|
for (char c : input.toCharArray()) { |
||||
|
if (isEscapeCharacter(c)) { |
||||
|
escaped.append('\\'); |
||||
|
} |
||||
|
escaped.append(c); |
||||
|
} |
||||
|
return escaped.toString(); |
||||
|
} |
||||
|
|
||||
|
public static boolean isEscapeCharacter(char c) { |
||||
|
for (String escapeChar : STRING_ESCAPED_CHARACTERS) { |
||||
|
if (c == escapeChar.charAt(0)) { |
||||
|
return true; |
||||
|
} |
||||
|
} |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue