model

package
v0.0.0-...-caf75cb Latest Latest
Warning

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

Go to latest
Published: May 19, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatRoom

type ChatRoom struct {
	gorm.Model
	Title        string `gorm:"not null;unique;"`
	Descriptions string
	UniqueCode   string `gorm:"not null;unique;"`
	IconUrl      string
}

func (*ChatRoom) CheckRoomExist

func (m *ChatRoom) CheckRoomExist(uniqueCode string) (err error)

func (*ChatRoom) TableName

func (m *ChatRoom) TableName() string

type Content

type Content struct {
	gorm.Model
	Title        string
	Descriptions string
	TitleList    []*Title `gorm:"-"`
}

* 内容信息

func (*Content) AppendTitleList

func (m *Content) AppendTitleList(db *gorm.DB) (err error)

func (*Content) TableName

func (m *Content) TableName() string

type LoginInfo

type LoginInfo struct {
	Username string `gorm:"not null;unique;" json:"username"`
	Password string `gorm:"not null;" json:"-"`
	Salt     string `gorm:"not null;" json:"-"` //盐
}

type PathInfo

type PathInfo struct {
	gorm.Model
	TitleId    uint   `gorm:"not null;"`
	UniqueCode string `gorm:"not null;unique;"`
	RealPath   string `gorm:"not null;"`
	FileName   string `gorm:"not null;"`
	IsDir      bool
	Size       int64
	Ext        string
	Children   []PathInfo
}

* 文件路径保存格式,IsDir为true,Children会包含下级目录的内容

func (*PathInfo) ReadDir

func (m *PathInfo) ReadDir(dirPath string) (pathInfoList []PathInfo, err error)

* 读目录,返回所有当前级别文件和目录信息 @param dirPath string 目录路径,error处理文件路径

func (*PathInfo) ReadDirAndSave

func (m *PathInfo) ReadDirAndSave(titleId uint, dirPath string, extList []string) (err error)

* 保存读目录的文件,可以指定文件扩展名 @param titleId uint 主题id @param dirPath string 目录路径,error处理文件路径 @param extList []string 保存指定文件扩展名称

func (*PathInfo) SaveWithCheckExt

func (m *PathInfo) SaveWithCheckExt(titleId uint, extList []string) (err error)

* 保存文件信息,可以指定文件扩展名 @param titleId uint 主题id @param extList []string 保存指定文件扩展名称

func (*PathInfo) TableName

func (m *PathInfo) TableName() string

type Title

type Title struct {
	gorm.Model
	ContentId    uint
	Title        string
	Descriptions string
	PathInfo     *PathInfo `gorm:"-"`
}

* 标题信息

func (*Title) TableName

func (m *Title) TableName() string

type User

type User struct {
	gorm.Model
	LoginInfo
	UserInfo
}

func (*User) TableName

func (m *User) TableName() string

type UserInfo

type UserInfo struct {
	NickName   string `json:"nickName"` // 昵称
	Phone      string `json:"phone"`    // 手机号
	RoleId     uint   `json:"roleId"`   // 角色编码
	Avatar     string `json:"avatar"`   //头像
	Sex        string `json:"sex"`      //性别
	Email      string `json:"email"`    //邮箱
	Remark     string `json:"remark"`   //备注
	Status     int    `json:"status"`
	UniqueCode string `gorm:"not null;unique;" json:"unique_code"`
}

Jump to

Keyboard shortcuts

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