chore: change fs get and list resp

This commit is contained in:
Noah Hsu
2022-06-27 21:34:13 +08:00
parent c8f10703b7
commit 7903ed1f52
4 changed files with 27 additions and 14 deletions

View File

@ -7,7 +7,6 @@ import (
"github.com/alist-org/alist/v3/server/common"
"github.com/gin-gonic/gin"
stdpath "path"
"time"
)
type FsGetReq struct {
@ -16,11 +15,8 @@ type FsGetReq struct {
}
type FsGetResp struct {
Name string `json:"name"`
Size int64 `json:"size"`
IsDir bool `json:"is_dir"`
Modified time.Time `json:"modified"`
URL string `json:"url"`
ObjResp
RawURL string `json:"raw_url"`
}
func FsGet(c *gin.Context) {
@ -43,9 +39,12 @@ func FsGet(c *gin.Context) {
return
}
common.SuccessResp(c, FsGetResp{
Name: data.GetName(),
Size: data.GetSize(),
IsDir: data.IsDir(),
Modified: data.ModTime(),
ObjResp: ObjResp{
Name: data.GetName(),
Size: data.GetSize(),
IsDir: data.IsDir(),
Modified: data.ModTime(),
},
// TODO: set raw url
})
}