Documentation ¶
Index ¶
- Variables
- func DBSetup(c *DBOption)
- type DBOption
- type Model
- func (p *Model) BatchInsert(tableName string, fields []string, data []map[string]interface{})
- func (p *Model) BatchInsertWithError(tableName string, fields []string, data []map[string]interface{}) error
- func (p *Model) GetDB() *gorm.DB
- func (p *Model) LoadAllWhere(where map[string]map[string]interface{}, model *gorm.DB) *gorm.DB
- func (p *Model) LoadWhereAnd(where map[string]interface{}, model *gorm.DB) *gorm.DB
- func (p *Model) LoadWhereOr(where map[string]interface{}, model *gorm.DB) *gorm.DB
- func (p *Model) ORMModel()
- type ORMModel
- type RuleSearchText
- type RuleSort
- type SearchTextRule
- type Service
- func (p *Service) ParseDateTime(startTime, endTime int, timeField string, whereAnd map[string]interface{}) map[string]interface{}
- func (p *Service) ParseSearchText(searchText string, fields *[]string, whereAnd map[string]interface{}, ...) map[string]interface{}
- func (p *Service) ParseSort(sort string) string
- type SortRule
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
Functions ¶
Types ¶
type Model ¶
type Model struct { ID int `gorm:"primary_key" json:"id" example:"主键ID"` CreatedAt uint64 `gorm:"column:created_at;autoCreateTime" json:"created_at" example:"记录添加时间"` UpdatedAt uint64 `gorm:"column:updated_at;autoUpdateTime" json:"updated_at" example:"记录更新时间"` }
func (*Model) BatchInsert ¶
func (*Model) BatchInsertWithError ¶
func (*Model) LoadAllWhere ¶
func (*Model) LoadWhereAnd ¶
func (*Model) LoadWhereOr ¶
type RuleSearchText ¶
type RuleSearchText interface {
// contains filtered or unexported methods
}
type SearchTextRule ¶
type SearchTextRule struct {
SearchText string `json:"search_text" form:"search_text" valid:"stringlength(0|50)~搜索关键词应在0-50个字之间"`
}
type Service ¶
type Service struct{}
func (*Service) ParseDateTime ¶
func (*Service) ParseSearchText ¶
Click to show internal directories.
Click to hide internal directories.