package com.mindant.generator.action;
|
|
|
import com.mindant.generator.action.config.GunsGeneratorConfig;
|
import com.mindant.generator.action.config.WebGeneratorConfig;
|
import com.mindant.generator.action.model.GenQo;
|
|
/**
|
* 代码生成器,可以生成实体,dao,service,controller,html,js
|
*
|
* @author stylefeng
|
* @Date 2017/5/21 12:38
|
*/
|
public class GunsCodeGenerator {
|
|
public static void main(String[] args) {
|
|
// /**
|
// * Mybatis-Plus的代码生成器:
|
// * mp的代码生成器可以生成实体,mapper,mapper对应的xml,service
|
// */
|
// GunsGeneratorConfig gunsGeneratorConfig = new GunsGeneratorConfig();
|
// gunsGeneratorConfig.doMpGeneration();
|
|
/**
|
* guns的生成器:
|
* guns的代码生成器可以生成controller,html页面,页面对应的js
|
*/
|
// gunsGeneratorConfig.doGunsGeneration();
|
GenQo genQo = new GenQo();
|
//数据库url
|
genQo.setUrl("jdbc:mysql://rm-2vc47rysl5jt6gv312o.mysql.cn-chengdu.rds.aliyuncs.com:3306/fbwl?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true");
|
//数据库密码
|
genQo.setPassword("00aabb001");
|
//数据库用户名
|
genQo.setUserName("root_dev1");
|
//表名
|
genQo.setTableName("t_area");
|
genQo.setAuthor("guohongjin");
|
//数据库名
|
genQo.setDbName("fbwl");
|
//项目包
|
genQo.setProjectPackage("cn.stylefeng.guns");
|
genQo.setModuleName("business");
|
//代码生成位置
|
genQo.setProjectPath("D:\\code\\xinlizixun_dev\\common-buiness");
|
//用户信息
|
genQo.setBizName("地区码表");
|
genQo.setControllerSwitch(true);
|
genQo.setEntitySwitch(true);
|
genQo.setServiceSwitch(true);
|
genQo.setDaoSwitch(true);
|
genQo.setIgnoreTabelPrefix("t_");
|
|
WebGeneratorConfig webGeneratorConfig = new WebGeneratorConfig(genQo);
|
webGeneratorConfig.doMpGeneration();
|
webGeneratorConfig.doGunsGeneration();
|
}
|
|
}
|