【7.3.2】【rule】更新一个资源替换的工具类

pull/43/MERGE
fengshuonan 2022-11-16 23:11:47 +08:00
parent f2eee7ee3f
commit 958b4aff91
1 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,38 @@
package cn.stylefeng.roses.kernel.rule.util;
import cn.hutool.core.util.StrUtil;
/**
* Guns
* <p>
* Gunsguns$
*
* @author fengshuonan
* @date 2022/11/16 23:07
*/
public class GunsResourceCodeUtil {
/**
* Guns
*/
public static final String GUNS_RES_PREFIX = "guns$";
/**
*
* <p>
* guns$sys_notice$add
* <p>
* {newAppCode}$sys_notice$add
*
* @author fengshuonan
* @date 2022/11/16 23:09
*/
public static String replace(String resourceCode, String newAppCode) {
if (StrUtil.isEmpty(resourceCode)) {
return "";
}
String newPrefix = newAppCode + "$";
return resourceCode.replaceFirst(GUNS_RES_PREFIX, newPrefix);
}
}