The invention discloses a water outlet and air outlet switching mechanism of a main shaft. The main shaft comprises a rear cover and a conveying channel used for conveying
water flow or air flow to the front end of the main shaft, a water inlet is formed in the rear cover, a water-
air channel is formed in the rear cover, the water-
air channel is communicated between the water inlet and the conveying channel, an air inlet is fixed to the rear cover, an air
inlet channel is arranged between the air inlet and the steam channel, a one-way air valve is arranged in the air
inlet channel, and the airinlet end of the one-way air valve faces the air inlet; when
airflow is injected into the air inlet, the one-way air valve is opened, and the
airflow is transmitted to the front end of the spindle sequentially through the steam channel and the
transmission channel; when
water flow is injected into the water inlet, the one-way air valve is closed, and the
water flow is transmitted to the front endof the spindle sequentially through the steam channel and the
transmission channel. The water outlet state and the air outlet state can be automatically switched, meanwhile, switching control can beachieved only by occupying one path of IO port of the main shaft controller, and therefore cost is saved, linkage performance is improved, and
system resources are saved.