Does the city destroy the resource?
If you have the relevant technology to access the resource normally (eg, you need Calendar to build a plantation on a hex containing wine to gain access to the resource) then building a city on the source will instantly grant you the resource.
If you do not have the tech when you build the city then it is not destroyed, it will just be granted to you when you unlock the required technology.
In my current game (I’m alt-tabbed as I type) I have a city built on spice generating 2 food, 2 hammers and 3 gold – not the usual 1 gold, and according to the help spice grants +2 gold on it’s tile. So it seems actually you do retain the output bonus from the resource.
And, you do lose the ability to build the relevant special construction on top of the tile for an extra production bonus (eg, you can’t build a plantation on the city hex, even if it’s placed on top of a wine resource, so won’t get the extra tile bonus you would normally get from building a plantation).