add @ColumnMask() annotation support

This commit is contained in:
开源海哥 2023-03-23 12:45:06 +08:00
parent 7d9056bef6
commit 93aa7ca751
3 changed files with 10 additions and 6 deletions

View File

@ -1,10 +1,8 @@
package com.mybatisflex.test;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.annotation.*;
import com.mybatisflex.core.handler.Fastjson2TypeHandler;
import com.mybatisflex.core.mask.Masks;
import java.util.Date;
import java.util.HashMap;
@ -16,6 +14,7 @@ public class Account {
@Id(keyType = KeyType.Auto)
private Long id;
@ColumnMask(Masks.CHINESE_NAME)
private String userName;
private int age;

View File

@ -48,6 +48,11 @@ public class EntityTestStarter {
System.out.println(account);
List<Account> allAccount = bootstrap.execute(AccountMapper.class, accountMapper ->
accountMapper.selectListByQuery(QueryWrapper.create()));
System.out.println(allAccount);
Account newAccount = new Account();
newAccount.setUserName("lisi");
newAccount.setAge(18);

View File

@ -1,3 +1,3 @@
INSERT INTO tb_account
VALUES (1, 'Michael Yang', 18, '2020-01-11', null),
(2, 'Zhang san', 19, '2021-03-21', null);
VALUES (1, '张三', 18, '2020-01-11', null),
(2, '王麻子叔叔', 19, '2021-03-21', null);