  We modify the method to generate the exact solutions of the Einstein
equations basing on the laws of thermodynamics. Firstly, the Komar mass is used
to take the place of the Misner-Sharp energy which is used in the original
methods, and then several exact solutions of Einstein equations are obtained,
including the black hole solution which surrounded by quintessence. Moreover,
the geometry surface gravity defined by Komar mass is obtained. Secondly, we
use both the Komar mass and the ADM mass to modify such method, and the similar
results are obtained. Moreover, with some generalize added to the definition of
the ADM mass, our method can be generalized to global monopole sapcetime.
