In suit constructing 2D/1D MgIn2S4/CdS heterojunction system with enhanced photocatalytic activity towards treatment of wastewater and H2 production.