model

package
v0.0.0-...-d345bf7 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConditionEqual    = "="
	ConditionNotEqual = "<>"
	ConditionGt       = ">"
	ConditionGte      = ">="
	ConditionLt       = "<"
	ConditionLte      = "<="
	ConditionIn       = "IN"
	ConditionNotIn    = "NOT IN"
	ConditionLike     = "LIKE"
)

Variables

View Source
var (
	ErrNotFound       = gorm.ErrRecordNotFound
	InputParamInvalid = errors.New("param invalid")
	WriteDataFailed   = errors.New("write data failed")
	ReadDataFailed    = errors.New("read data failed")
)

Functions

This section is empty.

Types

type ConditionType

type ConditionType string

type File

type File struct {
	gorm.Model

	Name string `db:"name"`

	Type string `db:"type"`

	Path string `db:"path"`

	Size string `db:"size"`

	ShareLink string `db:"share_link"`

	ParentId int64 `db:"parent_id"`
}

type FileMd5

type FileMd5 struct {
	Id int64 `db:"id"`

	FileId int64 `db:"file_id"`

	Md5 string `db:"md5"`
}

type FileMd5Model

type FileMd5Model interface {
	// contains filtered or unexported methods
}

FileMd5Model is an interface to be customized, add more methods here, and implement the added methods in customFileMd5Model.

func NewFileMd5Model

func NewFileMd5Model(conn *gorm.DB) FileMd5Model

NewFileMd5Model returns a model for the database table.

type FileModel

type FileModel interface {
	// contains filtered or unexported methods
}

FileModel is an interface to be customized, add more methods here, and implement the added methods in customFileModel.

func NewFileModel

func NewFileModel(conn *gorm.DB) FileModel

NewFileModel returns a model for the database table.

type Order

type Order struct {
	Field string
	ASC   bool
}

type Page

type Page struct {
	PageIndex int // 页面索引,从0开始
	PageSize  int // 页面条数,默认20,最多100
}

type ProfilePicture

type ProfilePicture struct {
	Id int64 `db:"id"`

	Md5 string `db:"md5"`

	Picture []byte `db:"picture"`
}

type ProfilePictureModel

type ProfilePictureModel interface {
	// contains filtered or unexported methods
}

ProfilePictureModel is an interface to be customized, add more methods here, and implement the added methods in customProfilePictureModel.

func NewProfilePictureModel

func NewProfilePictureModel(conn *gorm.DB) ProfilePictureModel

NewProfilePictureModel returns a model for the database table.

type Query

type Query struct {
	Field     string
	Condition ConditionType
	Value     interface{}
}

type UserFile

type UserFile struct {
	Id int64 `db:"id"`

	UserId int64 `db:"user_id"`

	FileId int64 `db:"file_id"`
}

type UserFileModel

type UserFileModel interface {
	// contains filtered or unexported methods
}

UserFileModel is an interface to be customized, add more methods here, and implement the added methods in customUserFileModel.

func NewUserFileModel

func NewUserFileModel(conn *gorm.DB) UserFileModel

NewUserFileModel returns a model for the database table.

type UserProfile

type UserProfile struct {
	Id int64 `db:"id"`

	UserId int64 `db:"user_id"`

	Md5 string `db:"md5"`
}

type UserProfileModel

type UserProfileModel interface {
	// contains filtered or unexported methods
}

UserProfileModel is an interface to be customized, add more methods here, and implement the added methods in customUserProfileModel.

func NewUserProfileModel

func NewUserProfileModel(conn *gorm.DB) UserProfileModel

NewUserProfileModel returns a model for the database table.

Jump to

Keyboard shortcuts

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