🧑‍💻 Improve kernel API /api/file/readDir for returning file mod time Fix https://github.com/siyuan-note/siyuan/issues/8945

This commit is contained in:
Daniel 2023-08-10 10:57:01 +08:00
parent 82633a497b
commit 6595524640
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 27 additions and 22 deletions

24
API.md
View file

@ -1064,7 +1064,7 @@ View API token in <kbd>Settings - About</kbd>, request header: `Authorization: T
```json
{
"path": "/data/20210808180117-6v0mkxr/20200923234011-ieuun1p.sy"
"path": "/data/20210808180117-6v0mkxr/20200923234011-ieuun1p"
}
```
* `path`: the file path under the workspace path
@ -1075,16 +1075,18 @@ View API token in <kbd>Settings - About</kbd>, request header: `Authorization: T
"code": 0,
"msg": "",
"data": [
{
"isDir": true,
"isSymlink": false,
"name": "20210808180320-abz7w6k"
},
{
"isDir": false,
"isSymlink": false,
"name": "20210808180320-abz7w6k.sy"
}
{
"isDir": true,
"isSymlink": false,
"name": "20210808180303-6yi0dv5",
"updated": 1691467624
},
{
"isDir": false,
"isSymlink": false,
"name": "20210808180303-6yi0dv5.sy",
"updated": 1663298365
}
]
}
```

View file

@ -1056,7 +1056,7 @@
```json
{
"path": "/data/20210808180117-6v0mkxr/20200923234011-ieuun1p.sy"
"path": "/data/20210808180117-6v0mkxr/20200923234011-ieuun1p"
}
```
* `path`:工作空间路径下的文件路径
@ -1067,16 +1067,18 @@
"code": 0,
"msg": "",
"data": [
{
"isDir": true,
"isSymlink": false,
"name": "20210808180320-abz7w6k"
},
{
"isDir": false,
"isSymlink": false,
"name": "20210808180320-abz7w6k.sy"
}
{
"isDir": true,
"isSymlink": false,
"name": "20210808180303-6yi0dv5",
"updated": 1691467624
},
{
"isDir": false,
"isSymlink": false,
"name": "20210808180303-6yi0dv5.sy",
"updated": 1663298365
}
]
}
```

View file

@ -184,6 +184,7 @@ func readDir(c *gin.Context) {
"name": entry.Name(),
"isDir": info.IsDir(),
"isSymlink": util.IsSymlink(entry),
"updated": info.ModTime().Unix(),
})
}