Skip to content

Commit 1534abd

Browse files
authored
feat(util/gpage): marked deprecated (#4230)
1 parent fee38b4 commit 1534abd

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

Diff for: net/ghttp/ghttp_request_param_page.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ import (
1717
// GetPage creates and returns the pagination object for given `totalSize` and `pageSize`.
1818
// NOTE THAT the page parameter name from clients is constantly defined as gpage.DefaultPageName
1919
// for simplification and convenience.
20+
//
21+
// Deprecated: wrap this pagination html content in business layer.
2022
func (r *Request) GetPage(totalSize, pageSize int) *gpage.Page {
2123
// It must have Router object attribute.
2224
if r.Router == nil {
23-
panic("Router object not found")
25+
panic("router object not found")
2426
}
2527
var (
2628
url = *r.URL

Diff for: util/gpage/gpage.go

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// You can obtain one at https://github.com/gogf/gf.
66

77
// Package gpage provides useful paging functionality for web pages.
8+
//
9+
// Deprecated: wrap this pagination html content in business layer.
810
package gpage
911

1012
import (
@@ -18,6 +20,8 @@ import (
1820

1921
// Page is the pagination implementer.
2022
// All the attributes are public, you can change them when necessary.
23+
//
24+
// Deprecated: wrap this pagination html content in business layer.
2125
type Page struct {
2226
TotalSize int // Total size.
2327
TotalPage int // Total page, which is automatically calculated.
@@ -48,6 +52,8 @@ const (
4852
// /user/list/{.page}, /user/list/{.page}.html, /user/list?page={.page}&type=1, etc.
4953
// The build-in variable in `urlTemplate` "{.page}" specifies the page number, which will be replaced by certain
5054
// page number when producing.
55+
//
56+
// Deprecated: wrap this pagination html content in business layer.
5157
func New(totalSize, pageSize, currentPage int, urlTemplate string) *Page {
5258
p := &Page{
5359
LinkStyle: "GPageLink",

0 commit comments

Comments
 (0)