collection

package
v0.30.16 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: AGPL-3.0, AGPL-3.0-only Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo added in v0.30.3

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 model.SubjectCollection,
		showPrivate bool,
	) (int64, error)

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

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

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

	UpdateSubjectCollection(
		ctx context.Context, userID model.UserID, subjectID model.SubjectID, data Update,
		at time.Time,
	) error

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

func NewMysqlRepo

func NewMysqlRepo(q *query.Query, log *zap.Logger) (Repo, error)

type Update added in v0.30.3

type Update struct {
	IP string

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

Jump to

Keyboard shortcuts

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