Giter Club home page Giter Club logo

gen-code's Introduction

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/

后续更新替换jar文件和view文件夹即可。

  • 方式二:本地构建镜像

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

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

其它

工程说明

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

本地开发

  • 运行gen下的com.gitee.gen.GenApplication(SpringBoot工程)
  • 运行front下的前端项目,详见:readme

参与贡献

欢迎贡献代码,完善功能,PR请提交到pr分支

自主构建

需要安装Maven3,Java8

  • 自动构建[推荐]:

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

  • 手动构建:

    前提:安装nodejs,Java8,maven3

    cd front

    • 执行npm install --registry=https://registry.npm.taobao.org
    • 执行npm run build:prod

    cd ..

    • 执行mvn clean package,在gen/target下会生成一个gen-1.0.0-SNAPSHOT.jar(xx表示本号)
    • gen-1.0.0-SNAPSHOT.jar放在dist/gen下,确保jar和view在同一目录
    • 执行java -jar gen-xx-SNAPSHOT.jar
    • 浏览器访问http://localhost:6969/

构建多平台

  • 安装多平台buildx : docker buildx create --use --name m1_builder

  • 查看并启动 builder 实例:docker buildx inspect --bootstrap

  • 一次打包多平台镜像并推送

    • 打包多平台镜像并推送:docker buildx build -t tanghc2020/gen --platform=linux/amd64,linux/arm64/v8 . --push
  • 或打包保存在本地

    • 打包x64平台镜像在本地:docker buildx build -t tanghc2020/gen --platform=linux/amd64 -o type=docker .
    • 打包arm64平台镜像在本地:docker buildx build -t tanghc2020/gen --platform=linux/arm64/v8 -o type=docker .
  • 快速运行:docker run -d -p 6969:6969 tanghc2020/gen

效果图

代码生成

生成结果

gen-code's People

Contributors

409681336 avatar aircjm avatar dock-longzhe avatar jason0z avatar lkqm avatar thc75 avatar trainliang avatar weifanli avatar winminn avatar zhangshenglong521 avatar

Watchers

 avatar  avatar

gen-code's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.