Documentation
¶
Index ¶
- func IsAnyNil(a any) bool
- func IsZero(value any) bool
- func Like(where string, value any, options ...string) func(db *gorm.DB) *gorm.DB
- func OcaclePaginate(db *gorm.DB, data any, page, pageSize *int32, maxPageSize ...int32) error
- func Offset(offset, limit *int32, maxLimit ...int32) func(db *gorm.DB) *gorm.DB
- 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 W(where string, value any) func(db *gorm.DB) *gorm.DB
- type Backup
- type DeleteParam
- type FirstParam
- type ListData
- type ListParamBase
- type ListResult
- type Model
- func (m *Model[T]) Code(n int32, field string) (string, error)
- func (m *Model[T]) Copy(param any) *Model[T]
- func (m *Model[T]) Delete(id any) *Model[T]
- func (m *Model[T]) FindChildren(pid any, idName, pidName, childrenName, order string) *Model[T]
- func (m *Model[T]) FindChildrenID(ids *[]int32, pidName string) *Model[T]
- func (m *Model[T]) List(data *ListData) *Model[T]
- func (m *Model[T]) NotSame(sames *[]Same) *Model[T]
- func (m *Model[T]) Number(n int32, field string) (int64, error)
- func (m *Model[T]) NumberToString(n int32, field string) (string, error)
- func (m *Model[T]) Save() *Model[T]
- func (m *Model[T]) SetModel(db *gorm.DB) *Model[T]
- func (m *Model[T]) SetPk(pk int32) *Model[T]
- func (m *Model[T]) SetPkName(pkName string) *Model[T]
- func (m *Model[T]) Update(field string, value any, containsas []string) *Model[T]
- func (m *Model[T]) Where(data []Where) *Model[T]
- type ModelChildren
- type ModelCreatedAt
- type ModelDeletedAt
- type ModelHasChildren
- type ModelID
- type ModelSort
- type ModelState
- type ModelUpdatedAt
- type Same
- type Sharding
- type Table
- type Time
- type UpdateParam
- type Where
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OcaclePaginate ¶ added in v1.0.8
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 ¶ added in v1.0.8
type Model ¶
func (*Model[T]) FindChildren ¶
func (*Model[T]) FindChildrenID ¶
func (*Model[T]) NumberToString ¶ added in v1.0.8
生成唯一数字
type ModelChildren ¶ added in v1.0.4
type ModelCreatedAt ¶ added in v1.0.4
type ModelCreatedAt struct {
CreatedAt Time `gorm:"column:created_at;autoCreateTime:milli;comment:创建时间" json:"created_at"`
}
type ModelDeletedAt ¶ added in v1.0.8
type ModelDeletedAt struct {
Deleted Time `gorm:"column:deleted;comment:删除时间" json:"deleted"`
}
type ModelHasChildren ¶ added in v1.0.4
type ModelHasChildren struct {
HasChildren bool `gorm:"-:all;default:false" json:"hasChildren"`
}
type ModelID ¶ added in v1.0.4
type ModelID struct {
ID int32 `gorm:"column:id;primaryKey;autoIncrement;comment:ID" json:"id"`
}
type ModelSort ¶ added in v1.0.4
type ModelSort struct {
Sort int32 `gorm:"column:sort;type:bigint;default:100;comment:排序;index" json:"sort"`
}
type ModelState ¶ added in v1.0.4
type ModelState struct {
State int32 `gorm:"column:state;type:int;default:1;comment:状态:1-开启,2-关闭;index" json:"state"`
}
type ModelUpdatedAt ¶ added in v1.0.4
type ModelUpdatedAt struct {
UpdatedAt Time `gorm:"column:updated_at;autoUpdateTime:milli;comment:更新时间" json:"updated_at"`
}
type Sharding ¶ added in v1.0.8
type Sharding struct {
// contains filtered or unexported fields
}
func (*Sharding) GetMaxPrimaryKeyValue ¶ added in v1.0.8
查询当前分表的最大ID
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.