package service import ( "cc-officialweb/models" "cc-officialweb/utils" ) // GetResource 获取资源 func GetResource(types string) []models.Resource { var resource []models.Resource tx := utils.DB.Where("type = ?", types).Find(&resource) if tx.Error != nil { return nil } return resource }