Documentation
¶
Index ¶
- func AfterCreate(db *gorm.DB)
- func AfterDelete(db *gorm.DB)
- func AfterQuery(db *gorm.DB)
- func AfterSave(db *gorm.DB)
- func AfterUpdate(db *gorm.DB)
- func IsUniqueError(err error) bool
- func Must(cs ...config.Config)
- func NotFound(err error) bool
- type BaseDAO
- type DBManager
- type GlobalHooks
- type Model
- type OperationBaseModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AfterQuery ¶
Types ¶
type DBManager ¶
DBManager gorm db manager
var (
Engine *DBManager
)
func NewDBManager ¶
func NewDBManager() *DBManager
type GlobalHooks ¶
type GlobalHooks struct{}
type Model ¶
type Model struct { CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` DeletedAt soft_delete.DeletedAt `json:"deleted_at" gorm:"default:0" ` }
Model 基础模型
type OperationBaseModel ¶
type OperationBaseModel struct { OperationTime int64 `gorm:"column:operation_time" json:"operation_time"` // 操作时间,记录修改的时间 OperatorID int64 `gorm:"column:operator_id" json:"operator_id"` // 操作人ID,记录是由谁修改的 Operator string `gorm:"column:operator" json:"operator" ` // 操作人,记录是由谁修改的 }
func (*OperationBaseModel) BeforeSave ¶
func (base *OperationBaseModel) BeforeSave(tx *gorm.DB) (err error)
Click to show internal directories.
Click to hide internal directories.