package awc // func GetKeyG() string { // key := TestKey // if config.GetBase().Release { // key = AgentKey // } // return util.CalculateMD5(time.Now().UTC().Add(-4*time.Hour).Format("06012") + AgentID + key) // } // func GetSignKey(req interface{}) string { // keyG := GetKeyG() // str := "" // ref := reflect.ValueOf(req) // reft := reflect.TypeOf(req) // if reft.Kind() == reflect.Ptr { // ref = ref.Elem() // reft = reft.Elem() // } // for i := 0; i < ref.NumField(); i++ { // str += fmt.Sprintf("%s=%v&", reft.Field(i).Name, ref.Field(i).Interface()) // } // return util.GenerateRandomString(6) + util.CalculateMD5(fmt.Sprintf("%sAgentId=%s", str, AgentID)+keyG) + util.GenerateRandomString(6) // }