feat: add write field to list resp

This commit is contained in:
Noah Hsu
2022-06-30 15:53:57 +08:00
parent 35b04ffa9c
commit fba96d024f
3 changed files with 21 additions and 24 deletions

View File

@ -35,6 +35,7 @@ type FsListResp struct {
Content []ObjResp `json:"content"`
Total int64 `json:"total"`
Readme string `json:"readme"`
Write bool `json:"write"`
}
func FsList(c *gin.Context) {
@ -68,6 +69,7 @@ func FsList(c *gin.Context) {
Content: toObjResp(objs),
Total: int64(total),
Readme: getReadme(meta, req.Path),
Write: user.CanWrite() || canWrite(meta, req.Path),
})
}