feat: fully implement profile controller;
feat: implement file upload handling in controller with size and type validation; feat: add custom validation rules for bio and color hex fields; refactor: enhance request handling with dedicated client info extraction; chore: update profile DTOs with validation tags; docs: profile controller swagger
This commit is contained in:
@@ -48,6 +48,20 @@ func GetCustomHandlers() []CustomValidatorHandler {
|
||||
return regexp.MustCompile(`^.{1,75}$`).MatchString(username)
|
||||
}},
|
||||
|
||||
{
|
||||
FieldName: "bio",
|
||||
Function: func(fl validator.FieldLevel) bool {
|
||||
username := fl.Field().String()
|
||||
return regexp.MustCompile(`^.{1,512}$`).MatchString(username)
|
||||
}},
|
||||
|
||||
{
|
||||
FieldName: "color_hex",
|
||||
Function: func(fl validator.FieldLevel) bool {
|
||||
username := fl.Field().String()
|
||||
return regexp.MustCompile(`^#[0-9a-f]{6,6}$`).MatchString(username)
|
||||
}},
|
||||
|
||||
{
|
||||
FieldName: "password",
|
||||
Function: func(fl validator.FieldLevel) bool {
|
||||
|
||||
Reference in New Issue
Block a user