feat(api): implement get resource by uid

This commit is contained in:
Steven
2024-07-11 23:43:44 +08:00
parent 1ab2c89408
commit 457cf92cc1
12 changed files with 409 additions and 130 deletions

View File

@ -53,6 +53,9 @@ func (d *DB) ListResources(ctx context.Context, find *store.FindResource) ([]*st
if v := find.Filename; v != nil {
where, args = append(where, "`filename` = ?"), append(args, *v)
}
if v := find.FilenameSearch; v != nil {
where, args = append(where, "`filename` LIKE ?"), append(args, fmt.Sprintf("%%%s%%", *v))
}
if v := find.MemoID; v != nil {
where, args = append(where, "`memo_id` = ?"), append(args, *v)
}