diff --git a/apis/token/schema.go b/apis/token/schema.go index 1a249d2..9da7f60 100644 --- a/apis/token/schema.go +++ b/apis/token/schema.go @@ -3,6 +3,6 @@ package token type CreateTokenRequest struct { DeviceID string `json:"device_id" validate:"max=64"` Service string `json:"service" validate:"required,oneof=apns fcm mipush"` - Token string `json:"token" validate:"max=64"` + Token string `json:"token" validate:"max=256"` PackageName string `json:"package_name"` } diff --git a/models/token.go b/models/token.go index 9d0845c..c78b529 100644 --- a/models/token.go +++ b/models/token.go @@ -10,7 +10,7 @@ type PushToken struct { UserID int `json:"user_id" gorm:"primaryKey;not null"` // not required Service PushService `json:"service" gorm:"not null" swaggertype:"string" validate:"required,oneof=apns fcm mipush"` DeviceID string `json:"device_id" gorm:"uniqueIndex:,length:10;not null;size:64" validate:"required,max=64"` - Token string `json:"token" gorm:"primaryKey;not null;size:64;index:,length:10" validate:"required,max=64"` + Token string `json:"token" gorm:"primaryKey;not null;size:256;index:,length:10" validate:"required,max=256"` PackageName string `json:"package_name"` CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"` UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`