Search in sources :

Example 1 with SimpleTemplateEngine

use of com.ikoori.vip.server.core.template.engine.SimpleTemplateEngine 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();
}
Also used : ContextConfig(com.ikoori.vip.server.core.template.config.ContextConfig) GunsTemplateEngine(com.ikoori.vip.server.core.template.engine.base.GunsTemplateEngine) SimpleTemplateEngine(com.ikoori.vip.server.core.template.engine.SimpleTemplateEngine)

Example 2 with SimpleTemplateEngine

use of com.ikoori.vip.server.core.template.engine.SimpleTemplateEngine 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;
}
Also used : ContextConfig(com.ikoori.vip.server.core.template.config.ContextConfig) GunsTemplateEngine(com.ikoori.vip.server.core.template.engine.base.GunsTemplateEngine) BussinessException(com.ikoori.vip.common.exception.BussinessException) SimpleTemplateEngine(com.ikoori.vip.server.core.template.engine.SimpleTemplateEngine) ApiOperation(io.swagger.annotations.ApiOperation) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

ContextConfig (com.ikoori.vip.server.core.template.config.ContextConfig)2 SimpleTemplateEngine (com.ikoori.vip.server.core.template.engine.SimpleTemplateEngine)2 GunsTemplateEngine (com.ikoori.vip.server.core.template.engine.base.GunsTemplateEngine)2 Permission (com.ikoori.vip.common.annotion.Permission)1 BussinessException (com.ikoori.vip.common.exception.BussinessException)1 ApiOperation (io.swagger.annotations.ApiOperation)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1