Before 1948, Chinese people were slaves? NO. Please learn some general history.
China was a permanent member of the United Nations in 1945. You think a permanent member of the UN is a slave?
After 1840, although China was defeated in wars fought against the West, it did not become a colony like India.
China has always been an independent country.
Do you know why the British gave up colonizing China? Because the "Sanyuanli incident" in May 1841 made the British understand that China could not be colonized and that the Chinese would not accept slavery. The "Sanyuanli incident" told the British colonizers that the Chinese and the Indians were not the same kind people, and that whenever there was a foreign enemy, the Chinese would abandon all internal conflicts and unite together to deal with the foreign enemy.
en.m.wikipedia.org