guohongjin
2024-05-10 19d4dd3d5ab4563b06b13f2cfefd752920ffb9a1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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();
    }
 
}