Merge remote-tracking branch 'origin/master'

master
Cui YongXing 2024-09-10 01:13:29 +08:00
commit 9ec556f0e3
1 changed files with 9 additions and 23 deletions

View File

@ -129,43 +129,29 @@ public class RuleEngineVersionController {
// 定义模板字符串
String template = "package com.muyu.rule.common.engine;\n" +
"\n" +
"import cn.hutool.core.util.DesensitizedUtil;\n" +
"import com.alibaba.fastjson2.JSON;\n" +
"import com.alibaba.fastjson2.JSONObject;\n" +
"import com.muyu.etl.domain.DataValue;\n" +
"import com.muyu.rule.common.basic.abstracts." + parentClass + ";\n" +
"import com.muyu.rule.common.basic.abstracts.${parentClass};\n" +
"import com.muyu.rule.common.exception.DeliteException;\n" +
"\n" +
"\n" +
"/**\n" +
" * @Author张承志\n" +
" * @Packagecom.muyu.rule.server.basic.engine.row\n" +
" * @Packagecom.muyu.rule.server.basic.engine\n" +
" * @Projectcloud-etl-rule\n" +
" * @name数据集指定字段进行脱敏\n" +
" * @name${className}\n" +
" * @Date2024/8/30 11:13\n" +
" */\n" +
"\n" +
"public class ${className} extends " + parentClass + " {\n" +
"public class ${className} extends ${parentClass} {\n" +
"\n" +
" @Override\n" +
" public void run() {\n" +
"\n" +
" DataValue[][] dataValues = get();\n" +
"\n" +
" String dataValue = getDataValue();\n" +
"\n" +
" JSONObject jsonObject = JSON.parseObject(dataValue);\n" +
"\n" +
" String key = (String)jsonObject.get(\"key\");\n" +
"\n" +
" for (DataValue[] value : dataValues) {\n" +
" for (DataValue dataValue1 : value) {\n" +
" if (dataValue1.getKey().equals(key)) {\n" +
" dataValue1.setValue(DesensitizedUtil.mobilePhone((String) dataValue1.getValue()));\n" +
" }\n" +
" }\n" +
" if (dataValues == null || \"\".equals(dataValues) || \"null\".equals(dataValues)) {\n" +
" throw new DeliteException();\n" +
" }else {\n" +
" System.out.println(\"数据检测无异常\");\n" +
" }\n" +
" set(dataValues);\n" +
"\n" +
" }\n" +
"}\n";