Who invented mooncake?

There are different accounts regarding the invention of mooncake, but one well-known story involves the overthrow of the Yuan Dynasty by the Ming rebels. According to this story, a message stating the date and time of the uprising was hidden inside the mooncakes and distributed among the rebels as a secret signal to coordinate the attack. These early mooncakes were simple pastry containing lotus seed paste and were used to pass secret messages.