func TestAliAfpAdapter_AskAd_Banner(t *testing.T) { apiData := getApiData() apiData.ApiInfo.ApiPositionSID = "63538378" apiData.AdRequst.AdWidth = 300 apiData.AdRequst.AdHeigh = 250 apiData.AdRequst.AdType = models.AD_TYPE_BANNER //adapter := &AliAfpAdapter{} //resp, err := adapter.AskAd(apiData) json := `JSON字符串` //fmt.Println(json) tresp := &aliafpResponse{} err := tresp.UnmarshalJSON([]byte(json)) if err != nil { t.Error("unmarshal banner json error:" + err.Error()) } respData, err := getAliafpResponse(tresp, apiData.AdRequst, apiData.AdidData, apiData.ApiInfo) if err != nil { t.Error("get banner response error:" + err.Error()) } spew.Dump(respData) if respData.AdId == "" { } }
时间: 2024-11-09 03:48:52