package com.yqzx.generator.engine.config;
|
|
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.util.StrUtil;
|
import lombok.Data;
|
|
import java.util.Date;
|
|
/**
|
* @description: 全局配置
|
* @author: chaoyapeng
|
* @time: 2020/8/18 16:06
|
*/
|
@Data
|
public class ContextConfig {
|
|
private String templatePrefixPath = "template";
|
|
/**
|
* 模板输出的项目目录
|
*/
|
private String projectPath = "d:\\";
|
|
/**
|
* 包名
|
*/
|
private String packageName;
|
|
/**
|
* 作者
|
*/
|
private String author = "system";
|
|
/**
|
* 表名
|
*/
|
private String tableName;
|
|
/**
|
* 时间
|
*/
|
private String dateTime;
|
|
/**
|
* 中文业务名
|
*/
|
private String bizChName;
|
|
/**
|
* Mapping名称
|
*/
|
private String bizMappingName;
|
|
/**
|
* 小写
|
*/
|
private String bizEnName;
|
|
/**
|
* 大写
|
*/
|
private String bizEnBigName;
|
|
/**
|
* 是否生成控制器代码开关
|
*/
|
private Boolean controllerSwitch = false;
|
|
/**
|
* service
|
*/
|
private Boolean serviceSwitch = false;
|
|
/**
|
* mapper的开关
|
*/
|
private Boolean mapperSwitch = false;
|
|
/**
|
* 实体类的开关
|
*/
|
private Boolean modelSwitch = false;
|
|
/**
|
* 查询实体类的开关
|
*/
|
private Boolean querySwitch = false;
|
|
public void init() {
|
dateTime = DateUtil.formatDateTime(new Date());
|
bizMappingName = tableName.replace("_", "/");
|
bizEnName = StrUtil.toCamelCase(tableName);
|
bizEnBigName = StrUtil.upperFirst(bizEnName);
|
}
|
|
}
|