Feat: download file from single file share

This commit is contained in:
HFO4
2020-01-28 12:41:00 +08:00
parent 0977b36f8b
commit 7f0feebf42
13 changed files with 199 additions and 8 deletions

View File

@@ -8,6 +8,7 @@ import (
// Share 分享序列化
type Share struct {
Key string `json:"key"`
Locked bool `json:"locked"`
IsDir bool `json:"is_dir"`
Score int `json:"score"`
@@ -34,6 +35,7 @@ type shareSource struct {
func BuildShareResponse(share *model.Share, unlocked bool) Share {
creator := share.GetCreator()
resp := Share{
Key: hashid.HashID(share.ID, hashid.ShareID),
Locked: !unlocked,
Creator: &shareCreator{
Key: hashid.HashID(creator.ID, hashid.UserID),