  Recently, AMS-02 reported their observed results of cosmic rays(CRs). In
addition to the AMS-02 data, we add HESS data to estimate the spectra of CR
electrons and the diffuse gamma rays above TeV. In the conventional diffusion
model, a global analysis is performed on the spectral features of CR electrons
and the diffuse gamma rays by GALRPOP package. The results show that the
spectrum structure of the primary component of CR electrons can not be fully
reproduced by a simple power law and the relevant break is around hundred GeV.
At 99\% C.L., the injection indices above the break decrease from 2.54 to 2.35,
but the ones below the break are only in the range 2.746 - 2.751. The spectrum
of CR electrons does not need to add TeV cutoff to match the features of HESS
data too. Based on the difference between the fluxes of CR electrons and the
primary component of them, the predicted excess of CR positrons is consistent
with the interpretations as pulsar or dark matter. In the analysis of the
Galactic diffuse gamma rays with the indirect constraint of AMS-02 and HESS
data, it is found that the fluxes of Galactic diffuse gamma rays are consistent
with GeV data of Fermi-LAT in the high latitude regions. The results indicate
that the inverse Compton scattering(IC) is the dominant component in the range
of the hundred GeV to tens of TeV respectively from the high latitude regions
to the low ones, and in the all regions of Galaxy the flux of diffuse gamma
rays is less than CR electrons at the energy scale of 20 TeV.
