Mechanism of the 31P(p, γ)32S reaction in the giant dipole resonance region