orm

package
v0.0.0-...-5447790 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecResult

type ExecResult struct {
	Suc  bool        `json:"suc"`
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

ExecResult: sql函数执行的结果

func DeleteUserFile

func DeleteUserFile(username, filehash string) (res ExecResult)

DeleteUserFile : 删除文件(标记删除)

func GetFileMeta

func GetFileMeta(filehash string) (res ExecResult)

GetFileMeta : 从mysql获取文件元信息

func GetFileMetaList

func GetFileMetaList(limit int64) (res ExecResult)

GetFileMetaList : 从mysql批量获取文件元信息

func GetUserInfo

func GetUserInfo(username string) (res ExecResult)

GetUserInfo : 查询用户信息

func OnFileUploadFinished

func OnFileUploadFinished(filehash string, filename string,
	filesize int64, fileaddr string) (res ExecResult)

OnFileUploadFinished : 文件上传完成,保存meta

func OnUserFileUploadFinished

func OnUserFileUploadFinished(username, filehash, filename string, filesize int64) (res ExecResult)

OnUserFileUploadFinished : 更新用户文件表

func QueryUserFileMeta

func QueryUserFileMeta(username string, filehash string) (res ExecResult)

QueryUserFileMeta : 获取用户单个文件信息

func QueryUserFileMetas

func QueryUserFileMetas(username string, limit int64) (res ExecResult)

QueryUserFileMetas : 批量获取用户文件信息

func RenameFileName

func RenameFileName(username, filehash, filename string) (res ExecResult)

RenameFileName : 文件重命名

func UpdateFileLocation

func UpdateFileLocation(filehash string, fileaddr string) (res ExecResult)

UpdateFileLocation : 更新文件的存储地址(如文件被转移了)

func UpdateToken

func UpdateToken(username string, token string) (res ExecResult)

UpdateToken : 刷新用户登录的token

func UserExist

func UserExist(username string) (res ExecResult)

UserExist : 查询用户是否存在

func UserSignin

func UserSignin(username string, encpwd string) (res ExecResult)

UserSignin : 判断密码是否一致

func UserSignup

func UserSignup(username string, passwd string) (res ExecResult)

UserSignup : 通过用户名及密码完成user表的注册操作

type TableFile

type TableFile struct {
	FileHash string
	FileName sql.NullString
	FileSize sql.NullInt64
	FileAddr sql.NullString
}

TableFile : 文件表结构体

type TableUser

type TableUser struct {
	Username     string
	Email        string
	Phone        string
	SignupAt     string
	LastActiveAt string
	Status       int
}

TableUser : 用户表model

type TableUserFile

type TableUserFile struct {
	UserName    string
	FileHash    string
	FileName    string
	FileSize    int64
	UploadAt    string
	LastUpdated string
}

TableUserFile : 用户文件表结构体

Jump to

Keyboard shortcuts

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