collections

package
v0.33.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2023 License: AGPL-3.0, AGPL-3.0-only Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

type Repo interface {
	// WithQuery is used to replace repo's query to txn
	WithQuery(query *query.Query) Repo
	CountSubjectCollections(
		ctx context.Context,
		userID model.UserID,
		subjectType model.SubjectType,
		collectionType collection.SubjectCollection,
		showPrivate bool,
	) (int64, error)

	ListSubjectCollection(
		ctx context.Context,
		userID model.UserID,
		subjectType model.SubjectType,
		collectionType collection.SubjectCollection,
		showPrivate bool,
		limit, offset int,
	) ([]collection.UserSubjectCollection, error)

	GetSubjectCollection(
		ctx context.Context, userID model.UserID, subjectID model.SubjectID,
	) (collection.UserSubjectCollection, error)

	GetSubjectEpisodesCollection(
		ctx context.Context, userID model.UserID, subjectID model.SubjectID,
	) (collection.UserSubjectEpisodesCollection, error)

	UpdateSubjectCollection(
		ctx context.Context, userID model.UserID, subject model.Subject,
		at time.Time, ip string,
		update func(ctx context.Context, s *collection.Subject) (*collection.Subject, error),
	) error

	UpdateOrCreateSubjectCollection(
		ctx context.Context, userID model.UserID, subject model.Subject,
		at time.Time, ip string,
		update func(ctx context.Context, s *collection.Subject) (*collection.Subject, error),
	) error

	UpdateEpisodeCollection(
		ctx context.Context,
		userID model.UserID, subjectID model.SubjectID,
		episodeIDs []model.EpisodeID, collection collection.EpisodeCollection,
		at time.Time,
	) (collection.UserSubjectEpisodesCollection, error)
}

type Update

type Update struct {
	IP string

	Comment   null.String
	Tags      []string // nil 表示无数据,[]string{} 表示清空tag
	VolStatus null.Uint32
	EpStatus  null.Uint32
	Type      null.Null[collection.SubjectCollection]
	Rate      null.Uint8
	Privacy   null.Null[collection.CollectPrivacy]
}

Directories

Path Synopsis
domain

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL