common

package
v0.0.0-...-fdfd418 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IsAdmin  int8 = 0 // 普通用户
	Disabled int8 = 0 // 禁用
	Failure  int8 = 0 // 失败
	Enabled  int8 = 1 // 启用
	Running  int8 = 1 // 运行中
	Finish   int8 = 2 // 完成
	Cancel   int8 = 3 // 取消
)
View Source
const (
	Page        = 1    // 当前页数
	PageSize    = 10   // 每页多少条数据
	MaxPageSize = 1000 // 每次最多取多少条
)

Variables

This section is empty.

Functions

func ParseQueryParams

func ParseQueryParams(ctx *gin.Context) (int, int)

解析查询参数中的页数和每页数量

Types

type BaseModel

type BaseModel struct {
	Page     int64 `json:"page" gorm:"-"`
	PageSize int64 `json:"pageSize" gorm:"-"`
}

func (*BaseModel) PageLimitOffset

func (baseModel *BaseModel) PageLimitOffset() int64

func (*BaseModel) ParsePageAndPageSize

func (baseModel *BaseModel) ParsePageAndPageSize(params CommonMap)

type CommonMap

type CommonMap map[string]interface{}

type Response

type Response struct {
	Code     int16       `json:"code"`
	Data     interface{} `json:"data"`
	Msg      string      `json:"msg"`
	Page     int64       `json:"page"`
	PageSize int64       `json:"pageSize"`
	Total    int64       `json:"total"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL