更新存量问题

This commit is contained in:
白茶清欢 2024-04-07 21:35:55 +08:00
parent b1919eb898
commit df4a0a0a39
3 changed files with 8 additions and 4 deletions

View File

@ -7,6 +7,8 @@
// Date : 2023-05-23 14:25 // Date : 2023-05-23 14:25
package data_mask package data_mask
import "git.zhangdeman.cn/zhangdeman/data_mask/define"
// DefaultDataMask 默认实现 // DefaultDataMask 默认实现
// //
// Author : go_developer@163.com<白茶清欢> // Author : go_developer@163.com<白茶清欢>
@ -20,5 +22,5 @@ func (d DefaultDataMask) Mask(input string) string {
} }
func (d DefaultDataMask) Type() string { func (d DefaultDataMask) Type() string {
return TypeDefault return define.TypeDefault
} }

View File

@ -1,4 +1,4 @@
// Package data_mask ... // Package define ...
// //
// Description : data_mask ... // Description : data_mask ...
// //

View File

@ -7,6 +7,8 @@
// Date : 2023-05-23 14:25 // Date : 2023-05-23 14:25
package data_mask package data_mask
import "git.zhangdeman.cn/zhangdeman/data_mask/strategy"
var ( var (
maskInstanceTable = make(map[string]IDataMask) maskInstanceTable = make(map[string]IDataMask)
defaultDataMask = &DefaultDataMask{} defaultDataMask = &DefaultDataMask{}
@ -14,8 +16,8 @@ var (
func init() { func init() {
maskInstanceList := []IDataMask{ maskInstanceList := []IDataMask{
&MailDataMask{}, // 邮箱脱敏 &strategy.MailDataMask{}, // 邮箱脱敏
&PhoneDataMask{}, // 手机号脱敏 &strategy.PhoneDataMask{}, // 手机号脱敏
} }
for _, item := range maskInstanceList { for _, item := range maskInstanceList {
maskInstanceTable[item.Type()] = item maskInstanceTable[item.Type()] = item