package global import ( "errors" "fmt" "nCovTrack-Backend/config" "net/http" "github.com/gin-gonic/gin" "go.uber.org/zap" "gorm.io/gorm" ) var ( ServerSettings config.ServerConfig Db *gorm.DB RootRouter *gin.RouterGroup Logger *zap.SugaredLogger HttpClient map[string]*http.Client ) func GetListenOn() string { return fmt.Sprintf("%s:%d", ServerSettings.Listen, ServerSettings.Port) } func GetHttpClient(key string) (*http.Client, error) { client := HttpClient[string(key)] if client == nil { return nil, errors.New("Not fount the http client: " + key) } return client, nil } const ( CHINA_NCOV_STATISTIC_URL = "https://view.inews.qq.com/g2/getOnsInfo?name=disease_h5" )