Documentation
¶
Index ¶
- func ClearData4str(str string) string
- func DoBatchInsert(tableName string, data interface{}, db *gorm.DB) error
- func EnumAnObjFieldNames(rv reflect.Type, cb func(f reflect.StructField))
- func GetDataByPageAndPerPage(db *gorm.DB, page int, perPage int, m interface{}, result interface{}) (totalPages int, totalCount int)
- func GetOffset(page int, perPage int) int
- func StrSliceContains(strs []string, str string) bool
- type BatchInsertSql
- type DB
- type DBUtil
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoBatchInsert ¶
data must be slice
func EnumAnObjFieldNames ¶
func EnumAnObjFieldNames(rv reflect.Type, cb func(f reflect.StructField))
迭代一个对象的所有字段名
Types ¶
type BatchInsertSql ¶
type BatchInsertSql struct { TableName string // 保存了属性信息,可以在组装sql时根据属性做不同的操作 Fields []reflect.StructField InsertSql string // contains filtered or unexported fields }
批量插入组装sql
func (*BatchInsertSql) Add ¶
func (b *BatchInsertSql) Add(obj interface{})
func (*BatchInsertSql) ResultSql ¶
func (b *BatchInsertSql) ResultSql() string
Click to show internal directories.
Click to hide internal directories.