models

package
v0.0.0-...-9e30f45 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Begin

func Begin(ctx context.Context) *gorm.DB

Begin 开启事物

@param ctx

func End

func End(ctx context.Context, tx *gorm.DB, err error)

End 关闭事物

@param ctx
@param tx
@param err

func GetFileTable

func GetFileTable(ctx context.Context, db *gorm.DB) *gorm.DB

GetFileTable 获取文件表

@param ctx
@param db
@return *gorm.DB

func GetFileTagTable

func GetFileTagTable(ctx context.Context, db *gorm.DB) *gorm.DB

GetFileTagTable

@param ctx
@param db
@return *gorm.DB

func GetTagsTable

func GetTagsTable(ctx context.Context, db *gorm.DB) *gorm.DB

GetTagsTable 获取 tags 表

@param ctx
@param db
@return *gorm.DB

func Init

func Init()

Types

type File

type File struct {
	Model
	Name     string // 文件名
	Path     string // 文件真实路径
	IsDir    bool   // 是否是目录
	ParentID string // 父 ID
}

File 文件相关的定义

type FileTag

type FileTag struct {
	Model
	FileID string `gorm:"idx_file_tags"`
	TagsID string `gorm:"idx_file_tags"`
}

FileTag file tag

type Model

type Model struct {
	ID        string `gorm:"primarykey;not null"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

Model 基础模型

type Tags

type Tags struct {
	Model
	Key   string // tag key
	Value string // tag value
}

Tags 标签

Jump to

Keyboard shortcuts

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