[🚀] v0.12.23 #23

Merged
bvbej merged 1 commits from dev into main 2025-03-04 17:14:13 +08:00
2 changed files with 18 additions and 6 deletions

View File

@ -60,3 +60,12 @@ func (e Email) MarshalJSON() ([]byte, error) {
v := fmt.Sprintf("%s***%s", split[0][:1], split[0][len(split[0])-1:]) v := fmt.Sprintf("%s***%s", split[0][:1], split[0][len(split[0])-1:])
return []byte(`"` + v + "@" + split[1] + `"`), nil return []byte(`"` + v + "@" + split[1] + `"`), nil
} }
func (usc UnifiedSocialCreditCode) MarshalJSON() ([]byte, error) {
if len(usc) != 18 {
return []byte(`"` + usc + `"`), nil
}
v := fmt.Sprintf("%s**********%s", usc[:4], usc[14:])
return []byte(`"` + v + `"`), nil
}

View File

@ -1,19 +1,22 @@
package ddm package ddm
// 手机号 132****7986 // Mobile 手机号 132****7986
type Mobile string type Mobile string
// 银行卡号 622888******5676 // BankCard 银行卡号 622888******5676
type BankCard string type BankCard string
// 身份证号 1******7 // IDCard 身份证号 1******7
type IDCard string type IDCard string
// 姓名 *鸿章 // IDName 姓名 *鸿章
type IDName string type IDName string
// 密码 ****** // PassWord 密码 ******
type PassWord string type PassWord string
// 邮箱 l***w@gmail.com // Email 邮箱 l***w@gmail.com
type Email string type Email string
// UnifiedSocialCreditCode 统一社会信用代码 9137****73X
type UnifiedSocialCreditCode string