Skip to content

Commit

Permalink
更新v1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
yzcheng90 committed Feb 25, 2023
1 parent b8ad936 commit bc22a06
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<dependency>
<groupId>com.github.yzcheng90</groupId>
<artifactId>autofull-spring-boot-starter</artifactId>
<version>1.4.1</version>
<version>1.4.2</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion autofull-spring-boot-starter-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<dependency>
<groupId>com.github.yzcheng90</groupId>
<artifactId>autofull-spring-boot-starter</artifactId>
<version>1.4.1</version>
<version>1.4.2</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion autofull-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.github.yzcheng90</groupId>
<artifactId>autofull-spring-boot-starter</artifactId>
<version>1.4.1</version>
<version>1.4.2</version>
<url>https://github.com/yzcheng90/zhjg-common-autofull</url>
<name>autofull-spring-boot-starter</name>
<description>一个填充字段属性框架</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,46 @@
@ConfigurationProperties(prefix = "autofull")
public class ConfigProperties {

// 是否显示日志
/**
* 是否显示日志
**/
@Setter
@Getter
public boolean showLog = true;

// 最大填充层级
/**
* 字段规则
* true :默认使用驼峰 支持通过mybatis-plus.configuration.map-underscore-to-camel-case 配置
* false :自定义 实体类中写的是什么就是什么不会自动转换
**/
@Setter
@Getter
public boolean fieldRule = true;

/**
* 最大填充层级
**/
@Setter
@Getter
public int maxLevel = 1;

// 当前层级
/**
* 当前层级
**/
@Setter
@Getter
public int currLevel = 0;

// 加密分隔标志
/**
* 加密分隔标志
**/
@Setter
@Getter
public String encryptFlag = "@autofull@";

// 加密密钥 16位
/**
* 加密密钥 16位
**/
@Setter
@Getter
public String encryptKeys = "abcdefg123456789";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,21 @@ public Class<?> getClassType(Field field) {
}

public String getConditionField(String field) {
MybatisPlusProperties bean = ApplicationContextRegister.getApplicationContext().getBean(MybatisPlusProperties.class);
MybatisConfiguration configuration = bean.getConfiguration();
if (configuration == null || configuration.isMapUnderscoreToCamelCase()) {
if (field.contains("_")) {
return FieldCaseUtil.toCamelCase(field);
boolean fieldRule = configProperties.isFieldRule();
if (fieldRule) {
MybatisPlusProperties bean = ApplicationContextRegister.getApplicationContext().getBean(MybatisPlusProperties.class);
MybatisConfiguration configuration = bean.getConfiguration();
if (configuration == null || configuration.isMapUnderscoreToCamelCase()) {
if (field.contains("_")) {
return FieldCaseUtil.toCamelCase(field);
} else {
return FieldCaseUtil.toUnderScoreCase(field);
}
} else {
return FieldCaseUtil.toUnderScoreCase(field);
}
}else {
return FieldCaseUtil.toUnderScoreCase(field);
} else {
return field;
}
}

Expand Down
11 changes: 11 additions & 0 deletions doc/update.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
### 功能
>
>v1.4.2
>- 新增字段规则配置
```yaml
# autofull 配置
autofull:
# 字段规则
# true :默认使用驼峰 支持通过mybatis-plus.configuration.map-underscore-to-camel-case 配置
# false :自定义 实体类中写的是什么就是什么不会自动转换
fieldRule: true
```
>
>v1.4.1
>- 新增使用@AutoFullOssUrl时bucketName 可以不用
>
Expand Down

0 comments on commit bc22a06

Please sign in to comment.