Skip to content

Conversation

Copy link

Copilot AI commented Dec 30, 2025

TYC API queries for ICP domain records were only returning the first page of results due to hardcoded pagination metadata.

Changes

internal/tycapi/tycapi.go

  • Set Size field dynamically to actual items returned (len(items)) instead of hardcoded 20
  • Enables correct pagination calculation: pages = (total + size - 1) / size
// Before: pagination breaks when API doesn't return exactly 20 items
info = common.InfoPage{
    Size:  20,
    Total: res.Get("total").Int(),
    Data:  res.Get("items").Array(),
}

// After: pagination works with actual response size
items := res.Get("items").Array()
info = common.InfoPage{
    Size:  int64(len(items)),
    Total: res.Get("total").Int(),
    Data:  items,
}

This aligns with the pattern used in other providers (aiqicha, kuaicha) where Size reflects per-page item count for pagination logic in runner/enscan.go.

Original prompt

This section details on the original issue you should resolve

<issue_title>tyc获取icp备案域名只能获取到第一页</issue_title>
<issue_description>Image</issue_description>

Comments on the Issue (you are @copilot in this section)

@keac 请师傅详细列下查询的命令和使用程序的版本号

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 30, 2025 02:17
Co-authored-by: keac <16091665+keac@users.noreply.github.com>
Co-authored-by: keac <16091665+keac@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix pagination issue on ICP domain retrieval Fix TYC API pagination to retrieve all ICP domain pages Dec 30, 2025
Copilot AI requested a review from keac December 30, 2025 02:20
@keac keac closed this Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tyc获取icp备案域名只能获取到第一页

2 participants