Documentation ¶
Index ¶
- type Entity
- type EntityInfo
- func (e *EntityInfo) CheckEntityType(checkType reflect.Type) error
- func (e *EntityInfo) GetFieldNameList() []StructField
- func (e *EntityInfo) GetFieldNameStringList() []string
- func (e *EntityInfo) NewEntityValue() reflect.Value
- func (e *EntityInfo) SubstanceType() reflect.Type
- func (e *EntityInfo) Type() reflect.Type
- type IEntity
- type LikeMod
- type OperationType
- type PrimaryKey
- type StructField
- type TableName
- type WhereConditionValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entity ¶
type Entity struct { ID PrimaryKey `gorm:"COMMENT:自增ID;NOT NULL;column:ID;PRIMARY_KEY;AUTOINCREMENT"` //条目ID CreatedAt time.Time `gorm:"COMMENT:创建日期;NOT NULL;Type:DATETIME;DEFAULT:CURRENT_TIMESTAMP;column:CreatedAt"` //登陆日期 UpdatedAt time.Time `gorm:"COMMENT:更新日期;NOT NULL;Type:DATETIME;DEFAULT:CURRENT_TIMESTAMP;column:UpdatedAt"` //修改日期,不支持 ON UPDATE:CURRENT_TIMESTAMP 语句 }
func (*Entity) Primary ¶
func (bm *Entity) Primary() PrimaryKey
type EntityInfo ¶
type EntityInfo struct {
// contains filtered or unexported fields
}
func NewEntityInfo ¶
func NewEntityInfo(Type reflect.Type) *EntityInfo
func (*EntityInfo) CheckEntityType ¶
func (e *EntityInfo) CheckEntityType(checkType reflect.Type) error
func (*EntityInfo) GetFieldNameList ¶
func (e *EntityInfo) GetFieldNameList() []StructField
func (*EntityInfo) GetFieldNameStringList ¶
func (e *EntityInfo) GetFieldNameStringList() []string
func (*EntityInfo) NewEntityValue ¶
func (e *EntityInfo) NewEntityValue() reflect.Value
todo:
return []*Entity
func (e *EntityInfo) NewSliceEntity() reflect.Value { var list = reflect.New(reflect.SliceOf(reflect.New(e.entityType).Type())) return list }
func (e *EntityInfo) NewEntity() IEntity { return reflect.New(e.entityType).Interface().(IEntity) }
func (e *EntityInfo) NewEntityElemValue() reflect.Value { return reflect.New(e.entityType).Elem() }
func (*EntityInfo) SubstanceType ¶
func (e *EntityInfo) SubstanceType() reflect.Type
func (*EntityInfo) Type ¶
func (e *EntityInfo) Type() reflect.Type
type IEntity ¶
type IEntity interface { TableName() string IsZero() bool Primary() PrimaryKey }
type LikeMod ¶
func NewLikeMod ¶
type OperationType ¶
type OperationType string
const ( GetOperationType OperationType = "GET" FindOperationType OperationType = "FIND" DeleteOperationType OperationType = "DELETE" //CreateOperationType OperationType = "CREATE" UpdateOperationType OperationType = "UPDATE" )
type PrimaryKey ¶
type PrimaryKey uint
func (PrimaryKey) IsZero ¶
func (bm PrimaryKey) IsZero() bool
type StructField ¶
type WhereConditionValue ¶
type WhereConditionValue struct { IsValue bool //值或点位符,值为=true Value interface{} }
func NewWhereConditionValue ¶
func NewWhereConditionValue(IsValue bool, Value interface{}) WhereConditionValue
Click to show internal directories.
Click to hide internal directories.