You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: activity.go
    path of file: ./repos/erda/internal/core/legacy/endpoints
    
    the code of the file until where you have to start completion: // Copyright (c) 2021 Terminus, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License
    
func getActivityListParam(r *http.Request) (*apistructs.ActivitiyListRequest, error) {
	// 获取runtimeID
	runtimeIDStr := r.URL.Query().Get("runtimeId")
	var (
		runtimeID int64
		err       error
	)
	if runtimeIDStr != "" {
		runtimeID, err = strutil.Atoi64(runtimeIDStr)
		if err != nil {
			return nil, err
		}
	}

	// 获取pageNo
	pageNoStr := r.URL.Query().Get("pageNo")
	if pageNoStr == "" {
		pageNoStr = "1"
	}
	pageNo, err := strconv.Atoi(pageNoStr)
	if err != nil {
		return nil, err
	}

	// 获取pageSize
	pageSizeStr := r.URL.Query().Get("pageSize")
	if pageSizeStr == "" {
		pageSizeStr = "20"
	}
	pageSize, err := strconv.Atoi(pageSizeStr)
	if err != nil {
		return nil, err
	}

	return &apistructs.ActivitiyListRequest{
		RuntimeID: runtimeID,
		PageNo:    pageNo,
		PageSize:  pageSize,
	}, nil
}