From 0407477d521322791d7079b25a3699427d33f61d Mon Sep 17 00:00:00 2001 From: Ahmet Faruk Karakus Date: Wed, 6 Sep 2023 12:17:26 +0300 Subject: [PATCH] add type of cta text, edit test case for cta text --- adapters/huaweiads/huaweiads.go | 2 ++ .../huaweiadstest/exemplary/nativeSingleImage.json | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/adapters/huaweiads/huaweiads.go b/adapters/huaweiads/huaweiads.go index e71484c14ac..2b7c3c2548d 100644 --- a/adapters/huaweiads/huaweiads.go +++ b/adapters/huaweiads/huaweiads.go @@ -1160,7 +1160,9 @@ func (a *adapter) extractAdmNative(adType int32, content *content, bidType openr dataObject.Label = "desc" dataObject.Value = getDecodeValue(content.MetaData.Description) } + if asset.Data.Type == native1.DataAssetTypeCTAText { + dataObject.Type = native1.DataAssetTypeCTAText dataObject.Value = getDecodeValue(content.MetaData.Cta) } responseAsset.Data = &dataObject diff --git a/adapters/huaweiads/huaweiadstest/exemplary/nativeSingleImage.json b/adapters/huaweiads/huaweiadstest/exemplary/nativeSingleImage.json index 0f8ec996d8c..8e86675b4a6 100644 --- a/adapters/huaweiads/huaweiadstest/exemplary/nativeSingleImage.json +++ b/adapters/huaweiads/huaweiadstest/exemplary/nativeSingleImage.json @@ -5,7 +5,7 @@ { "id": "test-imp-id", "native": { - "request": "{\"context\":2,\"contextsubtype\":20,\"plcmttype\":1,\"plcmtcnt\":1,\"seq\":0,\"aurlsupport\":0,\"durlsupport\":0,\"eventtrackers\":[{\"event\":1,\"methods\":[1,2]}],\"privacy\":0,\"assets\":[{\"id\":100,\"title\":{\"len\":90},\"required\":1},{\"id\":103,\"img\":{\"type\":3,\"wmin\":200,\"hmin\":200},\"required\":1},{\"id\":105,\"data\":{\"type\":2,\"len\":90},\"required\":1}],\"ver\":\"1.2\"}", + "request": "{\"context\":2,\"contextsubtype\":20,\"plcmttype\":1,\"plcmtcnt\":1,\"seq\":0,\"aurlsupport\":0,\"durlsupport\":0,\"eventtrackers\":[{\"event\":1,\"methods\":[1,2]}],\"privacy\":0,\"assets\":[{\"id\":101,\"title\":{\"len\":90},\"required\":1},{\"id\":102,\"img\":{\"type\":3,\"wmin\":200,\"hmin\":200},\"required\":1},{\"id\":103,\"data\":{\"type\":2,\"len\":90},\"required\":1},{\"id\":105,\"data\":{\"type\":12,\"len\":90}}],\"ver\":\"1.2\"}", "ver": "1.2" }, "ext": { @@ -164,7 +164,7 @@ "appId": "101219405", "appPromotionChannel": "401721412", "clickUrl": "https://ads.huawei.com/usermgtportal/home/index.html#/", - "cta": "%e5%ae%89%e8%a3%85", + "cta": "install", "duration": 6038, "description": "", "icon": [ @@ -299,7 +299,7 @@ "huaweiads" ], "crid": "58022259", - "adm": "{\"ver\":\"1.2\",\"assets\":[{\"id\":100,\"title\":{\"text\":\"/test/\",\"len\":6}},{\"id\":103,\"img\":{\"type\":3,\"url\":\"http://image.jpg\",\"w\":720,\"h\":1280}},{\"id\":105,\"data\":{\"label\":\"desc\",\"value\":\"\"}}],\"link\":{\"url\":\"https://ads.huawei.com/usermgtportal/home/index.html#/\",\"clicktrackers\":[\"http://test/click\"]},\"eventtrackers\":[{\"event\":1,\"method\":1,\"url\":\"http://test/imp\"}]}", + "adm": "{\"ver\":\"1.2\",\"assets\":[{\"id\":101,\"title\":{\"text\":\"/test/\",\"len\":6}},{\"id\":102,\"img\":{\"type\":3,\"url\":\"http://image.jpg\",\"w\":720,\"h\":1280}},{\"id\":103,\"data\":{\"label\":\"desc\",\"value\":\"\"}},{\"id\":105,\"data\":{\"type\":12,\"value\":\"install\"}}],\"link\":{\"url\":\"https://ads.huawei.com/usermgtportal/home/index.html#/\",\"clicktrackers\":[\"http://test/click\"]},\"eventtrackers\":[{\"event\":1,\"method\":1,\"url\":\"http://test/imp\"}]}", "id": "test-imp-id", "impid": "test-imp-id", "price": 2.8,