Documentation
¶
Index ¶
- func CheckDup(db *gorm.DB, model any, msg string) error
- func Get(db *gorm.DB, id uint, model any, msg string) error
- func GetEx(db *gorm.DB, model any, msg string) error
- type Criteria
- func (c *Criteria[T]) Compile(limit, offset int) (*gorm.DB, *gorm.DB)
- func (c *Criteria[T]) WhereDate(key string, date *time.Time)
- func (c *Criteria[T]) WhereId(key string, id uint)
- func (c *Criteria[T]) WhereIds(key string, ids []uint)
- func (c *Criteria[T]) WhereM2MId(joint T, jointKey, jointAssoKey string, jointAssoId uint)
- func (c *Criteria[T]) WhereNonIds(key string, ids []uint)
- func (c *Criteria[T]) WhereString(key, s string)
- func (c *Criteria[T]) WhereStringFrag(key, s string)
- type IResponserModel
- type ITableNamerModel
- type ListResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Criteria ¶
type Criteria[T ITableNamerModel] struct { Db *gorm.DB // contains filtered or unexported fields }
func NewCriteria ¶
func NewCriteria[T ITableNamerModel](db *gorm.DB, model T) *Criteria[T]
func (*Criteria[T]) WhereM2MId ¶
func (*Criteria[T]) WhereNonIds ¶
func (*Criteria[T]) WhereString ¶
func (*Criteria[T]) WhereStringFrag ¶
type IResponserModel ¶
type ITableNamerModel ¶
type ITableNamerModel interface {
TableName() string
}
Click to show internal directories.
Click to hide internal directories.