fix: statistic upstream url change & save article to private

This commit is contained in:
Zhaolong
2022-04-27 23:12:20 +08:00
parent b92598ecc4
commit 09b8e8e262
6 changed files with 13 additions and 18 deletions

View File

@@ -45,13 +45,9 @@ type AreaSlice []models.AreaInfo
func cacheNCovStatistics() {
resp := utils.GetWhioutHeader(global.CHINA_NCOV_STATISTIC_URL)
var nCovRes map[string]string
var nCovRes map[string]interface{}
json.Unmarshal([]byte(resp), &nCovRes)
var nCovResData map[string]interface{}
err := json.Unmarshal([]byte(nCovRes["data"]), &nCovResData)
if err != nil {
panic(err)
}
nCovResData := (nCovRes["data"].(map[string]interface{}))["diseaseh5Shelf"].(map[string]interface{})
if !needToRecache(nCovResData) {
return
}