models

package
v0.0.0-...-64afd39 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseModel

type BaseModel struct {
}

func (*BaseModel) Query

func (baseModel *BaseModel) Query(model ModelInterface) *QueryBuilder

NOTE When query with struct, GORM will only query with those fields has non-zero value, that means if your field’s value is 0, ”, false or other zero values, it won’t be used to build query conditions

type ModelInterface

type ModelInterface interface {
	Connection() string
}

type PhabricatorBugTasks

type PhabricatorBugTasks struct {
	BaseModel
	UUID             string    `gorm:"primaryKey,column:uuid"`
	TaskID           int64     `gorm:"column:task_id"`
	TaskPHID         string    `gorm:"column:task_phid"`
	TaskName         string    `gorm:"column:task_name"`
	TaskStatus       string    `gorm:"column:task_status"`
	TaskPriority     float64   `gorm:"column:task_priority"`
	TaskSubPriority  float64   `gorm:"column:task_sub_priority"`
	TaskPriorityName string    `gorm:"column:task_priority_name"`
	TaskAuthorPHID   string    `gorm:"column:task_author_phid"`
	TaskAuthorName   string    `gorm:"column:task_author_name"`
	TaskOwnerPHID    string    `gorm:"column:task_owner_phid"`
	TaskOwnerName    string    `gorm:"column:task_owner_name"`
	TaskCloserPHID   string    `gorm:"column:task_closer_phid"`
	TaskCloserName   string    `gorm:"column:task_closer_name"`
	TaskClosed       int64     `gorm:"column:task_closed"`
	TaskClosedDate   time.Time `gorm:"column:task_closed_datetime"`
	TaskCreated      int64     `gorm:"column:task_created"`
	TaskCreatedDate  time.Time `gorm:"column:task_created_datetime"`
	TaskModified     int64     `gorm:"column:task_modified"`
	TaskModifiedDate time.Time `gorm:"column:task_modified_datetime"`
	TaskTags         string    `gorm:"column:task_tags"`
}

func (*PhabricatorBugTasks) BatchInsert

func (pbt *PhabricatorBugTasks) BatchInsert(tasks []PhabricatorBugTasks, retry bool) error

func (*PhabricatorBugTasks) Connection

func (pbt *PhabricatorBugTasks) Connection() string

func (*PhabricatorBugTasks) TableName

func (pbt *PhabricatorBugTasks) TableName() string

ORM框架自动通过此方法获取表名,如果不存在此方法默认根据model struct名解析表名

type PhabricatorBugTasksHistory

type PhabricatorBugTasksHistory struct {
	BaseModel
	UUID             string    `gorm:"primaryKey,column:uuid"`
	TaskID           int64     `gorm:"column:task_id"`
	TaskPHID         string    `gorm:"column:task_phid"`
	TaskName         string    `gorm:"column:task_name"`
	TaskStatus       string    `gorm:"column:task_status"`
	TaskPriority     float64   `gorm:"column:task_priority"`
	TaskSubPriority  float64   `gorm:"column:task_sub_priority"`
	TaskPriorityName string    `gorm:"column:task_priority_name"`
	TaskAuthorPHID   string    `gorm:"column:task_author_phid"`
	TaskAuthorName   string    `gorm:"column:task_author_name"`
	TaskOwnerPHID    string    `gorm:"column:task_owner_phid"`
	TaskOwnerName    string    `gorm:"column:task_owner_name"`
	TaskCloserPHID   string    `gorm:"column:task_closer_phid"`
	TaskCloserName   string    `gorm:"column:task_closer_name"`
	TaskClosed       int64     `gorm:"column:task_closed"`
	TaskClosedDate   time.Time `gorm:"column:task_closed_datetime"`
	TaskCreated      int64     `gorm:"column:task_created"`
	TaskCreatedDate  time.Time `gorm:"column:task_created_datetime"`
	TaskModified     int64     `gorm:"column:task_modified"`
	TaskModifiedDate time.Time `gorm:"column:task_modified_datetime"`
	TaskTags         string    `gorm:"column:task_tags"`
}

func (*PhabricatorBugTasksHistory) BatchInsert

func (pbth *PhabricatorBugTasksHistory) BatchInsert(tasks []PhabricatorBugTasksHistory, retry bool) error

func (*PhabricatorBugTasksHistory) Connection

func (pbth *PhabricatorBugTasksHistory) Connection() string

func (*PhabricatorBugTasksHistory) TableName

func (pbth *PhabricatorBugTasksHistory) TableName() string

ORM框架自动通过此方法获取表名,如果不存在此方法默认根据model struct名解析表名

type QueryBuilder

type QueryBuilder struct {
	Model    ModelInterface
	DBClient *mysql.ConnWrapper
}

func (*QueryBuilder) FindByPk

func (qb *QueryBuilder) FindByPk(pk interface{}, retry bool) error

func (*QueryBuilder) FirstByWhere

func (qb *QueryBuilder) FirstByWhere(where func(dbClient *mysql.ConnWrapper) *mysql.ConnWrapper, retry bool) error

Jump to

Keyboard shortcuts

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