No I mean taking attacks, AC is part of that but so is damage resistance and so is temporary hit points other defenses.
As far as single class characters go, a Bladesinger with spells specifically selected for defense and using lots of high level slots for false life is the most durable single class build I have come across. I will last much longer than a Barbarian. Not a little longer, much longer.
Most Fighters or Paladins with maximum AC and defensive duelist will do better than a Barbarian as well.
At high level I really think Barbarian is eve very competitive when you considered casters and highly armored creatures.
I think that there are four elements that people usually forget when comparing casters abilities. Particularly with simplistic comparisons like in the list above.
The first problem is that when wizards try to do what you describe it destroys their action economy. Yes it is true that casters can makes themselves faster or tougher. But it takes time to do so. If you have 3 rounds to prepare beforehand then casters are in a great position but if don’t as is often the case then you spend the first few rounds trying to get ready for the fight. You cast a spell to protect yourself, you can a spell to give you some bonus action damage. Now only on round 3 are you fighting at the level of the fighter and guess what the combat ends this round.
Secondly slots are not anywhere as common as people think they are. Particularly when also using them to boost temporary hp with false life, give mage armour etc. the reason being that there is not a helpful gauge on your wizard that tells you when the day is going to end. You have to hold a certain amount back in reserve because you don’t know if you’ll be attacked in the night or if one more encounter is needed. Sure in hindsight you can look back and say I had slots left but you didn’t know that at the time. You also won’t know the relative difficulty of what is coming down the line so you are more likely to hold stronger powers in reserve.
When it comes to prepared spells boy do those get assigned quickly. 5e is a big improvement on previous editions because of the flexibility but there are so many spells that you know will be used every day just to make a wizard survivable they just become a given and quickly reduce the flexibility. Mage armour, shield, misty step, mirror image. That’s half your spells prepared at 5th level. The idea of shroedinger’s wizard is very much a fantasy.
Lastly the dreaded concentration. Which is relevant in few ways - first losing it, where the damage monsters do scales much faster than the progression of your concentration skill. Secondly concentration causes further restriction on your prepared spells choice because of the need to have both concentration spells and non-concentration. Lastly the risk in combat that a different concentration spell may be required to the one you have up - therefore causing you to have to voluntarily drop the previous spell.
I love casters. I play them about 50% of the time. But I see conversations around how powerful they are frequently forget/ignore the above restrictions.