feat: dtos for wishList service;
feat: validator for guid; feat: created interface for wishlist service
This commit is contained in:
@@ -42,6 +42,13 @@ func GetCustomHandlers() []CustomValidatorHandler {
|
||||
return regexp.MustCompile(`^[a-zA-Z0-9_]{3,20}$`).MatchString(username)
|
||||
}},
|
||||
|
||||
{
|
||||
FieldName: "guid",
|
||||
Function: func(fl validator.FieldLevel) bool {
|
||||
guid := fl.Field().String()
|
||||
return regexp.MustCompile(`^([{(]?([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})[})]?)$`).MatchString(guid)
|
||||
}},
|
||||
|
||||
{
|
||||
FieldName: "name",
|
||||
Function: func(fl validator.FieldLevel) bool {
|
||||
|
||||
Reference in New Issue
Block a user