model

package
v0.0.0-...-1bfb889 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MySQLLogLevel = map[string]mysqllogger.LogLevel{
		"silent": mysqllogger.Silent,
		"error":  mysqllogger.Error,
		"warn":   mysqllogger.Warn,
		"info":   mysqllogger.Info,
	}
)

Functions

func GetDB

func GetDB() *gorm.DB

func Registry

func Registry()

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController() *Controller

func (*Controller) Begin

func (c *Controller) Begin() error

func (*Controller) Commit

func (c *Controller) Commit() error

func (*Controller) CreateTables

func (c *Controller) CreateTables(tables []base.AutoRegister) (err error)

func (*Controller) FileModel

func (c *Controller) FileModel(m *File) *File

func (*Controller) Rollback

func (c *Controller) Rollback() error

type File

type File struct {
	gorm.Model
	Name string
	Path string
	// contains filtered or unexported fields
}

func (*File) Condition

func (c *File) Condition(q *FileQuery) *gorm.DB

func (*File) Delete

func (c *File) Delete(q *FileQuery) error

func (*File) Exists

func (c *File) Exists(data string) (ok bool, err error)

func (*File) Get

func (c *File) Get(q *FileQuery) (res File, err error)

func (*File) List

func (c *File) List(q *FileQuery) (res []*File, total int64, err error)

func (*File) NoExists

func (c *File) NoExists(no string) (ok bool)

func (*File) Registry

func (c *File) Registry()

func (*File) Save

func (c *File) Save() error

func (*File) TableName

func (c *File) TableName() string

type FileQuery

type FileQuery struct {
	PageSize  *int
	PageIndex *int
	PreLoad   bool
	ID        *uint
	IDs       *[]uint
	Owners    []string

	ReviewClauseType *string
	Role             *string
	ReviewClause     *string
	ReviewClauseEn   *string
	SerialNumber     *string
	DRNode           *string
	OrderByNo        bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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