# oneGenerator **Repository Path**: wyh5215321/one-generator ## Basic Information - **Project Name**: oneGenerator - **Description**: 自定义模板生成器,通过提供的自定义模板源和数据源,生成对应的内容 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-06-06 - **Last Updated**: 2022-06-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 简介 使用者根据自定义模板内容和自己的数据源生成模板定义的格式或者一系列模板格式。解决重复重复工作量,或者使用批量修改比较复杂的情况 # 适用场景 - json/database/excel => 文本内容/数据库/表格内容 可以将json格式字符串、数据库中的表数据或者excel表格数据按照自定义模板格式转化成文本内容、数据库表数据或者表格内容 # 已完成 json =>json/excel excel =>json/excel # 使用说明 1. 复制build中的application.properties出来,修改对应的配置 - template.path 模板的绝对路径 - template.type 模板类型,一共三种:EXCEL(excel文件)/JSON(字符串文本)/DB(数据库表) - EXCEL 目前只支持横向的一行表头 ![excel_template.png](./img/excel_template.png) - JSON 使用#..# 用作占位符 ![json_template.png](./img/json_template.png) - template.exportPath 最终生成的绝对路径 - data.path 数据源的绝对路径 - data.type 模板源类型,一共三种:EXCEL(excel文件)/JSON(json字符串文本文件)/DB(数据库) - EXCEL ![excel_data.png](./img/excel_data.png) - JSON ![json_data.png](./img/json_data.png) 2. 在jar包同一目录下执行命令 ```shell java -jar -Dspring.config.location=./application.properties oneGenerator.jar ```