Documentation ¶
Index ¶
- Constants
- Variables
- func CalcShowFrom(pageNumber, pageSize uint32) uint32
- func CalcShowTo(showFromNumber, resultLength uint32) uint32
- func HasNextPage(pageResponse *PageResponse) bool
- func ParsePage(pageNumber uint32) uint32
- func ParsePageRequest(pageRequest *PageRequest) (*PageRequest, *PageOption)
- func ParsePageSize(pageSize uint32) uint32
- type PageOption
- type PageRequest
- func (*PageRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PageRequest) GetPage() uint32
- func (x *PageRequest) GetPageSize() uint32
- func (*PageRequest) ProtoMessage()
- func (x *PageRequest) ProtoReflect() protoreflect.Message
- func (x *PageRequest) Reset()
- func (x *PageRequest) String() string
- type PageResponse
- func (*PageResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PageResponse) GetPage() uint32
- func (x *PageResponse) GetPageSize() uint32
- func (x *PageResponse) GetTotalNumber() uint32
- func (x *PageResponse) GetTotalPage() uint32
- func (*PageResponse) ProtoMessage()
- func (x *PageResponse) ProtoReflect() protoreflect.Message
- func (x *PageResponse) Reset()
- func (x *PageResponse) String() string
Constants ¶
View Source
const ( DefaultPageNumber = 1 // goto page number : which page (default : 1) DefaultPageSize = 20 // show records number (default : 20) )
Variables ¶
View Source
var File_kit_page_page_kit_proto protoreflect.FileDescriptor
Functions ¶
func CalcShowTo ¶
CalcShowTo 计算:分页显示结束位置 长度
func ParsePageRequest ¶
func ParsePageRequest(pageRequest *PageRequest) (*PageRequest, *PageOption)
ParsePageRequest 解析页码分页请求
Types ¶
type PageOption ¶
PageOption .
func ConvertToPageOption ¶
func ConvertToPageOption(pageRequest *PageRequest) *PageOption
ConvertToPageOption 转换为分页选项
type PageRequest ¶
type PageRequest struct { // page 第几页;默认第一页 Page uint32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` // page_size 每页显示多少条(默认:15) PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // contains filtered or unexported fields }
PageRequest 分页请求
func (*PageRequest) Descriptor
deprecated
func (*PageRequest) Descriptor() ([]byte, []int)
Deprecated: Use PageRequest.ProtoReflect.Descriptor instead.
func (*PageRequest) GetPage ¶
func (x *PageRequest) GetPage() uint32
func (*PageRequest) GetPageSize ¶
func (x *PageRequest) GetPageSize() uint32
func (*PageRequest) ProtoMessage ¶
func (*PageRequest) ProtoMessage()
func (*PageRequest) ProtoReflect ¶
func (x *PageRequest) ProtoReflect() protoreflect.Message
func (*PageRequest) Reset ¶
func (x *PageRequest) Reset()
func (*PageRequest) String ¶
func (x *PageRequest) String() string
type PageResponse ¶
type PageResponse struct { // total_number 总条数 TotalNumber uint32 `protobuf:"varint,1,opt,name=total_number,json=totalNumber,proto3" json:"total_number,omitempty"` // total_page 总页数 TotalPage uint32 `protobuf:"varint,2,opt,name=total_page,json=totalPage,proto3" json:"total_page,omitempty"` // page 第几页 Page uint32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"` // page_size 每页显示多少条 PageSize uint32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // contains filtered or unexported fields }
PageResponse 分页信息
func CalcPageResponse ¶
func CalcPageResponse(pageRequest *PageRequest, totalNumber uint32) *PageResponse
CalcPageResponse 计算分页响应
func (*PageResponse) Descriptor
deprecated
func (*PageResponse) Descriptor() ([]byte, []int)
Deprecated: Use PageResponse.ProtoReflect.Descriptor instead.
func (*PageResponse) GetPage ¶
func (x *PageResponse) GetPage() uint32
func (*PageResponse) GetPageSize ¶
func (x *PageResponse) GetPageSize() uint32
func (*PageResponse) GetTotalNumber ¶
func (x *PageResponse) GetTotalNumber() uint32
func (*PageResponse) GetTotalPage ¶
func (x *PageResponse) GetTotalPage() uint32
func (*PageResponse) ProtoMessage ¶
func (*PageResponse) ProtoMessage()
func (*PageResponse) ProtoReflect ¶
func (x *PageResponse) ProtoReflect() protoreflect.Message
func (*PageResponse) Reset ¶
func (x *PageResponse) Reset()
func (*PageResponse) String ¶
func (x *PageResponse) String() string
Click to show internal directories.
Click to hide internal directories.