This commit is contained in:
2024-10-15 17:19:23 +08:00
parent 8f903b457f
commit c76451788c
42 changed files with 1600 additions and 237 deletions

View File

@@ -117,6 +117,9 @@ type QYGLB4C0Request struct {
type YYSY4B37Request struct {
MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"`
}
type YYSY4B21Request struct {
MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"`
}
type YYSY6F2ERequest struct {
MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"`
MobileType string `json:"mobile_type" validate:"omitempty,validMobileType"`
@@ -139,5 +142,5 @@ type YYSYD50FRequest struct {
}
type YYSYF7DBRequest struct {
MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"`
StartDate string `json:"start_date" validate:"required,validDate"`
StartDate string `json:"start_date" validate:"required,validDate" encrypt:"false"`
}

View File

@@ -105,7 +105,7 @@ func validDate(fl validator.FieldLevel) bool {
// 自定义身份证校验
func validIDCard(fl validator.FieldLevel) bool {
id := fl.Field().String()
validIDPattern := `^\d{15}$|^\d{18}$|^\d{17}(\d|X|x)$` // 匹配15位或18位身份证
validIDPattern := `^\d{17}(\d|X|x)$` // 匹配18位身份证号码
matched, _ := regexp.MatchString(validIDPattern, id)
return matched
}