He was also a government official serving under the Ming Chongzhen Emperor, the short-lived Dashun regime of peasant-rebel Li Zicheng, and then the Manchu-led Qing dynasty.
[2] Passing the Imperial Civil Service Examinations for the Jiangnan Region as a top candidate in 1641, Gong Dingzi was posted to the capital city Beijing.
[3] On his way, he met his future bride, Gu Mei, who was one of the famous courtesan of the Qinhuai River district of Jiankang (modern Nanjing).
Shortly afterwards the capital was first sacked by the peasant army led by Li Zicheng, and then seized by the Manchu forces which poured in through the Shanhai Pass and proceeded to establish the Qing dynasty.
Among other works, Gong Dingzi's White Willow Gate (Baimen liu) collection of ci (song lyric) poetry survives.