feat: 添加版本信息
This commit is contained in:
@@ -72,6 +72,20 @@ func GetRecords[T any](wk *WK, rType RecordType, courseID, page string) (*AllRec
|
||||
if !result.Status {
|
||||
return &result, fmt.Errorf("接口报错: %s", result.Msg)
|
||||
}
|
||||
currentPage := result.PageInfo.Page
|
||||
totalPages := result.PageInfo.PageCount
|
||||
|
||||
for currentPage < totalPages {
|
||||
nextPage := fmt.Sprint(currentPage + 1)
|
||||
nextResult, err := GetRecords[T](wk, rType, courseID, nextPage)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
result.List = append(result.List, nextResult.List...)
|
||||
log.Debug("Page", zap.Int("currentPage", currentPage), zap.Int("Page", nextResult.PageInfo.Page))
|
||||
currentPage = nextResult.PageInfo.Page
|
||||
}
|
||||
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user