From 5df751f5ca68234ef94b69c206c8957e1623b66f Mon Sep 17 00:00:00 2001 From: Singee Date: Thu, 21 Dec 2023 22:15:29 +0800 Subject: [PATCH] increate model limits --- model/user.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/user.go b/model/user.go index 06cf685c..b941c164 100644 --- a/model/user.go +++ b/model/user.go @@ -13,8 +13,8 @@ import ( // Otherwise, the sensitive information will be saved on local storage in plain text! type User struct { Id int `json:"id"` - Username string `json:"username" gorm:"unique;index" validate:"max=12"` - Password string `json:"password" gorm:"not null;" validate:"min=8,max=20"` + Username string `json:"username" gorm:"unique;index" validate:"max=30"` + Password string `json:"password" gorm:"not null;" validate:"min=8,max=30"` DisplayName string `json:"display_name" gorm:"index" validate:"max=20"` Role int `json:"role" gorm:"type:int;default:1"` // admin, common Status int `json:"status" gorm:"type:int;default:1"` // enabled, disabled