ai-engineering-init 1.3.3 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/hooks/skill-forced-eval.js +4 -1
- package/.claude/settings.json +3 -3
- package/.claude/skills/add-skill/SKILL.md +252 -116
- package/.claude/skills/api-development/SKILL.md +83 -377
- package/.claude/skills/architecture-design/SKILL.md +138 -632
- package/.claude/skills/backend-annotations/SKILL.md +134 -506
- package/.claude/skills/banana-image/SKILL.md +10 -3
- package/.claude/skills/brainstorm/SKILL.md +103 -535
- package/.claude/skills/bug-detective/SKILL.md +147 -1097
- package/.claude/skills/bug-detective/references/error-patterns.md +242 -0
- package/.claude/skills/code-patterns/SKILL.md +116 -426
- package/.claude/skills/code-patterns/references/leniu-code-patterns.md +87 -0
- package/.claude/skills/crud-development/SKILL.md +64 -304
- package/.claude/skills/data-permission/SKILL.md +105 -412
- package/.claude/skills/data-permission/references/custom-data-scope.md +90 -0
- package/.claude/skills/file-oss-management/SKILL.md +106 -714
- package/.claude/skills/file-oss-management/references/entities.md +105 -0
- package/.claude/skills/file-oss-management/references/service-impl.md +104 -0
- package/.claude/skills/leniu-api-development/SKILL.md +142 -626
- package/.claude/skills/leniu-api-development/references/real-examples.md +273 -0
- package/.claude/skills/leniu-architecture-design/SKILL.md +176 -391
- package/.claude/skills/leniu-backend-annotations/SKILL.md +132 -519
- package/.claude/skills/leniu-brainstorm/SKILL.md +132 -541
- package/.claude/skills/leniu-brainstorm/references/business-scenarios.md +162 -0
- package/.claude/skills/leniu-crud-development/SKILL.md +232 -938
- package/.claude/skills/leniu-crud-development/references/templates.md +597 -0
- package/.claude/skills/leniu-customization-location/SKILL.md +410 -0
- package/.claude/skills/leniu-data-permission/SKILL.md +70 -0
- package/.claude/skills/leniu-java-entity/SKILL.md +76 -590
- package/.claude/skills/leniu-java-entity/references/templates.md +237 -0
- package/.claude/skills/leniu-java-export/SKILL.md +94 -379
- package/.claude/skills/leniu-java-logging/SKILL.md +106 -709
- package/.claude/skills/leniu-java-logging/references/data-mask.md +46 -0
- package/.claude/skills/leniu-java-logging/references/logging-scenarios.md +113 -0
- package/.claude/skills/leniu-java-mybatis/SKILL.md +73 -446
- package/.claude/skills/leniu-java-mybatis/references/report-mapper.md +88 -0
- package/.claude/skills/leniu-report-customization/SKILL.md +111 -325
- package/.claude/skills/leniu-report-customization/references/table-fields.md +93 -0
- package/.claude/skills/leniu-report-standard-customization/SKILL.md +328 -0
- package/.claude/skills/leniu-report-standard-customization/references/analysis-module.md +64 -0
- package/.claude/skills/leniu-report-standard-customization/references/table-fields.md +113 -0
- package/.claude/skills/leniu-security-guard/SKILL.md +133 -347
- package/.claude/skills/mysql-debug/SKILL.md +364 -0
- package/.claude/skills/openspec-apply-change/SKILL.md +10 -1
- package/.claude/skills/openspec-archive-change/SKILL.md +9 -1
- package/.claude/skills/openspec-bulk-archive-change/SKILL.md +9 -1
- package/.claude/skills/openspec-continue-change/SKILL.md +9 -1
- package/.claude/skills/openspec-explore/SKILL.md +10 -1
- package/.claude/skills/openspec-ff-change/SKILL.md +9 -1
- package/.claude/skills/openspec-new-change/SKILL.md +9 -1
- package/.claude/skills/openspec-onboard/SKILL.md +15 -130
- package/.claude/skills/openspec-sync-specs/SKILL.md +9 -1
- package/.claude/skills/openspec-verify-change/SKILL.md +9 -1
- package/.claude/skills/performance-doctor/SKILL.md +110 -434
- package/.claude/skills/redis-cache/SKILL.md +89 -595
- package/.claude/skills/redis-cache/references/listeners.md +23 -0
- package/.claude/skills/scheduled-jobs/SKILL.md +88 -407
- package/.claude/skills/security-guard/SKILL.md +137 -532
- package/.claude/skills/security-guard/references/encrypt-config.md +103 -0
- package/.claude/skills/security-guard/references/sensitive-strategies.md +42 -0
- package/.claude/skills/sms-mail/SKILL.md +116 -574
- package/.claude/skills/sms-mail/references/mail-config.md +88 -0
- package/.claude/skills/sms-mail/references/sms-config.md +74 -0
- package/.claude/skills/social-login/SKILL.md +112 -514
- package/.claude/skills/social-login/references/provider-configs.md +118 -0
- package/.claude/skills/tenant-management/SKILL.md +129 -444
- package/.claude/skills/tenant-management/references/tenant-scenarios.md +91 -0
- package/.claude/skills/test-development/SKILL.md +86 -540
- package/.claude/skills/test-development/references/parameterized-examples.md +119 -0
- package/.claude/skills/utils-toolkit/SKILL.md +52 -305
- package/.claude/skills/utils-toolkit/references/redis-utils-api.md +56 -0
- package/.claude/skills/websocket-sse/SKILL.md +105 -550
- package/.claude/skills/workflow-engine/SKILL.md +147 -502
- package/.codex/skills/add-skill/SKILL.md +252 -116
- package/.codex/skills/api-development/SKILL.md +172 -599
- package/.codex/skills/architecture-design/SKILL.md +138 -504
- package/.codex/skills/backend-annotations/SKILL.md +134 -496
- package/.codex/skills/banana-image/SKILL.md +10 -3
- package/.codex/skills/brainstorm/SKILL.md +103 -535
- package/.codex/skills/bug-detective/SKILL.md +147 -1097
- package/.codex/skills/bug-detective/references/error-patterns.md +242 -0
- package/.codex/skills/code-patterns/SKILL.md +120 -282
- package/.codex/skills/code-patterns/references/leniu-code-patterns.md +87 -0
- package/.codex/skills/crud-development/SKILL.md +64 -292
- package/.codex/skills/data-permission/SKILL.md +108 -407
- package/.codex/skills/data-permission/references/custom-data-scope.md +90 -0
- package/.codex/skills/database-ops/SKILL.md +8 -154
- package/.codex/skills/error-handler/SKILL.md +10 -0
- package/.codex/skills/file-oss-management/SKILL.md +106 -714
- package/.codex/skills/file-oss-management/references/entities.md +105 -0
- package/.codex/skills/file-oss-management/references/service-impl.md +104 -0
- package/.codex/skills/git-workflow/SKILL.md +27 -5
- package/.codex/skills/leniu-api-development/SKILL.md +142 -626
- package/.codex/skills/leniu-api-development/references/real-examples.md +273 -0
- package/.codex/skills/leniu-architecture-design/SKILL.md +176 -391
- package/.codex/skills/leniu-backend-annotations/SKILL.md +132 -519
- package/.codex/skills/leniu-brainstorm/SKILL.md +132 -541
- package/.codex/skills/leniu-brainstorm/references/business-scenarios.md +162 -0
- package/.codex/skills/leniu-crud-development/SKILL.md +232 -938
- package/.codex/skills/leniu-crud-development/references/templates.md +597 -0
- package/.codex/skills/leniu-customization-location/SKILL.md +410 -0
- package/.codex/skills/leniu-data-permission/SKILL.md +70 -0
- package/.codex/skills/leniu-java-code-style/SKILL.md +510 -0
- package/.codex/skills/leniu-java-entity/SKILL.md +76 -590
- package/.codex/skills/leniu-java-entity/references/templates.md +237 -0
- package/.codex/skills/leniu-java-export/SKILL.md +94 -379
- package/.codex/skills/leniu-java-logging/SKILL.md +106 -709
- package/.codex/skills/leniu-java-logging/references/data-mask.md +46 -0
- package/.codex/skills/leniu-java-logging/references/logging-scenarios.md +113 -0
- package/.codex/skills/leniu-java-mybatis/SKILL.md +73 -446
- package/.codex/skills/leniu-java-mybatis/references/report-mapper.md +88 -0
- package/.codex/skills/leniu-report-customization/SKILL.md +111 -325
- package/.codex/skills/leniu-report-customization/references/table-fields.md +93 -0
- package/.codex/skills/leniu-report-standard-customization/SKILL.md +328 -0
- package/.codex/skills/leniu-report-standard-customization/references/analysis-module.md +64 -0
- package/.codex/skills/leniu-report-standard-customization/references/table-fields.md +113 -0
- package/.codex/skills/leniu-security-guard/SKILL.md +133 -347
- package/.codex/skills/mysql-debug/SKILL.md +364 -0
- package/.codex/skills/openspec-apply-change/SKILL.md +10 -1
- package/.codex/skills/openspec-archive-change/SKILL.md +9 -1
- package/.codex/skills/openspec-bulk-archive-change/SKILL.md +9 -1
- package/.codex/skills/openspec-continue-change/SKILL.md +9 -1
- package/.codex/skills/openspec-explore/SKILL.md +10 -1
- package/.codex/skills/openspec-ff-change/SKILL.md +9 -1
- package/.codex/skills/openspec-new-change/SKILL.md +9 -1
- package/.codex/skills/openspec-onboard/SKILL.md +15 -130
- package/.codex/skills/openspec-sync-specs/SKILL.md +9 -1
- package/.codex/skills/openspec-verify-change/SKILL.md +9 -1
- package/.codex/skills/performance-doctor/SKILL.md +110 -434
- package/.codex/skills/project-navigator/SKILL.md +20 -1
- package/.codex/skills/redis-cache/SKILL.md +93 -589
- package/.codex/skills/redis-cache/references/listeners.md +23 -0
- package/.codex/skills/scheduled-jobs/SKILL.md +88 -407
- package/.codex/skills/security-guard/SKILL.md +141 -527
- package/.codex/skills/security-guard/references/encrypt-config.md +103 -0
- package/.codex/skills/security-guard/references/sensitive-strategies.md +42 -0
- package/.codex/skills/sms-mail/SKILL.md +116 -574
- package/.codex/skills/sms-mail/references/mail-config.md +88 -0
- package/.codex/skills/sms-mail/references/sms-config.md +74 -0
- package/.codex/skills/social-login/SKILL.md +112 -514
- package/.codex/skills/social-login/references/provider-configs.md +118 -0
- package/.codex/skills/store-pc/SKILL.md +258 -383
- package/.codex/skills/tenant-management/SKILL.md +129 -444
- package/.codex/skills/tenant-management/references/tenant-scenarios.md +91 -0
- package/.codex/skills/test-development/SKILL.md +86 -540
- package/.codex/skills/test-development/references/parameterized-examples.md +119 -0
- package/.codex/skills/ui-pc/SKILL.md +350 -387
- package/.codex/skills/utils-toolkit/SKILL.md +52 -283
- package/.codex/skills/utils-toolkit/references/redis-utils-api.md +56 -0
- package/.codex/skills/websocket-sse/SKILL.md +105 -550
- package/.codex/skills/workflow-engine/SKILL.md +147 -502
- package/.cursor/hooks.json +3 -3
- package/.cursor/rules/skill-activation.mdc +2 -0
- package/.cursor/skills/add-skill/SKILL.md +252 -116
- package/.cursor/skills/api-development/SKILL.md +83 -377
- package/.cursor/skills/architecture-design/SKILL.md +138 -632
- package/.cursor/skills/backend-annotations/SKILL.md +134 -506
- package/.cursor/skills/banana-image/SKILL.md +10 -3
- package/.cursor/skills/brainstorm/SKILL.md +103 -535
- package/.cursor/skills/bug-detective/SKILL.md +147 -1097
- package/.cursor/skills/bug-detective/references/error-patterns.md +242 -0
- package/.cursor/skills/code-patterns/SKILL.md +116 -426
- package/.cursor/skills/code-patterns/references/leniu-code-patterns.md +87 -0
- package/.cursor/skills/crud-development/SKILL.md +64 -304
- package/.cursor/skills/data-permission/SKILL.md +105 -412
- package/.cursor/skills/data-permission/references/custom-data-scope.md +90 -0
- package/.cursor/skills/file-oss-management/SKILL.md +106 -714
- package/.cursor/skills/file-oss-management/references/entities.md +105 -0
- package/.cursor/skills/file-oss-management/references/service-impl.md +104 -0
- package/.cursor/skills/git-workflow/SKILL.md +27 -5
- package/.cursor/skills/leniu-api-development/SKILL.md +142 -626
- package/.cursor/skills/leniu-api-development/references/real-examples.md +273 -0
- package/.cursor/skills/leniu-architecture-design/SKILL.md +176 -391
- package/.cursor/skills/leniu-backend-annotations/SKILL.md +132 -519
- package/.cursor/skills/leniu-brainstorm/SKILL.md +132 -541
- package/.cursor/skills/leniu-brainstorm/references/business-scenarios.md +162 -0
- package/.cursor/skills/leniu-crud-development/SKILL.md +232 -938
- package/.cursor/skills/leniu-crud-development/references/templates.md +597 -0
- package/.cursor/skills/leniu-customization-location/SKILL.md +410 -0
- package/.cursor/skills/leniu-data-permission/SKILL.md +70 -0
- package/.cursor/skills/leniu-java-code-style/SKILL.md +510 -0
- package/.cursor/skills/leniu-java-entity/SKILL.md +76 -590
- package/.cursor/skills/leniu-java-entity/references/templates.md +237 -0
- package/.cursor/skills/leniu-java-export/SKILL.md +94 -379
- package/.cursor/skills/leniu-java-logging/SKILL.md +106 -709
- package/.cursor/skills/leniu-java-logging/references/data-mask.md +46 -0
- package/.cursor/skills/leniu-java-logging/references/logging-scenarios.md +113 -0
- package/.cursor/skills/leniu-java-mybatis/SKILL.md +73 -446
- package/.cursor/skills/leniu-java-mybatis/references/report-mapper.md +88 -0
- package/.cursor/skills/leniu-report-customization/SKILL.md +111 -325
- package/.cursor/skills/leniu-report-customization/references/table-fields.md +93 -0
- package/.cursor/skills/leniu-report-standard-customization/SKILL.md +328 -0
- package/.cursor/skills/leniu-report-standard-customization/references/analysis-module.md +64 -0
- package/.cursor/skills/leniu-report-standard-customization/references/table-fields.md +113 -0
- package/.cursor/skills/leniu-security-guard/SKILL.md +133 -347
- package/.cursor/skills/mysql-debug/SKILL.md +364 -0
- package/.cursor/skills/openspec-apply-change/SKILL.md +10 -1
- package/.cursor/skills/openspec-archive-change/SKILL.md +9 -1
- package/.cursor/skills/openspec-bulk-archive-change/SKILL.md +9 -1
- package/.cursor/skills/openspec-continue-change/SKILL.md +9 -1
- package/.cursor/skills/openspec-explore/SKILL.md +10 -1
- package/.cursor/skills/openspec-ff-change/SKILL.md +9 -1
- package/.cursor/skills/openspec-new-change/SKILL.md +9 -1
- package/.cursor/skills/openspec-onboard/SKILL.md +15 -130
- package/.cursor/skills/openspec-sync-specs/SKILL.md +9 -1
- package/.cursor/skills/openspec-verify-change/SKILL.md +9 -1
- package/.cursor/skills/performance-doctor/SKILL.md +110 -434
- package/.cursor/skills/redis-cache/SKILL.md +89 -595
- package/.cursor/skills/redis-cache/references/listeners.md +23 -0
- package/.cursor/skills/scheduled-jobs/SKILL.md +88 -407
- package/.cursor/skills/security-guard/SKILL.md +137 -532
- package/.cursor/skills/security-guard/references/encrypt-config.md +103 -0
- package/.cursor/skills/security-guard/references/sensitive-strategies.md +42 -0
- package/.cursor/skills/sms-mail/SKILL.md +116 -574
- package/.cursor/skills/sms-mail/references/mail-config.md +88 -0
- package/.cursor/skills/sms-mail/references/sms-config.md +74 -0
- package/.cursor/skills/social-login/SKILL.md +112 -514
- package/.cursor/skills/social-login/references/provider-configs.md +118 -0
- package/.cursor/skills/tenant-management/SKILL.md +129 -444
- package/.cursor/skills/tenant-management/references/tenant-scenarios.md +91 -0
- package/.cursor/skills/test-development/SKILL.md +86 -540
- package/.cursor/skills/test-development/references/parameterized-examples.md +119 -0
- package/.cursor/skills/utils-toolkit/SKILL.md +52 -305
- package/.cursor/skills/utils-toolkit/references/redis-utils-api.md +56 -0
- package/.cursor/skills/websocket-sse/SKILL.md +105 -550
- package/.cursor/skills/workflow-engine/SKILL.md +147 -502
- package/AGENTS.md +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# 数据加密详细配置
|
|
2
|
+
|
|
3
|
+
## 加密配置(application.yml)
|
|
4
|
+
|
|
5
|
+
```yaml
|
|
6
|
+
mybatis-encryptor:
|
|
7
|
+
enable: true
|
|
8
|
+
algorithm: AES
|
|
9
|
+
password: your-aes-key-16bit # AES 密钥(16/24/32位)
|
|
10
|
+
encode: BASE64
|
|
11
|
+
publicKey: xxx # RSA 公钥
|
|
12
|
+
privateKey: xxx # RSA 私钥
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## EncryptUtils 工具类
|
|
16
|
+
|
|
17
|
+
```java
|
|
18
|
+
import org.dromara.common.encrypt.utils.EncryptUtils;
|
|
19
|
+
|
|
20
|
+
// AES
|
|
21
|
+
String encrypted = EncryptUtils.encryptByAes(data, aesKey);
|
|
22
|
+
String decrypted = EncryptUtils.decryptByAes(encrypted, aesKey);
|
|
23
|
+
|
|
24
|
+
// RSA(公钥加密,私钥解密)
|
|
25
|
+
String encrypted = EncryptUtils.encryptByRsa(data, publicKey);
|
|
26
|
+
String decrypted = EncryptUtils.decryptByRsa(encrypted, privateKey);
|
|
27
|
+
|
|
28
|
+
// SM2 国密
|
|
29
|
+
String encrypted = EncryptUtils.encryptBySm2(data, publicKey);
|
|
30
|
+
String decrypted = EncryptUtils.decryptBySm2(encrypted, privateKey);
|
|
31
|
+
|
|
32
|
+
// SM4 国密
|
|
33
|
+
String encrypted = EncryptUtils.encryptBySm4(data, sm4Key);
|
|
34
|
+
String decrypted = EncryptUtils.decryptBySm4(encrypted, sm4Key);
|
|
35
|
+
|
|
36
|
+
// BASE64
|
|
37
|
+
String encoded = EncryptUtils.encryptByBase64(data);
|
|
38
|
+
String decoded = EncryptUtils.decryptByBase64(encoded);
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## 字段加密完整示例
|
|
42
|
+
|
|
43
|
+
```java
|
|
44
|
+
import org.dromara.common.encrypt.annotation.EncryptField;
|
|
45
|
+
import org.dromara.common.encrypt.enumd.AlgorithmType;
|
|
46
|
+
import org.dromara.common.encrypt.enumd.EncodeType;
|
|
47
|
+
|
|
48
|
+
public class User {
|
|
49
|
+
@EncryptField // 使用全局配置
|
|
50
|
+
private String password;
|
|
51
|
+
|
|
52
|
+
@EncryptField(algorithm = AlgorithmType.AES) // AES
|
|
53
|
+
private String idCard;
|
|
54
|
+
|
|
55
|
+
@EncryptField(algorithm = AlgorithmType.SM4) // SM4
|
|
56
|
+
private String phone;
|
|
57
|
+
|
|
58
|
+
@EncryptField(algorithm = AlgorithmType.AES, encode = EncodeType.HEX) // AES + HEX 编码
|
|
59
|
+
private String bankCard;
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## @RateLimiter 注解参数
|
|
64
|
+
|
|
65
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
66
|
+
|------|------|--------|------|
|
|
67
|
+
| `key` | String | `""` | 限流 key,支持 SpEL |
|
|
68
|
+
| `time` | int | `60` | 时间窗口(秒) |
|
|
69
|
+
| `count` | int | `100` | 最大请求次数 |
|
|
70
|
+
| `limitType` | LimitType | `DEFAULT` | 限流类型(DEFAULT/IP/CLUSTER) |
|
|
71
|
+
| `message` | String | 国际化 key | 错误提示 |
|
|
72
|
+
| `timeout` | int | `86400` | Redis 超时时间(秒) |
|
|
73
|
+
|
|
74
|
+
## @RepeatSubmit 注解参数
|
|
75
|
+
|
|
76
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
77
|
+
|------|------|--------|------|
|
|
78
|
+
| `interval` | int | `5000` | 间隔时间 |
|
|
79
|
+
| `timeUnit` | TimeUnit | `MILLISECONDS` | 时间单位 |
|
|
80
|
+
| `message` | String | 国际化 key | 错误提示 |
|
|
81
|
+
|
|
82
|
+
## 文件上传安全模板
|
|
83
|
+
|
|
84
|
+
```java
|
|
85
|
+
private static final Set<String> ALLOWED_TYPES = Set.of(
|
|
86
|
+
"image/jpeg", "image/png", "image/gif", "image/webp"
|
|
87
|
+
);
|
|
88
|
+
private static final long MAX_FILE_SIZE = 10 * 1024 * 1024; // 10MB
|
|
89
|
+
|
|
90
|
+
public void uploadFile(MultipartFile file) {
|
|
91
|
+
if (!ALLOWED_TYPES.contains(file.getContentType())) {
|
|
92
|
+
throw new ServiceException("不支持的文件类型");
|
|
93
|
+
}
|
|
94
|
+
if (file.getSize() > MAX_FILE_SIZE) {
|
|
95
|
+
throw new ServiceException("文件大小不能超过10MB");
|
|
96
|
+
}
|
|
97
|
+
String extension = getExtension(file.getOriginalFilename());
|
|
98
|
+
if (!Set.of(".jpg", ".jpeg", ".png", ".gif", ".webp").contains(extension.toLowerCase())) {
|
|
99
|
+
throw new ServiceException("不支持的文件扩展名");
|
|
100
|
+
}
|
|
101
|
+
String newName = UUID.randomUUID() + extension; // 重命名防路径穿越
|
|
102
|
+
}
|
|
103
|
+
```
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# 数据脱敏策略完整列表(17种)
|
|
2
|
+
|
|
3
|
+
> 来源:`ruoyi-common-sensitive/.../core/SensitiveStrategy`
|
|
4
|
+
|
|
5
|
+
| 策略 | 枚举值 | 脱敏效果 | 说明 |
|
|
6
|
+
|------|--------|---------|------|
|
|
7
|
+
| 身份证 | `ID_CARD` | `110***********1234` | 保留前3位和后4位 |
|
|
8
|
+
| 手机号 | `PHONE` | `138****8888` | 保留前3位和后4位 |
|
|
9
|
+
| 邮箱 | `EMAIL` | `t**@example.com` | 保留用户名首尾和完整域名 |
|
|
10
|
+
| 银行卡 | `BANK_CARD` | `6222***********1234` | 保留前4位和后4位 |
|
|
11
|
+
| 中文姓名 | `CHINESE_NAME` | `张*` | 保留姓氏 |
|
|
12
|
+
| 地址 | `ADDRESS` | `北京市朝阳区****` | 保留前8个字符 |
|
|
13
|
+
| 固定电话 | `FIXED_PHONE` | `010****1234` | 保留区号和后4位 |
|
|
14
|
+
| 密码 | `PASSWORD` | `******` | 全部掩码 |
|
|
15
|
+
| IPv4 地址 | `IPV4` | `192.168.***.***` | 保留网络段 |
|
|
16
|
+
| IPv6 地址 | `IPV6` | 部分隐藏 | 保留前缀 |
|
|
17
|
+
| 车牌号 | `CAR_LICENSE` | `京A***12` | 支持普通和新能源 |
|
|
18
|
+
| 用户ID | `USER_ID` | 随机数字 | 生成随机数字替代 |
|
|
19
|
+
| 首字符保留 | `FIRST_MASK` | `张***` | 只显示第一个字符 |
|
|
20
|
+
| 通用掩码 | `STRING_MASK` | `1234**7890` | 前4+4个*+后4 |
|
|
21
|
+
| 高安全级别 | `MASK_HIGH_SECURITY` | `to******en` | 前2后2可见 |
|
|
22
|
+
| 清空 | `CLEAR` | 空字符串 | 返回空字符串 |
|
|
23
|
+
| 置空 | `CLEAR_TO_NULL` | `null` | 返回 null |
|
|
24
|
+
|
|
25
|
+
## 用法示例
|
|
26
|
+
|
|
27
|
+
```java
|
|
28
|
+
@Sensitive(strategy = SensitiveStrategy.PHONE)
|
|
29
|
+
private String phone;
|
|
30
|
+
|
|
31
|
+
@Sensitive(strategy = SensitiveStrategy.ID_CARD)
|
|
32
|
+
private String idCard;
|
|
33
|
+
|
|
34
|
+
@Sensitive(strategy = SensitiveStrategy.ADDRESS)
|
|
35
|
+
private String address;
|
|
36
|
+
|
|
37
|
+
@Sensitive(strategy = SensitiveStrategy.IPV4)
|
|
38
|
+
private String loginIp;
|
|
39
|
+
|
|
40
|
+
@Sensitive(strategy = SensitiveStrategy.CAR_LICENSE)
|
|
41
|
+
private String carNumber;
|
|
42
|
+
```
|