Integral and distance integral Cayley graphs over generalized dihedral groups