31 lines
690 B
Go
31 lines
690 B
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
// Model 基础模型
|
|
type Model struct {
|
|
ID uint `gorm:"primarykey" json:"id"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
|
}
|
|
|
|
// PageInfo 分页请求
|
|
type PageInfo struct {
|
|
Page int `json:"page" form:"page"`
|
|
PageSize int `json:"pageSize" form:"pageSize"`
|
|
Keyword string `json:"keyword" form:"keyword"`
|
|
}
|
|
|
|
// PageResult 分页响应
|
|
type PageResult struct {
|
|
List interface{} `json:"list"`
|
|
Total int64 `json:"total"`
|
|
Page int `json:"page"`
|
|
PageSize int `json:"pageSize"`
|
|
}
|