feat: sign of file

This commit is contained in:
Noah Hsu
2022-06-28 15:12:40 +08:00
parent 5dbf5db4ff
commit d89ec89d51
8 changed files with 122 additions and 10 deletions

View File

@ -33,17 +33,18 @@ func FsGet(c *gin.Context) {
common.ErrorStrResp(c, "password is incorrect", 401)
return
}
data, err := fs.Get(c, req.Path)
obj, err := fs.Get(c, req.Path)
if err != nil {
common.ErrorResp(c, err, 500, true)
return
}
common.SuccessResp(c, FsGetResp{
ObjResp: ObjResp{
Name: data.GetName(),
Size: data.GetSize(),
IsDir: data.IsDir(),
Modified: data.ModTime(),
Name: obj.GetName(),
Size: obj.GetSize(),
IsDir: obj.IsDir(),
Modified: obj.ModTime(),
Sign: Sign(obj),
},
// TODO: set raw url
})