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

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