Skip to content
This repository was archived by the owner on Nov 21, 2020. It is now read-only.

Commit c4c59ff

Browse files
committed
feat: add encode method for base bean
1 parent 0e2230c commit c4c59ff

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/java/org/code4everything/boot/base/bean/BaseBean.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import cn.hutool.core.util.ObjectUtil;
55
import cn.hutool.core.util.ReflectUtil;
66
import com.alibaba.fastjson.JSON;
7+
import org.code4everything.boot.config.BootConfig;
78

89
import java.lang.reflect.Field;
910
import java.util.Objects;
@@ -16,6 +17,15 @@
1617
*/
1718
public interface BaseBean {
1819

20+
/**
21+
* 加密对象字段
22+
*
23+
* @since 1.1.6
24+
*/
25+
default void encode() {
26+
BootConfig.getFieldEncoder().encodeField(this);
27+
}
28+
1929
/**
2030
* 初始化对象,调用者需重写此方法并手动调用
2131
*

0 commit comments

Comments
 (0)