Documentation
¶
Index ¶
- Constants
- func DB() *gorm.DB
- func GetAutoSliceDB(db *gorm.DB, userId int64, sf SP) *gorm.DB
- func InitQpsDB(limit int, interval time.Duration)
- func OpenMysqlDB(dbType string, dbUrl string, config *gorm.Config, ...) (instance *gorm.DB, err error)
- func QqsDB() *gorm.DB
- func TestGetSliceDBAuto(t *testing.T)
- type SP
- type UserFeedback
Constants ¶
View Source
const ( EmptyVal = "" PartZero = 0 )
View Source
const ( // MYSQL dbType MYSQL = "mysql" // PG dbType PG = "postgres" )
Variables ¶
This section is empty.
Functions ¶
func GetAutoSliceDB ¶ added in v1.2.6
GetAutoSliceDB 获取自动分表
func OpenMysqlDB ¶
func OpenMysqlDB(dbType string, dbUrl string, config *gorm.Config, maxIdleConns, maxOpenConns int, models ...interface{}) (instance *gorm.DB, err error)
OpenMysqlDB gorm v2 dbUrl = username:password@tcp(localhost:3306)/db_name?charset=utf8mb4&parseTime=True&loc=Local
func TestGetSliceDBAuto ¶ added in v1.2.6
Types ¶
type UserFeedback ¶ added in v1.2.6
type UserFeedback struct {
Id int64 `gorm:"primaryKey;autoIncrement" json:"id" form:"id"`
UserID int64 `json:"user_id" gorm:"index"`
ShowID int64 `json:"show_id" gorm:"index"`
UserName string `json:"user_name" gorm:"size:128;"`
NickName string `json:"nick_name" gorm:"size:128;"`
// 1兑换/置换 2售后/发货 3建议/投诉 4充值 5其他
Type int `json:"type" gorm:"index"`
Channel string `json:"channel" gorm:"size:64;"`
Version string `json:"version" gorm:"size:16;"`
Phone string `json:"phone" gorm:"size:32;"`
Content string `json:"content" gorm:"size:1024;"`
Time string `json:"time" gorm:"size:32;"`
}
Click to show internal directories.
Click to hide internal directories.