package services import ( "fmt" "hongze/hongze_api/models" "strings" ) func HomeList(userId, companyId int) (items []*models.HomeList, err error) { defer func() { fmt.Println("line 11") fmt.Println("err:",err) }() permissionKey, err := models.GetPermissionSearchKeyWord(userId) if err != nil { fmt.Println("GetPermissionSearchKeyWord Err:"+err.Error()) return } var permissionArr []string for _, v := range permissionKey { permissionArr = append(permissionArr, v.KeyWord) } permissionStr := strings.Join(permissionArr, "','") permissionStr = "'" + permissionStr + "'" maxPermissionCount, err := models.GetUserIsMaxPermission(companyId) if err != nil { fmt.Println("GetUserIsMaxPermission Err:" + err.Error()) return } permissionStatus, err := CheckUserPermission(userId) if err != nil { fmt.Println("CheckUserPermission Err:" + err.Error()) return } items, err = models.ListHome(userId, maxPermissionCount, permissionStatus, permissionStr) if err != nil { fmt.Println("ListHome Err:" + err.Error()) } return }