mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 Improve upload assets to cloud
This commit is contained in:
parent
b9f1da33f0
commit
fdb0600dbb
3 changed files with 15 additions and 25 deletions
|
|
@ -115,21 +115,6 @@ func QueryAssetByHash(hash string) (ret *Asset) {
|
|||
return
|
||||
}
|
||||
|
||||
func QueryRootBlockAssets(rootID string) (ret []*Asset) {
|
||||
sqlStmt := "SELECT * FROM assets WHERE root_id = ?"
|
||||
rows, err := query(sqlStmt, rootID)
|
||||
if nil != err {
|
||||
logging.LogErrorf("sql query [%s] failed: %s", sqlStmt, err)
|
||||
return
|
||||
}
|
||||
defer rows.Close()
|
||||
for rows.Next() {
|
||||
asset := scanAssetRows(rows)
|
||||
ret = append(ret, asset)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func scanAssetRows(rows *sql.Rows) (ret *Asset) {
|
||||
var asset Asset
|
||||
if err := rows.Scan(&asset.ID, &asset.BlockID, &asset.RootID, &asset.Box, &asset.DocPath, &asset.Path, &asset.Name, &asset.Title, &asset.Hash); nil != err {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue