controllers

package
v0.0.0-...-3f800da Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const BASE_PATH = "./static/upload/"

上传文件夹地址

View Source
const DOWNLOADS_PATH = "static/upload"
View Source
const RELATIVEPATH_BASE_PATH = "/static/upload/"

返回 url 地址

Variables

This section is empty.

Functions

func CheckFile

func CheckFile(ctx *gin.Context)

检查分片进度

func CreateFolder

func CreateFolder(ctx *gin.Context)

创建文件夹

func DeleteFile

func DeleteFile(ctx *gin.Context)

删除文件

func DeleteFileArr

func DeleteFileArr(ctx *gin.Context)

批量删除多个文件

func DownloadFile

func DownloadFile(ctx *gin.Context)

下载文件 TODO: 访问权限

func FileCategory

func FileCategory(fileExt string) string

文件分类

func FileList

func FileList(ctx *gin.Context)

获取用户上传文件列表

func FileListByFileType

func FileListByFileType(ctx *gin.Context)

文件分类

func FindFilePath

func FindFilePath(ctx *gin.Context)

查看文件所在目录

func FormUpload

func FormUpload(ctx *gin.Context)

单个文件上传

func GenerateRandomMd5

func GenerateRandomMd5(n ...int) string

生成随机md5 32

func GenerateRandomStr

func GenerateRandomStr(n int) string

生成随机字符串 32

func GetFileHash

func GetFileHash(filePath string) (string, error)

返回文件hash

func GetUserProfile

func GetUserProfile(ctx *gin.Context)

func ImageFilter

func ImageFilter(ctx *gin.Context)

图片filter TODO: 访问权限

func MultiUpload

func MultiUpload(ctx *gin.Context)

多个文件上传

func PostLogin

func PostLogin(ctx *gin.Context)

func PostRegister

func PostRegister(ctx *gin.Context)

func Rename

func Rename(ctx *gin.Context)

重命名

func Search(ctx *gin.Context)

文件搜索

func ServerStatic

func ServerStatic(ctx *gin.Context)

获取服务器磁盘配置

func SliceUpload

func SliceUpload(ctx *gin.Context)

分片上传

func Video

func Video(ctx *gin.Context)

视频播放

func VideoInfo

func VideoInfo(ctx *gin.Context)

视频信息

Types

type CreateDirForm

type CreateDirForm struct {
	DirId   uint   `form:"dirId" json:"dirId"`
	DirName string `form:"dirName" json:"dirName" binding:"required"`
}

type DeleteFileArrForm

type DeleteFileArrForm struct {
	DeleteFileArr []uint `form:"deleteFileArr" json:"deleteFileArr" binding:"required"`
}

type DeleteForm

type DeleteForm struct {
	FsId uint `form:"fs_id" json:"fs_id" binding:"required"`
}

type LoginForm

type LoginForm struct {
	Mail string `form:"mail" json:"mail" binding:"required"`
	Pwd  string `form:"pwd" json:"pwd" binding:"required"`
}

type LoginResult

type LoginResult struct {
	Token string `json:"token"`
}

type MultiUploadUrl

type MultiUploadUrl struct {
	Url   string `json:"url"`
	Title string `json:"title"`
}

type QueryForm

type QueryForm struct {
	Order    string `form:"order,default='date'" json:"order,default='date'"`
	DirId    uint   `form:"dirId,default=0" json:"dirId,default=0"`
	Limit    int    `form:"limit,default=50" json:"limit,default=50" binding:"max=100,min=50"`
	Desc     int    `form:"desc,default=1" json:"desc,default=1"`
	Page     int    `form:"page,default=1" json:"page,default=1"`
	FileType string `form:"fileType" json:"fileTye"`
	Q        string `form:"q" json:"q"`
}

type RegisterForm

type RegisterForm struct {
	Uname string `form:"uname" json:"uname" binding:"required"`
	Mail  string `form:"mail" json:"mail" binding:"required"`
	Pwd   string `form:"pwd" json:"pwd" binding:"required"`
}

type RenameForm

type RenameForm struct {
	FsId     uint   `form:"fsId" json:"fsId"`
	DirId    uint   `form:"dirId" json:"dirId"`
	FileName string `form:"fileName" json:"fileName" binding:"required"`
}

type UploadForm

type UploadForm struct {
	Index      int    `form:"index" json:"index"`
	FileMD5    string `form:"fileMD5" json:"fileMD5"`
	DirId      uint   `form:"dirId,default=0" json:"dirId,default=0"`
	UploadType string `form:"uploadType" json:"uploadType"`
	FileName   string `form:"fileName" json:"fileName"`
	FileSize   int64  `form:"fileSize" json:"fileSize"`
}

type UserData

type UserData struct {
	UId    uint   `json:"uid"`
	Uname  string `json:"uname"`
	Avatar string `json:"avatar"`
}

type UserDataTokenRes

type UserDataTokenRes struct {
	UId    uint   `json:"uid"`
	Uname  string `json:"uname"`
	Avatar string `json:"avatar"`
	Token  string `json:"token"`
}

type UserFile

type UserFile struct {
	Id        uint   `json:"id"`
	UId       uint   `json:"uid"`
	Date      int64  `json:"date"`
	File_name string `json:"file_name"`
	File_size int64  `json:"file_size"`
	Md5       string `json:"md5"`
}

type UserFileListRes

type UserFileListRes struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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