From 5e6d0b79e3809931e10404645ac73583a2798574 Mon Sep 17 00:00:00 2001 From: 梁剑锋 <1822213252@qq.com> Date: 星期二, 28 六月 2022 18:56:05 +0800 Subject: [PATCH] update 新增短信接口实现类@Override注解 --- ruoyi-common/src/main/java/com/ruoyi/common/enums/SensitiveStrategy.java | 35 ++++++++++++++++++++++++++--------- 1 files changed, 26 insertions(+), 9 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/SensitiveStrategy.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/SensitiveStrategy.java index 5f9bf72..f667173 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/enums/SensitiveStrategy.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/SensitiveStrategy.java @@ -1,30 +1,47 @@ package com.ruoyi.common.enums; import cn.hutool.core.util.DesensitizedUtil; +import lombok.AllArgsConstructor; + import java.util.function.Function; /** * 鑴辨晱绛栫暐 - * @author Yjoioooo + * + * @author Yjoioooo + * @version 3.6.0 */ +@AllArgsConstructor public enum SensitiveStrategy { - /** 韬唤璇佽劚鏁� */ + /** + * 韬唤璇佽劚鏁� + */ ID_CARD(s -> DesensitizedUtil.idCardNum(s, 3, 4)), - /** 鎵嬫満鍙疯劚鏁� */ + /** + * 鎵嬫満鍙疯劚鏁� + */ PHONE(DesensitizedUtil::mobilePhone), - /** 鍦板潃鑴辨晱 */ - ADDRESS(s -> DesensitizedUtil.address(s, 8)); + /** + * 鍦板潃鑴辨晱 + */ + ADDRESS(s -> DesensitizedUtil.address(s, 8)), + + /** + * 閭鑴辨晱 + */ + EMAIL(DesensitizedUtil::email), + + /** + * 閾惰鍗� + */ + BANK_CARD(DesensitizedUtil::bankCard); //鍙嚜琛屾坊鍔犲叾浠栬劚鏁忕瓥鐣� private final Function<String, String> desensitizer; - - SensitiveStrategy(Function<String, String> desensitizer) { - this.desensitizer = desensitizer; - } public Function<String, String> desensitizer() { return desensitizer; -- Gitblit v1.9.3