1 Star 0 Fork 879

pcchina / code-gen

forked from myproject / code-gen 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

code-gen

一款代码生成工具,可自定义模板生成不同的代码,支持MySQL、Oracle、SQL Server、PostgreSQL。

  • 只需要一个Java8环境,下载后即可运行使用。
  • 步骤简单,只需配置一个数据源,然后勾选模板即可生成代码。
  • 默认提供了通用的实体类、mybatis接口、mybatis配置文件模板,可以快速开发mybatis应用。

用到的技术:SpringBoot + Mybatis + Vue

使用步骤

  • 前往发行版页面,下载最新版本zip文件
  • 解压zip,如果是Mac/Linux操作系统,运行startup.sh文件启动,Windows操作系统运行cmd输入java -jar gen.jar启动
  • 浏览器访问http://localhost:6969/

默认端口是6969,更改端口号按如下方式:

  • Mac/Linux操作系统:打开startup.sh文件,修改--server.port参数值
  • Windows操作系统:可执行:java -jar gen.jar --server.port=端口号

docker运行

  • 方式一:下载公共镜像

docker pull tanghc2020/gen:latest

下载完毕后,执行docker run --name gen -p 6969:6969 -d <镜像ID>

浏览器访问http://ip:6969/

  • 方式二:本地构建镜像

clone代码,然后执行docker-build.sh脚本

执行docker run --name gen -p 6969:6969 -d <镜像ID>

其它

工程说明

  • front:前端vue
  • gen:后端服务
  • db:数据库初始化文件
  • script:辅助脚本

自主构建

需要安装Maven3,Java8

  • 自动构建[推荐]:

Mac/Linux系统可直接执行build.sh进行构建,构建结果在dist文件夹下。

  • 手动构建:

    cd front

    • 执行npm run build:prod进行打包,结果在dist下
    • 把dist中的所有文件,放到gen/src/main/resources/public

    cd ..

    • 执行mvn clean package,在gen/target下会生成一个gen-xx-SNAPSHOT.jar(xx表示本号)
    • gen-xx-SNAPSHOT.jar和db下的gen.db放在同一个文件夹下
    • 执行java -jar gen-xx-SNAPSHOT.jar
    • 浏览器访问http://localhost:6969/

效果图

代码生成

生成结果

沟通交流

Q群:167643071

MIT License Copyright (c) 2020 tanghc Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

一款代码生成工具,可自定义模板生成不同的代码,支持MySQL、Oracle、SQL Server、PostgreSQL 展开 收起
Java
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/pcchina/code-gen.git
git@gitee.com:pcchina/code-gen.git
pcchina
code-gen
code-gen
master

搜索帮助

14c37bed 8189591 565d56ea 8189591