use of com.ikoori.vip.server.core.template.config.ContextConfig in project vip by guangdada.
the class TemplateGenerator method main.
public static void main(String[] args) throws IOException {
ContextConfig contextConfig = new ContextConfig();
contextConfig.setBizChName("啊哈");
contextConfig.setBizEnName("haha");
contextConfig.setModuleName("tk");
contextConfig.setProjectPath("D:\\tmp\\guns");
// contextConfig.setAddPageSwitch(false);
// contextConfig.setEditPageSwitch(false);
GunsTemplateEngine gunsTemplateEngine = new SimpleTemplateEngine();
gunsTemplateEngine.setContextConfig(contextConfig);
gunsTemplateEngine.start();
}
use of com.ikoori.vip.server.core.template.config.ContextConfig in project vip by guangdada.
the class CodeController method add.
/**
* 代码生成
*/
@ApiOperation("生成代码")
@RequestMapping(value = "/generate", method = RequestMethod.POST)
@ResponseBody
@Permission(Const.ADMIN_NAME)
public Object add(@ApiParam(value = "模块名称", required = true) @RequestParam String moduleName, @RequestParam String bizChName, @RequestParam String bizEnName, @RequestParam String path) {
if (ToolUtil.isOneEmpty(bizChName, bizEnName)) {
throw new BussinessException(BizExceptionEnum.REQUEST_NULL);
}
ContextConfig contextConfig = new ContextConfig();
contextConfig.setBizChName(bizChName);
contextConfig.setBizEnName(bizEnName);
contextConfig.setModuleName(moduleName);
if (ToolUtil.isNotEmpty(path)) {
contextConfig.setProjectPath(path);
}
GunsTemplateEngine gunsTemplateEngine = new SimpleTemplateEngine();
gunsTemplateEngine.setContextConfig(contextConfig);
gunsTemplateEngine.start();
return super.SUCCESS_TIP;
}
use of com.ikoori.vip.server.core.template.config.ContextConfig in project vip by guangdada.
the class AbstractTemplateEngine method initConfig.
public void initConfig() {
if (this.contextConfig == null) {
this.contextConfig = new ContextConfig();
}
if (this.controllerConfig == null) {
this.controllerConfig = new ControllerConfig();
}
if (this.pageConfig == null) {
this.pageConfig = new PageConfig();
}
if (this.daoConfig == null) {
this.daoConfig = new DaoConfig();
}
if (this.serviceConfig == null) {
this.serviceConfig = new ServiceConfig();
}
this.controllerConfig.setContextConfig(this.contextConfig);
this.controllerConfig.init();
this.serviceConfig.setContextConfig(this.contextConfig);
this.serviceConfig.init();
this.daoConfig.setContextConfig(this.contextConfig);
this.daoConfig.init();
this.pageConfig.setContextConfig(this.contextConfig);
this.pageConfig.init();
}
Aggregations