1 Star 1 Fork 2

liuyun073 / bizdk-generator

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

bizdk-generator

介绍

这个根据开源若依项目整理而成的代码生成器。

虽然现在市面上很多的代码生成器,但都不是很合自己意,所以根据开源代码整理了一个代码生成器,取名BIZDK代码生成器,无关框架,可以根据模板生成代码, 目前可以生成单表curd代码,支持主流数据库, 需要扩展的 可以fork自己开发~~~

之前也写了一个代码生成器,是根据jdc获取表结构来生成数据的, 但是很多数据库中间件并没有完全实现jdbc的规范,导致获取表结构存在数据缺失,生成的代码还是不是很理想,因此参考其他的开源代码生成器,重新整理了这个代码生成器,希望能符合大部分人的使用。 代码生成器是依托模板来生成代码,目前支持freemark,已经能满足我的工作需要,后面看时间,有空会增加其他的模板和功能。

下面说一下代码生成器的关键数据

变量

每个模板上都会传入一个上下文,上下文信息如下:

{
    "date": "2023-09-01",
    "packagePath": "com/dido",
    "package": "com.dido",
    "primaryList": [],
    "author": "liqw",
    "ModuleName": "Health",
    "BeanName": "SysConfig",
    "moduleName": "health",
    "dbType": "MySQL",
    "tableComment": "参数配置表",
    "columnList": [{
            "id": 1566357283930176,
            "tableId": 1566357283930144,
            "columnName": "config_id",
            "columnType": "int",
            "columnComment": "参数主键",
            "pkItem": false,
            "sort": 0,
            "attrName": "configId",
            "attrType": "Integer",
            "attrLabel": "参数主键",
            "packageName": null,
            "baseAttr": false,
            "addItem": true,
            "editItem": false,
            "gridItem": true,
            "queryItem": true,
            "queryType": "EQ",
            "reqItem": false,
            "htmlType": "input",
            "dictType": ""
        }
    ],
    "importList": ["java.util.Date"],
    "version": "v1",
    "tableName": "sys_config",
    "queryList": [{
            "id": 1566357283930176,
            "tableId": 1566357283930144,
            "columnName": "config_id",
            "columnType": "int",
            "columnComment": "参数主键",
            "pkItem": false,
            "sort": 0,
            "attrName": "configId",
            "attrType": "Integer",
            "attrLabel": "参数主键",
            "packageName": null,
            "baseAttr": false,
            "addItem": true,
            "editItem": false,
            "gridItem": true,
            "queryItem": true,
            "queryType": "EQ",
            "reqItem": false,
            "htmlType": "input",
            "dictType": ""
        }
    ],
    "formLayout": 1,
    "datetime": "2023-09-01 23:40:55",
    "codePath": "D:\\source\\bizdk-generator\\target",
    "gridList": [{
            "id": 1566357283930176,
            "tableId": 1566357283930144,
            "columnName": "config_id",
            "columnType": "int",
            "columnComment": "参数主键",
            "pkItem": false,
            "sort": 0,
            "attrName": "configId",
            "attrType": "Integer",
            "attrLabel": "参数主键",
            "packageName": null,
            "baseAttr": false,
            "addItem": true,
            "editItem": false,
            "gridItem": true,
            "queryItem": true,
            "queryType": "EQ",
            "reqItem": false,
            "htmlType": "input",
            "dictType": ""
        }
    ],
    "templateName": "java/Convertor.java.ftl",
    "beanName": "sysConfig",
    "formList": [{
            "id": 1566357283930176,
            "tableId": 1566357283930144,
            "columnName": "config_id",
            "columnType": "int",
            "columnComment": "参数主键",
            "pkItem": false,
            "sort": 0,
            "attrName": "configId",
            "attrType": "Integer",
            "attrLabel": "参数主键",
            "packageName": null,
            "baseAttr": false,
            "addItem": true,
            "editItem": false,
            "gridItem": true,
            "queryItem": true,
            "queryType": "EQ",
            "reqItem": false,
            "htmlType": "input",
            "dictType": ""
        }
    ],
    "email": "823604769@qq.com"
}

界面

这是图片

模板编写

这是图片

支持

如果觉得还不错,或者已经在使用了,希望你可以去gitee 帮作者点个 ⭐ Star. 也可以请萤火虫喝杯咖啡,谢谢~~~

支付宝 微信
MIT License Copyright (c) 2023 liuyun073 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.

简介

BIZDK 代码生成器,无关框架,可以根据模板生成代码 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/liuyun073/bizdk-generator.git
git@gitee.com:liuyun073/bizdk-generator.git
liuyun073
bizdk-generator
bizdk-generator
master

搜索帮助