package model import ( "gorm.io/gorm" ) type Notice struct { ID int `json:"id" gorm:"primaryKey" ` Notice string `json:"notice" gorm:"comment:'ε…¬ε‘Š'"` Status int `json:"status" gorm:"comment:'ηŠΆζ€'"` } func (Notice) TableName() string { return "yyz_notice" } func GetNotice(db *gorm.DB) ([]Notice, error) { notice := []Notice{} err := db.Debug().Find(¬ice).Error if err != nil && err != gorm.ErrRecordNotFound { return notice, err } return notice, nil }