| | |
| | | |
| | | source["videoNum"] = getVideoUrl(source) |
| | | |
| | | picDateStr, err := time.Parse("2006-01-02 15:04:05", source["picDate"].(string)) |
| | | fmt.Println("picDate: ", picDateStr.Format("2006-01-02 15:04:05")) |
| | | picDateStr := (source["picDate"].(time.Time)).Format("2006-01-02 15:04:05") |
| | | fmt.Println("picDate: ", picDateStr) |
| | | if err == nil { |
| | | source["picDate"] = picDateStr.Format("2006-01-02 15:04:05") |
| | | source["picDate"] = picDateStr |
| | | } |
| | | |
| | | baseInfo := getSourceBaseInfo(source) |
| | |
| | | } |
| | | |
| | | func getAgeDesc(age interface{})(ageDesc string) { |
| | | fmt.Println("ageInterface: ", age) |
| | | if age !=nil { |
| | | ageInt := age.(float64) |
| | | if ageInt >0 && ageInt<7 { |
| | |
| | | ageDesc = "" |
| | | } |
| | | } |
| | | fmt.Println("ageDescription: ", ageDesc) |
| | | return ageDesc |
| | | } |
| | | |
| | |
| | | Content string `json:"content"` |
| | | } |
| | | |
| | | func getSourceBaseInfo(source map[string]interface{}) (baseInfoJson string) { |
| | | func getSourceBaseInfo(source map[string]interface{}) []BaseInfo { |
| | | sdkType := source["sdkType"].(string) |
| | | baseInfoArr := make([]BaseInfo,0) |
| | | if sdkType == "人脸" { |
| | |
| | | } |
| | | |
| | | baseInfoArr = append(baseInfoArr, baseInfo) |
| | | bytes, err := json.Marshal(baseInfoArr) |
| | | if err !=nil { |
| | | return "" |
| | | } |
| | | return string(bytes) |
| | | //bytes, err := json.Marshal(baseInfoArr) |
| | | //if err !=nil { |
| | | // return "" |
| | | //} |
| | | } |
| | | return "" |
| | | return baseInfoArr |
| | | } |
| | | |
| | | func getVideoUrl(source map[string]interface{}) (videoUrl string){ |