repo

package
v0.0.0-...-a39f72a Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	ID        uint      `gorm:"primaryKey;autoIncrement;" json:"id"`
	Filename  string    `gorm:"not null;" json:"filename"`
	Filesha1  string    `gorm:"not null;uniqueIndex:user_folder_file;" json:"filesha1"`
	Filesize  string    `gorm:"not null;" json:"filesize"`
	Location  string    `gorm:"not null;" json:"location"`
	Folderid  uint      `gorm:"not null;uniqueIndex:user_folder_file;" json:"folderid"`
	Folder    Folder    `gorm:"foreignKey:Folderid"`
	Userid    uint      `gorm:"not null;uniqueIndex:user_folder_file;" json:"userid"`
	User      User      `gorm:"foreignKey:Userid"`
	CreatedAt time.Time `gorm:"autoCreateTime:nano;" json:"created_at"`
	UpdatedAt time.Time `gorm:"autoUpdateTime:nano;" json:"updated_at"`
}

func (*File) TableName

func (f *File) TableName() string

type Folder

type Folder struct {
	ID         uint      `gorm:"primaryKey;autoIncrement;" json:"id"`
	Foldername string    `gorm:"not null; comment:'文件夹名称'" json:"foldername"`
	UserID     uint      `gorm:"not null; comment:'文件夹所属用户'" json:"userid"`
	User       User      `gorm:"->:false;<-:create"`
	CreatedAt  time.Time `gorm:"autoCreateTime:nano;" json:"created_at"`
	UpdatedAt  time.Time `gorm:"autoUpdateTime:nano;" json:"updated_at"`
}

func (*Folder) TableName

func (f *Folder) TableName() string

type User

type User struct {
	ID        uint      `gorm:"primaryKey;autoIncrement;" json:"id"`
	Username  string    `gorm:"not null;comment:'用户名'" json:"user_name" validate:"required,min=2,max=30"`
	Password  string    `gorm:"not null;comment:'用户密码'" json:"password" validate:"required,min=6,max=20"`
	Email     string    `gorm:"default:'';comment:'邮箱'" json:"email" validate:"omitempty"`
	Phone     string    `gorm:"default:'';comment:'联系方式'" json:"phone" validate:"omitempty"`
	Avatar    string    `gorm:"default:'';comment:'用户头像'" json:"avatar" validate:"omitempty"`
	Profile   string    `gorm:"default:'';comment:'用户简介'" json:"profile" validate:"omitempty"`
	Status    int64     `gorm:"comment:'0表示启用,1表示禁用,2表示锁定,3表示标记删除'" json:"status" validate:"omitempty"`
	CreatedAt time.Time `gorm:"autoCreateTime:nano;" json:"created_at"`
	UpdatedAt time.Time `gorm:"autoUpdateTime:nano;" json:"updated_at"`
}

func (*User) TableName

func (u *User) TableName() string

Jump to

Keyboard shortcuts

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