mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 09:08:24 +08:00
refactor: 去掉 Lombok 注解。
This commit is contained in:
parent
9165d8d44a
commit
92f2cb8c07
@ -15,17 +15,13 @@
|
||||
*/
|
||||
package com.mybatisflex.codegen.config;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 生成 Controller 的配置。
|
||||
*
|
||||
* @author 王帅
|
||||
* @since 2023-05-15
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@SuppressWarnings("unused")
|
||||
public class ControllerConfig {
|
||||
|
||||
/**
|
||||
@ -56,4 +52,40 @@ public class ControllerConfig {
|
||||
return supperClass.getSimpleName();
|
||||
}
|
||||
|
||||
public String getClassPrefix() {
|
||||
return classPrefix;
|
||||
}
|
||||
|
||||
public ControllerConfig setClassPrefix(String classPrefix) {
|
||||
this.classPrefix = classPrefix;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getClassSuffix() {
|
||||
return classSuffix;
|
||||
}
|
||||
|
||||
public ControllerConfig setClassSuffix(String classSuffix) {
|
||||
this.classSuffix = classSuffix;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Class<?> getSupperClass() {
|
||||
return supperClass;
|
||||
}
|
||||
|
||||
public ControllerConfig setSupperClass(Class<?> supperClass) {
|
||||
this.supperClass = supperClass;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isRestStyle() {
|
||||
return restStyle;
|
||||
}
|
||||
|
||||
public ControllerConfig setRestStyle(boolean restStyle) {
|
||||
this.restStyle = restStyle;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@ -15,9 +15,6 @@
|
||||
*/
|
||||
package com.mybatisflex.codegen.config;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
@ -26,8 +23,7 @@ import java.io.Serializable;
|
||||
* @author 王帅
|
||||
* @since 2023-05-15
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@SuppressWarnings("unused")
|
||||
public class EntityConfig {
|
||||
|
||||
/**
|
||||
@ -55,4 +51,49 @@ public class EntityConfig {
|
||||
*/
|
||||
private boolean withLombok;
|
||||
|
||||
public String getClassPrefix() {
|
||||
return classPrefix;
|
||||
}
|
||||
|
||||
public EntityConfig setClassPrefix(String classPrefix) {
|
||||
this.classPrefix = classPrefix;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getClassSuffix() {
|
||||
return classSuffix;
|
||||
}
|
||||
|
||||
public EntityConfig setClassSuffix(String classSuffix) {
|
||||
this.classSuffix = classSuffix;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Class<?> getSupperClass() {
|
||||
return supperClass;
|
||||
}
|
||||
|
||||
public EntityConfig setSupperClass(Class<?> supperClass) {
|
||||
this.supperClass = supperClass;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Class<?>[] getImplInterfaces() {
|
||||
return implInterfaces;
|
||||
}
|
||||
|
||||
public EntityConfig setImplInterfaces(Class<?>[] implInterfaces) {
|
||||
this.implInterfaces = implInterfaces;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isWithLombok() {
|
||||
return withLombok;
|
||||
}
|
||||
|
||||
public EntityConfig setWithLombok(boolean withLombok) {
|
||||
this.withLombok = withLombok;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@ -15,8 +15,6 @@
|
||||
*/
|
||||
package com.mybatisflex.codegen.config;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ -26,7 +24,6 @@ import java.util.Map;
|
||||
* @author 王帅
|
||||
* @since 2023-05-15
|
||||
*/
|
||||
@Getter
|
||||
@SuppressWarnings("unused")
|
||||
public class GlobalConfig {
|
||||
|
||||
@ -62,6 +59,14 @@ public class GlobalConfig {
|
||||
this.strategyConfig = new StrategyConfig();
|
||||
}
|
||||
|
||||
public PackageConfig getPackageConfig() {
|
||||
return packageConfig;
|
||||
}
|
||||
|
||||
public StrategyConfig getStrategyConfig() {
|
||||
return strategyConfig;
|
||||
}
|
||||
|
||||
public EntityConfig getEntityConfig() {
|
||||
if (entityConfig == null) {
|
||||
entityConfig = new EntityConfig();
|
||||
@ -158,6 +163,30 @@ public class GlobalConfig {
|
||||
tableDefGenerateEnable = false;
|
||||
}
|
||||
|
||||
public boolean isEntityGenerateEnable() {
|
||||
return entityGenerateEnable;
|
||||
}
|
||||
|
||||
public boolean isMapperGenerateEnable() {
|
||||
return mapperGenerateEnable;
|
||||
}
|
||||
|
||||
public boolean isServiceGenerateEnable() {
|
||||
return serviceGenerateEnable;
|
||||
}
|
||||
|
||||
public boolean isServiceImplGenerateEnable() {
|
||||
return serviceImplGenerateEnable;
|
||||
}
|
||||
|
||||
public boolean isControllerGenerateEnable() {
|
||||
return controllerGenerateEnable;
|
||||
}
|
||||
|
||||
public boolean isTableDefGenerateEnable() {
|
||||
return tableDefGenerateEnable;
|
||||
}
|
||||
|
||||
public void addCustomConfig(String key, Object value) {
|
||||
if (customConfig == null) {
|
||||
customConfig = new HashMap<>();
|
||||
|
||||
@ -16,8 +16,6 @@
|
||||
package com.mybatisflex.codegen.config;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 生成 Mapper 的配置。
|
||||
@ -25,8 +23,7 @@ import lombok.experimental.Accessors;
|
||||
* @author 王帅
|
||||
* @since 2023-05-15
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@SuppressWarnings("unused")
|
||||
public class MapperConfig {
|
||||
|
||||
/**
|
||||
@ -52,4 +49,31 @@ public class MapperConfig {
|
||||
return supperClass.getSimpleName();
|
||||
}
|
||||
|
||||
public String getClassPrefix() {
|
||||
return classPrefix;
|
||||
}
|
||||
|
||||
public MapperConfig setClassPrefix(String classPrefix) {
|
||||
this.classPrefix = classPrefix;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getClassSuffix() {
|
||||
return classSuffix;
|
||||
}
|
||||
|
||||
public MapperConfig setClassSuffix(String classSuffix) {
|
||||
this.classSuffix = classSuffix;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Class<?> getSupperClass() {
|
||||
return supperClass;
|
||||
}
|
||||
|
||||
public MapperConfig setSupperClass(Class<?> supperClass) {
|
||||
this.supperClass = supperClass;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,8 +1,6 @@
|
||||
package com.mybatisflex.codegen.config;
|
||||
|
||||
import com.mybatisflex.core.util.StringUtil;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 生成软件包的配置。
|
||||
@ -10,8 +8,7 @@ import lombok.experimental.Accessors;
|
||||
* @author 王帅
|
||||
* @since 2023-05-15
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@SuppressWarnings("unused")
|
||||
public class PackageConfig {
|
||||
|
||||
/**
|
||||
@ -61,6 +58,20 @@ public class PackageConfig {
|
||||
return sourceDir;
|
||||
}
|
||||
|
||||
public PackageConfig setSourceDir(String sourceDir) {
|
||||
this.sourceDir = sourceDir;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBasePackage() {
|
||||
return basePackage;
|
||||
}
|
||||
|
||||
public PackageConfig setBasePackage(String basePackage) {
|
||||
this.basePackage = basePackage;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getEntityPackage() {
|
||||
if (StringUtil.isBlank(entityPackage)) {
|
||||
return basePackage.concat(".entity");
|
||||
@ -68,6 +79,11 @@ public class PackageConfig {
|
||||
return entityPackage;
|
||||
}
|
||||
|
||||
public PackageConfig setEntityPackage(String entityPackage) {
|
||||
this.entityPackage = entityPackage;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMapperPackage() {
|
||||
if (StringUtil.isBlank(mapperPackage)) {
|
||||
return basePackage.concat(".mapper");
|
||||
@ -75,6 +91,11 @@ public class PackageConfig {
|
||||
return mapperPackage;
|
||||
}
|
||||
|
||||
public PackageConfig setMapperPackage(String mapperPackage) {
|
||||
this.mapperPackage = mapperPackage;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getServicePackage() {
|
||||
if (StringUtil.isBlank(servicePackage)) {
|
||||
return basePackage.concat(".service");
|
||||
@ -82,6 +103,11 @@ public class PackageConfig {
|
||||
return servicePackage;
|
||||
}
|
||||
|
||||
public PackageConfig setServicePackage(String servicePackage) {
|
||||
this.servicePackage = servicePackage;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getServiceImplPackage() {
|
||||
if (StringUtil.isBlank(serviceImplPackage)) {
|
||||
return basePackage.concat(".service.impl");
|
||||
@ -89,6 +115,11 @@ public class PackageConfig {
|
||||
return serviceImplPackage;
|
||||
}
|
||||
|
||||
public PackageConfig setServiceImplPackage(String serviceImplPackage) {
|
||||
this.serviceImplPackage = serviceImplPackage;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getControllerPackage() {
|
||||
if (StringUtil.isBlank(controllerPackage)) {
|
||||
return basePackage.concat(".controller");
|
||||
@ -96,6 +127,11 @@ public class PackageConfig {
|
||||
return controllerPackage;
|
||||
}
|
||||
|
||||
public PackageConfig setControllerPackage(String controllerPackage) {
|
||||
this.controllerPackage = controllerPackage;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTableDefPackage() {
|
||||
if (StringUtil.isBlank(tableDefPackage)) {
|
||||
return getEntityPackage().concat(".tables");
|
||||
@ -103,4 +139,9 @@ public class PackageConfig {
|
||||
return tableDefPackage;
|
||||
}
|
||||
|
||||
public PackageConfig setTableDefPackage(String tableDefPackage) {
|
||||
this.tableDefPackage = tableDefPackage;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@ -16,8 +16,6 @@
|
||||
package com.mybatisflex.codegen.config;
|
||||
|
||||
import com.mybatisflex.spring.service.IService;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 生成 Service 的配置。
|
||||
@ -25,8 +23,7 @@ import lombok.experimental.Accessors;
|
||||
* @author 王帅
|
||||
* @since 2023-05-15
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@SuppressWarnings("unused")
|
||||
public class ServiceConfig {
|
||||
|
||||
/**
|
||||
@ -52,4 +49,31 @@ public class ServiceConfig {
|
||||
return supperClass.getSimpleName();
|
||||
}
|
||||
|
||||
public String getClassPrefix() {
|
||||
return classPrefix;
|
||||
}
|
||||
|
||||
public ServiceConfig setClassPrefix(String classPrefix) {
|
||||
this.classPrefix = classPrefix;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getClassSuffix() {
|
||||
return classSuffix;
|
||||
}
|
||||
|
||||
public ServiceConfig setClassSuffix(String classSuffix) {
|
||||
this.classSuffix = classSuffix;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Class<?> getSupperClass() {
|
||||
return supperClass;
|
||||
}
|
||||
|
||||
public ServiceConfig setSupperClass(Class<?> supperClass) {
|
||||
this.supperClass = supperClass;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@ -16,8 +16,6 @@
|
||||
package com.mybatisflex.codegen.config;
|
||||
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 生成 ServiceImpl 的配置。
|
||||
@ -25,8 +23,7 @@ import lombok.experimental.Accessors;
|
||||
* @author 王帅
|
||||
* @since 2023-05-15
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@SuppressWarnings("unused")
|
||||
public class ServiceImplConfig {
|
||||
|
||||
/**
|
||||
@ -52,4 +49,31 @@ public class ServiceImplConfig {
|
||||
return supperClass.getSimpleName();
|
||||
}
|
||||
|
||||
public String getClassPrefix() {
|
||||
return classPrefix;
|
||||
}
|
||||
|
||||
public ServiceImplConfig setClassPrefix(String classPrefix) {
|
||||
this.classPrefix = classPrefix;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getClassSuffix() {
|
||||
return classSuffix;
|
||||
}
|
||||
|
||||
public ServiceImplConfig setClassSuffix(String classSuffix) {
|
||||
this.classSuffix = classSuffix;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Class<?> getSupperClass() {
|
||||
return supperClass;
|
||||
}
|
||||
|
||||
public ServiceImplConfig setSupperClass(Class<?> supperClass) {
|
||||
this.supperClass = supperClass;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@ -2,8 +2,6 @@ package com.mybatisflex.codegen.config;
|
||||
|
||||
import com.mybatisflex.codegen.template.EnjoyTemplate;
|
||||
import com.mybatisflex.codegen.template.ITemplate;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@ -16,8 +14,7 @@ import java.util.Set;
|
||||
* @author 王帅
|
||||
* @since 2023-05-14
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@SuppressWarnings("unused")
|
||||
public class StrategyConfig {
|
||||
|
||||
/**
|
||||
@ -170,4 +167,90 @@ public class StrategyConfig {
|
||||
return templateEngine;
|
||||
}
|
||||
|
||||
public StrategyConfig setTemplateEngine(ITemplate templateEngine) {
|
||||
this.templateEngine = templateEngine;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTablePrefix() {
|
||||
return tablePrefix;
|
||||
}
|
||||
|
||||
public StrategyConfig setTablePrefix(String tablePrefix) {
|
||||
this.tablePrefix = tablePrefix;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLogicDeleteColumn() {
|
||||
return logicDeleteColumn;
|
||||
}
|
||||
|
||||
public StrategyConfig setLogicDeleteColumn(String logicDeleteColumn) {
|
||||
this.logicDeleteColumn = logicDeleteColumn;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getVersionColumn() {
|
||||
return versionColumn;
|
||||
}
|
||||
|
||||
public StrategyConfig setVersionColumn(String versionColumn) {
|
||||
this.versionColumn = versionColumn;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isGenerateForView() {
|
||||
return generateForView;
|
||||
}
|
||||
|
||||
public StrategyConfig setGenerateForView(boolean generateForView) {
|
||||
this.generateForView = generateForView;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isOverwriteEnable() {
|
||||
return overwriteEnable;
|
||||
}
|
||||
|
||||
public StrategyConfig setOverwriteEnable(boolean overwriteEnable) {
|
||||
this.overwriteEnable = overwriteEnable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Map<String, TableConfig> getTableConfigMap() {
|
||||
return tableConfigMap;
|
||||
}
|
||||
|
||||
public StrategyConfig setTableConfigMap(Map<String, TableConfig> tableConfigMap) {
|
||||
this.tableConfigMap = tableConfigMap;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Map<String, ColumnConfig> getColumnConfigMap() {
|
||||
return columnConfigMap;
|
||||
}
|
||||
|
||||
public StrategyConfig setColumnConfigMap(Map<String, ColumnConfig> columnConfigMap) {
|
||||
this.columnConfigMap = columnConfigMap;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Set<String> getGenerateTables() {
|
||||
return generateTables;
|
||||
}
|
||||
|
||||
public StrategyConfig setGenerateTables(Set<String> generateTables) {
|
||||
this.generateTables = generateTables;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Set<String> getUnGenerateTables() {
|
||||
return unGenerateTables;
|
||||
}
|
||||
|
||||
public StrategyConfig setUnGenerateTables(Set<String> unGenerateTables) {
|
||||
this.unGenerateTables = unGenerateTables;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@ -15,17 +15,13 @@
|
||||
*/
|
||||
package com.mybatisflex.codegen.config;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 生成 TableDef 的配置。
|
||||
*
|
||||
* @author 王帅
|
||||
* @since 2023-05-15
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@SuppressWarnings("unused")
|
||||
public class TableDefConfig {
|
||||
|
||||
/**
|
||||
@ -38,4 +34,22 @@ public class TableDefConfig {
|
||||
*/
|
||||
private String classSuffix = "Def";
|
||||
|
||||
public String getClassPrefix() {
|
||||
return classPrefix;
|
||||
}
|
||||
|
||||
public TableDefConfig setClassPrefix(String classPrefix) {
|
||||
this.classPrefix = classPrefix;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getClassSuffix() {
|
||||
return classSuffix;
|
||||
}
|
||||
|
||||
public TableDefConfig setClassSuffix(String classSuffix) {
|
||||
this.classSuffix = classSuffix;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user