| | |
| | | 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)) |
| | | |
| | | picDateStr, err := time.Parse("2006-01-02 15:04:05", source["picDate"].(string)) |
| | | fmt.Println("picDate: ", picDateStr) |
| | | if err == nil { |
| | | source["picDate"] = picDateStr |
| | |
| | | } |
| | | |
| | | 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 { |