Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSON ¶
type JSON json.RawMessage
JSON 自定义JSON类型
func (JSON) MarshalJSON ¶
MarshalJSON 实现json.Marshaler接口
func (*JSON) UnmarshalJSON ¶
UnmarshalJSON 实现json.Unmarshaler接口
type Model ¶
type Model struct {
ID uint `gorm:"primary_key" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `sql:"index" json:"deleted_at,omitempty"`
}
Model 基础模型结构
type Pagination ¶
type Pagination struct {
Total int64 `json:"total"` // 总记录数
Page int `json:"page"` // 当前页码
PageSize int `json:"page_size"` // 每页记录数
Data interface{} `json:"data"` // 数据
}
Pagination 分页结构
func NewPagination ¶
func NewPagination(data interface{}, total int64, page, pageSize int) *Pagination
NewPagination 创建分页结构
Click to show internal directories.
Click to hide internal directories.