Skip to content

Add next_cursor to OA approval list result for pagination - #3327

Closed
JeffreySu with Copilot wants to merge 2 commits into
masterfrom
copilot/fix-pagination-issue
Closed

Add next_cursor to OA approval list result for pagination#3327
JeffreySu with Copilot wants to merge 2 commits into
masterfrom
copilot/fix-pagination-issue

Conversation

Copilot AI commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

OaApi.GetApprovalInfo request already supports cursor, but the response model lacked next_cursor, making documented pagination flow unusable from SDK types. This change exposes the response cursor so callers can iterate pages safely.

  • Model update: OA approval list response

    • Added next_cursor to GetApprovalInfoResult (OAJson/GetApprovalInfoResult.cs).
    • Keeps wire format aligned with WeCom OA API pagination contract.
  • Contract coverage: deserialization

    • Added GetApprovalInfoResultSupportsPaginationCursor in ApprovalContractTests.
    • Verifies sp_no_list and next_cursor deserialize together from API JSON.
  • Usage (pagination loop)

    var req = new GetApprovalInfoRequest { starttime = "...", endtime = "...", cursor = 0, size = 100 };
    GetApprovalInfoResult page;
    do
    {
        page = OaApi.GetApprovalInfo(accessToken, req);
        // consume page.sp_no_list
        req.cursor = page.next_cursor;
    } while (page.sp_no_list != null && page.sp_no_list.Count > 0);

Copilot AI linked an issue Aug 5, 2026 that may be closed by this pull request
Co-authored-by: JeffreySu <[email protected]>
Copilot AI changed the title [WIP] Fix pagination issue for GetApprovalInfo Add next_cursor to OA approval list result for pagination Aug 5, 2026
Copilot AI requested a review from JeffreySu August 5, 2026 09:46
@JeffreySu

Copy link
Copy Markdown
Owner

@copilot can you show me the official document URL and primary content. And you have to check the property name again.

@JeffreySu

JeffreySu commented Aug 5, 2026

Copy link
Copy Markdown
Owner

@copilot Your solution is wrong!

@JeffreySu JeffreySu closed this Aug 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.

能循环获取审批单号吗?

2 participants