request

package
v0.0.0-...-b66827d Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: MIT Imports: 3 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IDStatusRequest

type IDStatusRequest struct {
	ID       int `form:"id"`
	Status   int `form:"status"` //1 正常  2 禁用
	From     int `form:"form"`   // 1 修改状态 2 是删除
	Type     int `form:"type"`   //来源  0 单个id 1 使用数组 id字符串
	IDArr    []int
	IDString string `form:"id_string"`
	Def      string `form:"def"` //字符串分隔符 默认 英文逗号分隔
}

用户删除或者修改状态通用

func (*IDStatusRequest) CheckStatus

func (s *IDStatusRequest) CheckStatus() error

func (*IDStatusRequest) IDStringToIDArr

func (s *IDStatusRequest) IDStringToIDArr() *IDStatusRequest

type ListCount

type ListCount func() error

type OrderFile

type OrderFile struct {
	Field string `json:"field" form:"field"`
	Sort  string `json:"sort" form:"sort"`
}

type Page

type Page struct {
	Page      int         `form:"page" json:"page"` //当前页码
	IsCount   int         `form:"is_count" json:"is_count"`
	PageSize  int         `form:"page_size" json:"page_size" ` //分页大小
	OrderFile []OrderFile `json:"order_file" form:"order_file"`
}

func (*Page) OnlyCount

func (p *Page) OnlyCount(count ListCount) (bool, error)

func (*Page) OnlyPage

func (p *Page) OnlyPage(db *gorm.DB) *gorm.DB

func (*Page) PageLimitOffset

func (p *Page) PageLimitOffset() int

Jump to

Keyboard shortcuts

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