You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
zhanglei 414580555e init 7 days ago
templates init 7 days ago
.gitignore Initial commit 7 days ago
README.md init 7 days ago
config.py init 7 days ago
config.yml init 7 days ago
db.py init 7 days ago
generator.py init 7 days ago
requirements.txt init 7 days ago
utils.py init 7 days ago

README.md

codegen

项目描述:

脚手架生成器,可以根据数据库的表生成可执行的完整项目.

基础组件 : java8(jdk corretto-1.8) + maven(3.8.0) + springboot + mybatis + mybatisplus

可选组件 : xxlJob + swagger + redis + mysql + minio + satoken

例如生成项目目录结构:

~~java src ├── main │ ├── java │ │ └── com │ │ └── test │ │ └── api │ │ ├── models │ │ │ ├── common │ │ │ └── config │ │ │ ├── MybatisPlusConfig.java │ │ │ ├── WebLogAspect.java │ │ │ └── unit │ │ │ ├── FilesUtil.java │ │ │ ├── Md5HashUtil.java │ │ │ └── vo │ │ │ └── Result.java │ │ ├── controller │ │ │ └── HealthFunController.java │ │ ├── entity │ │ │ ├── BaseEntity.java │ │ │ └── HealthFun.java │ │ ├── mapper │ │ │ └── HealthFunMapper.java │ │ ├── service │ │ │ ├── impl │ │ │ │ └── HealthFunMPJBaseServiceImpl.java │ │ │ └── HealthFunService.java │ │ └── Application.java │ └── resources │ ├── mappers │ │ └── HealthFunMapper.xml │ ├── application.yml │ ├── application-dev.yml │ └── logback.xml ├── test │ └── java │ └── com │ └── test │ └── api │ └── ApplicationTests.java └── pom.xml ~~

运行生成项目目录结构:

~~java codegen/ ├── generator.py 主函数 ├── config.yml 项目配置文件 ├── templates/ 模板文件 │ ├── entity.java.j2 │ ├── controller.java.j2 │ └── ... ├── utils.py 公共 方法 ├── db.py 数据库操作 └── requirements.txt 依赖包 ~~

已知可运行环境 Python 3.13.5

打包

Windows 运行命令:

python.exe -m pip install pyinstaller

python.exe -m PyInstaller --onefile --name generator generator.py

Mac/Linux 运行命令:

python3 -m pip install pyinstaller

python3 -m PyInstaller --onefile --name generator generator.py

执行

~~java generator.exe -h

options:
-h, --help     show this help message and exit
--tab TAB      表名,多个用逗号分隔,例如: tab,tab2
--model MODEL  可选模块 xxlJob,minio,saToken,swagger
--re           是否覆盖已存在文件(默认不覆盖)
--conf CONF    配置文件路径

generator.exe --conf ./config.yml --tab HealthFun
generator.exe --conf ./config.yml --tab HealthFun --model swagger

~~