# 自定义一套生成器模板 ## 步骤 ### 一、添加一套新模板 在jeecg-boot-module-system项目的`resources/jeecg/code-template-online`添加custom ![](https://img.kancloud.cn/9d/dd/9ddda72ba9d0642793619ae3613d11c0_538x366.png) >[warning] 注意 >1.`custom/single/java/${bussiPackage}/${entityPackage}`每一层都是一个目录 >2.`java/${bussiPackage}/${entityPackage}`必须有 >3. 自定义模板需要修改的就是`custom/single`对应的位置,以及controller、entity等等里面的内容。 --- ### 二、修改枚举 修改`jeecg-boot-base-core`中的枚举类`CgformEnum`, 添加自定义的模板配置: `CUSTOM(1, "custom", "/jeecg/code-template-online", "custom.single", "自定义风格")` *注:每个模板信息需要具备以下5个属性信息* | 属性 |描述 | | --- | -------- | | type | 表类型 1 单表, 2 一对多,3 树, 如`1` | | code | 编码标识,保证唯一,如`custom` | | templatePath| 模板根路径,如 `/jeecg/code-template-online`| | stylePath| 模板相对路径,如 `custom.single`| | note| 模板风格描述,如 `自定义风格` | ---