| | |
| | | if exist { |
| | | source["race"] = prace |
| | | } |
| | | fmt.Println("race: ", source["race"]) |
| | | |
| | | source["ageDescription"] = getAgeDesc(source["Age"]) |
| | | |
| | | source["videoNum"] = getVideoUrl(source) |
| | | timeFormat := "2019-05-28 15:04:05" |
| | | picDateStr, err := time.Parse(timeFormat, source["picDate"].(string)) |
| | | fmt.Println("picDate: ", picDateStr) |
| | | |
| | | picDateStr, err := time.Parse("2006-01-02 15:04:05", source["picDate"].(string)) |
| | | fmt.Println("picDate: ", picDateStr.Format("2006-01-02 15:04:05")) |
| | | if err == nil { |
| | | source["picDate"] = picDateStr |
| | | source["picDate"] = picDateStr.Format("2006-01-02 15:04:05") |
| | | } |
| | | |
| | | baseInfo := getSourceBaseInfo(source) |
| | |
| | | } |
| | | |
| | | func getAgeDesc(age interface{})(ageDesc string) { |
| | | fmt.Println("ageInterface: ", age) |
| | | if age !=nil { |
| | | ageInt := age.(int32) |
| | | ageInt := age.(int) |
| | | if ageInt >0 && ageInt<7 { |
| | | ageDesc = "童年" |
| | | } else if ageInt >=7 && ageInt<18 { |
| | |
| | | seccond := strconv.Itoa(sec) |
| | | |
| | | prama := "{\"query\":{\"bool\":{\"filter\":[{\"range\":{\"picDate\":{\"gte\":\"now+8h-" + seccond + "s\",\"lt\":\"now+8h\"}}}]}},\"size\":\"1000\",\"sort\":[{\"picDate\":{\"order\":\"desc\"}}]," + |
| | | "\"_source\":[\"baseInfo\",\"Gender\",\"personId\",\"personPicUrl\",\"indeviceName\",\"imgKey\",\"sdkType\",\"ageDescription\",\"indeviceid\",\"content\",\"Id\",\"picAddress\",\"picMaxUrl\",\"picDate\",\"Race\",\"videoNum\",\"picSmUrl\",\"taskName\",\"personIsHub\",\"idcard\",\"videoIp\",\"videoReqNum\"]" + |
| | | "\"_source\":[\"baseInfo\",\"Gender\",\"Age\",\"personId\",\"personPicUrl\",\"indeviceName\",\"imgKey\",\"sdkType\",\"ageDescription\",\"indeviceid\",\"content\",\"Id\",\"picAddress\",\"picMaxUrl\",\"picDate\",\"Race\",\"videoNum\",\"picSmUrl\",\"taskName\",\"personIsHub\",\"idcard\",\"videoIp\",\"videoReqNum\"]" + |
| | | "}" |
| | | err, tokenRes := GetEsDataReq(url, prama, picurl, true) |
| | | |