types

package
v0.0.0-...-afb9b83 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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) IsZero

func (bm *Entity) IsZero() bool

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

type LikeMod struct {
	InLeft  bool
	InRight bool
}

func NewLikeMod

func NewLikeMod(left bool, right bool) LikeMod

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 StructField struct {
	Column        string
	AutoIncrement bool
	Type          reflect.Type
	PrimaryKey    bool
	CanNull       bool
	ZeroFill      bool
	SQLType       string
	Default       string
	Comment       string
}

type TableName

type TableName string

type WhereConditionValue

type WhereConditionValue struct {
	IsValue bool //值或点位符,值为=true
	Value   interface{}
}

func NewWhereConditionValue

func NewWhereConditionValue(IsValue bool, Value interface{}) WhereConditionValue

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL