package models type Test struct { BaseModel Title1 string `gorm:"type:varchar(255);not null;comment:标题1" json:"title1"` Title2 string `gorm:"type:varchar(255);not null;comment:标题2" json:"title2"` Title3 string `gorm:"type:varchar(255);not null;comment:标题3" json:"title3"` } func (Test) TableName() string { return "test" }