Documentation ¶
Index ¶
- func CloseDb()
- func CloseMultiDb()
- func GetDb() *gorm.DB
- func GetMultiDb(alias string) *gorm.DB
- func InitMultiDb(databases []Database) error
- func InitSingleDb(opt *SingleOpt) error
- func Paginate(page, pageSize int) func(db *gorm.DB) *gorm.DB
- type BaseModel
- type CommModel
- type Database
- type SingleOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseMultiDb ¶
func CloseMultiDb()
func GetMultiDb ¶
func InitMultiDb ¶
func InitSingleDb ¶
Types ¶
type BaseModel ¶
type BaseModel struct { Id int64 `json:"id" gorm:"primaryKey"` CreatedAt *time.Time `json:"created_at,omitempty" ` UpdatedAt *time.Time `json:"updated_at,omitempty" ` DeletedAt *gorm.DeletedAt `json:"deleted_at,omitempty" ` }
添加软删除
Click to show internal directories.
Click to hide internal directories.