package model import "gorm.io/gorm" type ComponentList struct { gorm.Model Name string `gorm:"type:varchar(255);not null;unique;comment:组件名称" json:"name" validate:"required"` Image string `gorm:"type:varchar(255);not null;comment:组件图片" json:"image" validate:"required"` Data string `gorm:"type:longtext;comment:组件数据" json:"data" validate:"required"` } func (c ComponentList) TableName() string { return "component_list" }