广告点击接口添加

This commit is contained in:
谢宇宁
2026-10-29 16:25:57 +07:00
parent 3c9ab2630f
commit 36c5f6c48a
8 changed files with 68 additions and 7 deletions
+15
View File
@@ -576,6 +576,21 @@
"body": [],
"requiredBody": [],
"confirmedBy": "用户提供接口,2026-10-24"
},
"POST ads/click": {
"query": [],
"requiredQuery": [],
"body": [
"adsId",
"appId",
"location"
],
"requiredBody": [
"adsId",
"appId",
"location"
],
"confirmedBy": "用户提供接口,2026-10-29"
}
}
}
+6
View File
@@ -119,3 +119,9 @@ test('carousel frames keep their own titles below the stable page heading, inclu
}
assert.ok(!/<h1\b/.test(hero(null)));
});
test('ad links carry the numeric ad ID and slot for click reporting, and invalid identities are omitted',()=>{
const html=promotionRow([{id:'1138200002',location:2,title:'广告',images:'https://example.com/ad.png',link:'https://example.com/landing'},{id:'bad-id',location:2,title:'无效',images:'https://example.com/b.png',link:'https://example.com/b'}]);
assert.ok(html.includes('data-ad data-ads-id="1138200002" data-ads-location="2" href="https://example.com/landing"'));
assert.equal((html.match(/data-ads-id=/g)||[]).length,1);
});