Documentation
¶
Index ¶
- func IsNilOrZero(v any) bool
- func IsZero(v any) bool
- func Like(where string, value any, options ...string) func(db *gorm.DB) *gorm.DB
- func Offset(offset, limit *int32, maxLimit ...int32) func(db *gorm.DB) *gorm.DB
- func OpenDBWithTimeout(dialector gorm.Dialector, timeout time.Duration) (*gorm.DB, error)
- func OraclePaginate(db *gorm.DB, data any, page, pageSize *int32, maxPageSize ...int32) error
- func Paginate(page, pageSize *int32, maxPageSize ...int32) func(db *gorm.DB) *gorm.DB
- func Unique(DB *gorm.DB, primaryField string, primaryKey any, message string) func(db *gorm.DB) *gorm.DB
- func Where(where string, value any) func(db *gorm.DB) *gorm.DB
- type DeleteParam
- type FirstParam
- type ListParamBase
- type ListResult
- type ModelChildren
- type ModelCreatedAt
- type ModelDeletedAt
- type ModelHasChildren
- type ModelID
- type ModelSort
- type ModelState
- type ModelUpdatedAt
- type Time
- type UpdateParam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenDBWithTimeout ¶
控制数据库连接超时
func OraclePaginate ¶
Types ¶
type DeleteParam ¶
type DeleteParam struct {
IDS []int32 `json:"id" validate:"required:主键值必须"`
}
type FirstParam ¶
type FirstParam struct {
ID int32 `form:"id" validate:"required:主键值必须"`
}
type ListParamBase ¶
type ListResult ¶
type ModelChildren ¶
type ModelCreatedAt ¶
type ModelCreatedAt struct {
CreatedAt Time `gorm:"column:created_at;autoCreateTime:milli;comment:创建时间" json:"created_at"`
}
type ModelDeletedAt ¶
type ModelDeletedAt struct {
Deleted Time `gorm:"column:deleted;comment:删除时间" json:"deleted"`
}
type ModelHasChildren ¶
type ModelHasChildren struct {
HasChildren bool `gorm:"-:all;default:false" json:"hasChildren"`
}
type ModelID ¶
type ModelID struct {
ID int32 `gorm:"column:id;primaryKey;autoIncrement;comment:ID" json:"id"`
}
type ModelSort ¶
type ModelSort struct {
Sort int32 `gorm:"column:sort;type:bigint;default:100;comment:排序;index" json:"sort"`
}
type ModelState ¶
type ModelState struct {
State int32 `gorm:"column:state;type:int;default:1;comment:状态:1-开启,2-关闭;index" json:"state"`
}
type ModelUpdatedAt ¶
type ModelUpdatedAt struct {
UpdatedAt Time `gorm:"column:updated_at;autoUpdateTime:milli;comment:更新时间" json:"updated_at"`
}
type Time ¶
func (Time) MarshalJSON ¶
type UpdateParam ¶
type UpdateParam struct {
ID int32 `json:"id" validate:"required:主键值必须"`
Field string `json:"field" validate:"required:字段名必须"`
Value any `json:"value"`
}
更新参数
Click to show internal directories.
Click to hide internal directories.