perf: 优化脱敏工具,修复父类中脱敏注解无效的bug

This commit is contained in:
曾文豪
2023-03-09 15:58:05 +08:00
parent a65ea27485
commit 8873053c06
5 changed files with 47 additions and 18 deletions

View File

@@ -102,7 +102,9 @@ public class TestController {
@TokenIgnore
public ApiResp<List<TestFile>> desensitize() {
TestFile file = new TestFile("11111");
file.setTest("111111");
TestFile file1 = new TestFile("22222");
file1.setTest("22222");
return ApiResp.respOK(CollUtil.newArrayList(file, file1));
}

View File

@@ -1,27 +1,21 @@
package com.tiesheng.demo.pojos;
import com.tiesheng.annotation.desensitize.Desensitize;
import com.tiesheng.poi.pojos.PoiWriteBase;
public class TestFile implements PoiWriteBase {
public class TestFile extends TestParent implements PoiWriteBase {
@Desensitize()
private String test;
private String name;
public TestFile(String test) {
this.test = test;
public TestFile(String name) {
this.name = name;
}
///////////////////////////////////////////////////////////////////////////
// setter、getter
///////////////////////////////////////////////////////////////////////////
public String getTest() {
return test;
public String getName() {
return name;
}
public void setTest(String test) {
this.test = test;
public void setName(String name) {
this.name = name;
}
}

View File

@@ -0,0 +1,33 @@
package com.tiesheng.demo.pojos;
import com.tiesheng.annotation.desensitize.Desensitize;
import com.tiesheng.poi.pojos.PoiWriteBase;
public class TestParent implements PoiWriteBase {
private String id;
@Desensitize()
private String test;
///////////////////////////////////////////////////////////////////////////
// setter、getter
///////////////////////////////////////////////////////////////////////////
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTest() {
return test;
}
public void setTest(String test) {
this.test = test;
}
}