Documentation
¶
Index ¶
- func IsExpString(s string) bool
- func NewCurrentNullTime(tm time.Time) sql.NullTime
- func NewNullTime() sql.NullTime
- func WhereBuild(ado *gorm.DB, where map[string]any) (whereSQL string, vals []any, err error)
- type CustomDate
- type CustomDateTime
- func (c CustomDateTime) IsEmpty() bool
- func (c CustomDateTime) Local() time.Time
- func (c CustomDateTime) MarshalJSON() ([]byte, error)
- func (c *CustomDateTime) Scan(value interface{}) error
- func (c *CustomDateTime) UnmarshalJSON(data []byte) error
- func (c CustomDateTime) Value() (driver.Value, error)
- type NullType
- type Pagination
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsExpString ¶ added in v0.0.9
func NewCurrentNullTime ¶
NewCurrentNullTime 使用构造函数(推荐) 当前时间
Types ¶
type CustomDate ¶ added in v0.0.9
CustomDate 日期
func TimeNowDate ¶ added in v0.0.9
func TimeNowDate() CustomDate
func (CustomDate) Local ¶ added in v0.0.9
func (c CustomDate) Local() time.Time
func (CustomDate) MarshalJSON ¶ added in v0.0.9
func (c CustomDate) MarshalJSON() ([]byte, error)
func (*CustomDate) Scan ¶ added in v0.0.9
func (c *CustomDate) Scan(value interface{}) error
func (*CustomDate) UnmarshalJSON ¶ added in v0.0.9
func (c *CustomDate) UnmarshalJSON(data []byte) error
type CustomDateTime ¶ added in v0.0.9
CustomDateTime 日期+时间
func TimeNowTime ¶ added in v0.0.9
func TimeNowTime() CustomDateTime
func (CustomDateTime) IsEmpty ¶ added in v0.0.9
func (c CustomDateTime) IsEmpty() bool
IsEmpty 判断时间是否为空
func (CustomDateTime) Local ¶ added in v0.0.9
func (c CustomDateTime) Local() time.Time
func (CustomDateTime) MarshalJSON ¶ added in v0.0.9
func (c CustomDateTime) MarshalJSON() ([]byte, error)
func (*CustomDateTime) Scan ¶ added in v0.0.9
func (c *CustomDateTime) Scan(value interface{}) error
func (*CustomDateTime) UnmarshalJSON ¶ added in v0.0.9
func (c *CustomDateTime) UnmarshalJSON(data []byte) error
type NullType ¶ added in v0.0.9
type NullType byte
const ( // IsNull the same as `is null` IsNull NullType // IsNotNull the same as `is not null` IsNotNull )
type Pagination ¶ added in v0.0.9
type Pagination struct {
PageString string `json:"-"` // 当前页码
PageSizeString string `json:"-"` // 每页数量
Page int `json:"page"` // 当前页码
PageSize int `json:"pageSize"` // 每页数量
TotalCount int64 `json:"total"` // 总记录数
PageCount int `json:"pageCount"` // 总页数
FirstPage int `json:"firstPage"` // 第一页页码
LastPage int `json:"lastPage"` // 最后一页页码
PrevPage int `json:"prevPage"` // 上一页页码
NextPage int `json:"nextPage"` // 下一页页码
Rows interface{} `json:"rows"` // 数据列表
}
Pagination 分页信息
func (*Pagination) GetOffset ¶ added in v0.0.9
func (pagination *Pagination) GetOffset() int
GetOffset 获取偏移量
func (*Pagination) Init ¶ added in v0.0.9
func (pagination *Pagination) Init() *Pagination
func (*Pagination) Paginate ¶ added in v0.0.9
func (pagination *Pagination) Paginate(data interface{})
Paginate 对数据进行分页处理
Click to show internal directories.
Click to hide internal directories.