Exemple #1
0
//取得指标的key值
func (this *DataRows) GetKey(key string, row []interface{}) string {
	if this.RowMap == nil {
		return fmt.Sprintf("column map  is not found")
	}
	if i, ok := this.RowMap.Key[key]; ok {
		return compute.AsString(row[i])
	}
	//log.Infoln(this.RowMap)
	return fmt.Sprintf("column %s is not found", key)
}
Exemple #2
0
func (this *RequestData) GetStringArray(key string) []string {
	if v, ok := this.Param[key]; ok {
		if v, ok := v.([]interface{}); ok {
			re := []string{}
			for _, s := range v {
				re = append(re, compute.AsString(s))
			}
			return re
		} else {
			log.Infof("param %s value error", key, v)
		}
	}
	return nil
}
Exemple #3
0
func (this *RequestData) GetString(key string) string {
	if v, ok := this.Param[key]; ok {
		return compute.AsString(v)
	}
	return ""
}