-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Online代码生成不支持多级包名 #6703
Comments
有计划优化 |
贴一下临时解决办法: @Aspect
@Component
public class CodeGenAspect {
@Around("execution(* org.jeecg.modules.online.cgform.c.a.b(..))")
public Object aroundAdvice(ProceedingJoinPoint joinPoint) throws Throwable {
// 修改参数值
JSONObject arg = (JSONObject) joinPoint.getArgs()[0];
org.jeecg.modules.online.cgform.model.d var2 = JSONObject.parseObject(arg.toJSONString(), org.jeecg.modules.online.cgform.model.d.class);
String entityPackage = var2.getEntityPackage();
String[] packages = entityPackage.split("_");
ResourceBundle bundle = ResourceBundle.getBundle("jeecg/jeecg_config");
String bussiPackage = bundle.getString("bussi_package");
if (packages.length > 1) {
arg.put("entityPackage",packages[packages.length - 1]);
StringBuilder finalBussiPackage = new StringBuilder(bussiPackage);
for (int i = 0; i < packages.length - 1; i ) {
finalBussiPackage.append(".").append(packages[i]);
}
org.jeecgframework.codegenerate.a.a.g = finalBussiPackage.toString();
} else {
org.jeecgframework.codegenerate.a.a.g = bussiPackage;
}
// 调用原始方法
return joinPoint.proceed(joinPoint.getArgs());
}
} |
不支持 |
还有其他地方需要改 |
其他的地方我也没法追踪了,等着优化了,或者是否可以告知下还需要改动哪里 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
版本号:
v 3.7.0
问题描述:
Online代码生成不支持多级包名,
例如bussi_package配置为
com.xxx
,表名为emr_ns_record_config
生成的包名是
com.xxx.emr.ns.recordconf
.目前只能通过手动修改bussi_package实现,还要重启项目,比较麻烦
错误截图:
友情提示:
The text was updated successfully, but these errors were encountered: