package schema import "time" // FileChunk 文件分块 type FileChunk struct { RecordID string `json:"record_id"` // 记录ID Hash string `json:"hash"` // Total int `json:"total"` // 文件块总数 Current int `json:"current"` // 当前上传的块数 Name string `json:"name"` // 文件名 Path string `json:"path"` // 文件路径 Size int64 `json:"size"` // 文件大小 Creator string `json:"creator"` // 创建者 CreatedAt time.Time `json:"created_at"` // 创建时间 FileHash string `json:"file_hash"` // 文件的md5 PastTime time.Time `json:"past_time"` //文件块过期的时间 } // FileChunkQueryParam 查询条件 type FileChunkQueryParam struct { Hash string `form:"hash"` Current int `form:"current"` Name string `form:"name"` IsClear bool `form:"is_clear"` } // FileChunkQueryOptions demo对象查询可选参数项 type FileChunkQueryOptions struct { PageParam *PaginationParam // 分页参数 } type FileChunkS []*FileChunk // FileChunkQueryResult demo对象查询结果 type FileChunkQueryResult struct { Data FileChunkS PageResult *PaginationResult } func (a FileChunkS) FileChunkToPath() []string { pathS := make([]string, 0, len(a)) for i := range a { pathS = append(pathS, a[i].Path) } return pathS }