MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / listQuery

Method listQuery

inventory/share.go:350–369  ·  view source on GitHub ↗
(args *ListShareArgs)

Source from the content-addressed store, hash-verified

348}
349
350func (c *shareClient) listQuery(args *ListShareArgs) *ent.ShareQuery {
351 query := c.client.Share.Query()
352 if args.UserID > 0 {
353 query.Where(share.HasUserWith(user.ID(args.UserID)))
354 }
355
356 if args.PublicOnly {
357 query.Where(share.PasswordIsNil())
358 }
359
360 if args.FileID > 0 {
361 query.Where(share.HasFileWith(file.ID(args.FileID)))
362 }
363
364 if len(args.ShareIDs) > 0 {
365 query.Where(share.IDIn(args.ShareIDs...))
366 }
367
368 return query
369}
370
371// getShareNextPageToken returns the next page token for the given last share.
372func getShareNextPageToken(hasher hashid.Encoder, last *ent.Share, args *ListShareArgs) (string, error) {

Callers 1

ListMethod · 0.95

Calls 8

HasUserWithFunction · 0.92
IDFunction · 0.92
PasswordIsNilFunction · 0.92
HasFileWithFunction · 0.92
IDFunction · 0.92
IDInFunction · 0.92
QueryMethod · 0.45
WhereMethod · 0.45

Tested by

no test coverage detected