Skip to content

Commit

Permalink
📝 支持配置是否输出列信息到控制台
Browse files Browse the repository at this point in the history
  • Loading branch information
hengboy committed Aug 1, 2022
1 parent 52505c7 commit d6b315b
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@

package org.minbox.framework.api.boot.maven.plugin.mybatis.enhance.codegen.builder.impl;

import com.alibaba.fastjson.JSON;
import com.gitee.hengboy.builder.common.enums.JavaTypeEnum;
import com.gitee.hengboy.mybatis.enhance.common.annotation.Column;
import com.gitee.hengboy.mybatis.enhance.common.annotation.Id;
@@ -127,9 +128,9 @@ public String getClassContent() {
javaType = Optional.ofNullable(javaType).orElse(column.getJavaType());
// private field
writer.line(String.format(FIELD, javaType, formatterJavaPropertyName(column.getColumnName()), getColumnDefaultValue(column)));
LOG.info("Field:" + column.getJavaProperty() + ",Column:" + column.getColumnName() + "," +
"Java Type:" + column.getJavaType() + ",Jdbc Type:" + column.getJdbcTypeName() + "," +
"Default Value:" + column.getDefaultValue() + ", Mark:" + column.getRemark() + ".");
if (getWrapper().isOutputFieldInTheConsole()) {
LOG.info(JSON.toJSONString(column));
}
}

// end class
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@
import com.gitee.hengboy.builder.core.database.model.Table;
import lombok.Builder;
import lombok.Data;
import org.apache.maven.plugins.annotations.Parameter;
import org.minbox.framework.api.boot.maven.plugin.mybatis.enhance.codegen.mapping.TypeMapping;

import java.util.List;
@@ -69,4 +68,8 @@ public class ClassBuilderWrapper {
* 是否在类上追加Lombok "@Accessors(chain=true)"注解
*/
private boolean appendLombokAccessorsChain;
/**
* 是否在控制台输出字段信息
*/
private boolean outputFieldInTheConsole;
}

0 comments on commit d6b315b

Please sign in to comment.