operations

package
v1.1.11 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseCollections

type DatabaseCollections struct {
	Illust *mongo.Collection
	User   *mongo.Collection
	Rank   *mongo.Collection
	Ugoira *mongo.Collection
}

type DatabaseOperations

type DatabaseOperations struct {
	Flt  models.Filter
	Cols *DatabaseCollections
	Sc   *SearchOperations
}

func (*DatabaseOperations) AddIllusts

func (ops *DatabaseOperations) AddIllusts(ctx context.Context, illusts []models.Illust) error

func (*DatabaseOperations) AddRankIllusts

func (ops *DatabaseOperations) AddRankIllusts(ctx context.Context, mode string, date string, content string, illusts []models.RankIllust) error

func (*DatabaseOperations) ClearUserIllusts

func (ops *DatabaseOperations) ClearUserIllusts(ctx context.Context, userId uint64) error

func (*DatabaseOperations) DeleteIllust

func (ops *DatabaseOperations) DeleteIllust(ctx context.Context, illustId uint64) error

func (*DatabaseOperations) DeleteUgoira

func (ops *DatabaseOperations) DeleteUgoira(ctx context.Context, ugoiraId uint64) error

func (*DatabaseOperations) DeleteUser

func (ops *DatabaseOperations) DeleteUser(ctx context.Context, userId uint64) error

func (*DatabaseOperations) GetSampleIllusts

func (ops *DatabaseOperations) GetSampleIllusts(ctx context.Context, quality int, limit int, resultbanned bool) ([]models.Illust, error)

func (*DatabaseOperations) GetSampleUsers

func (ops *DatabaseOperations) GetSampleUsers(ctx context.Context, limit int, resultbanned bool) ([]models.User, error)

func (*DatabaseOperations) InsertIllust

func (ops *DatabaseOperations) InsertIllust(ctx context.Context, illust *models.Illust) error

func (*DatabaseOperations) InsertIllustSearch

func (ops *DatabaseOperations) InsertIllustSearch(ctx context.Context, illust *models.Illust) error

func (*DatabaseOperations) InsertIllustTagNearDB

func (ops *DatabaseOperations) InsertIllustTagNearDB(ctx context.Context, illust *models.Illust) error

func (*DatabaseOperations) InsertIllusts

func (ops *DatabaseOperations) InsertIllusts(ctx context.Context, illusts []models.Illust) error

func (*DatabaseOperations) InsertRank

func (ops *DatabaseOperations) InsertRank(ctx context.Context, mode string, date string, content string) (bool, error)

func (*DatabaseOperations) InsertUgoira

func (ops *DatabaseOperations) InsertUgoira(ctx context.Context, ugoira *models.Ugoira) error

func (*DatabaseOperations) InsertUser

func (ops *DatabaseOperations) InsertUser(ctx context.Context, user *models.User) error

func (*DatabaseOperations) InsertUserSearch

func (ops *DatabaseOperations) InsertUserSearch(ctx context.Context, user *models.User) error

func (*DatabaseOperations) IsIllustExist

func (ops *DatabaseOperations) IsIllustExist(illustId uint64) (bool, error)

func (*DatabaseOperations) IsUgoiraExist

func (ops *DatabaseOperations) IsUgoiraExist(ugoiraId uint64) (bool, error)

func (*DatabaseOperations) IsUserExist

func (ops *DatabaseOperations) IsUserExist(userId uint64) (bool, error)

func (*DatabaseOperations) QueryIllust

func (ops *DatabaseOperations) QueryIllust(ctx context.Context, illustId uint64, resultbanned bool) (*models.Illust, error)

func (*DatabaseOperations) QueryIllustByUser

func (ops *DatabaseOperations) QueryIllustByUser(ctx context.Context, userId uint64, resultbanned bool) ([]models.Illust, error)

func (*DatabaseOperations) QueryIllustByUserWithPage

func (ops *DatabaseOperations) QueryIllustByUserWithPage(ctx context.Context, userId uint64, page int64, limit int64, resultbanned bool) ([]models.Illust, error)

func (*DatabaseOperations) QueryIllusts

func (ops *DatabaseOperations) QueryIllusts(ctx context.Context, illustIds []uint64, resultbanned bool) ([]models.Illust, error)

func (*DatabaseOperations) QueryIllustsByTags

func (ops *DatabaseOperations) QueryIllustsByTags(ctx context.Context, musttags []string, shouldtags []string, page int64, limit int64, sortpopularity bool, sortdate bool, resultbanned bool) ([]models.Illust, error)

func (*DatabaseOperations) QueryRankIllusts

func (ops *DatabaseOperations) QueryRankIllusts(ctx context.Context, mode string, date string, content string, page int, limit int) ([]models.RankAggregateResult, error)

func (*DatabaseOperations) QueryUgoira

func (ops *DatabaseOperations) QueryUgoira(ctx context.Context, ugoiraId uint64) (*models.Ugoira, error)

func (*DatabaseOperations) QueryUser

func (ops *DatabaseOperations) QueryUser(ctx context.Context, userId uint64, resultbanned bool) (*models.User, error)

func (*DatabaseOperations) QueryUsers

func (ops *DatabaseOperations) QueryUsers(ctx context.Context, userIds []uint64, resultbanned bool) ([]models.User, error)

func (*DatabaseOperations) RecommendIllustsByIllustId

func (ops *DatabaseOperations) RecommendIllustsByIllustId(ctx context.Context, illustId uint64, k int, drif float64, resultbanned bool) ([]models.Illust, error)

func (*DatabaseOperations) SearchIllust

func (ops *DatabaseOperations) SearchIllust(ctx context.Context, keyword string, page int, limit int, sortpopularity bool, sortdate bool, resultbanned bool) ([]models.Illust, int64, []float64, []*string, error)

func (*DatabaseOperations) SearchIllustSuggest

func (ops *DatabaseOperations) SearchIllustSuggest(ctx context.Context, keyword string) ([]string, error)

func (*DatabaseOperations) SearchTagSuggest

func (ops *DatabaseOperations) SearchTagSuggest(ctx context.Context, keyword string) ([]models.IllustTag, error)

func (*DatabaseOperations) SearchUser

func (ops *DatabaseOperations) SearchUser(ctx context.Context, keyword string, page int, limit int, resultbanned bool) ([]models.User, int64, []float64, []*string, error)

func (*DatabaseOperations) SearchUserSuggest

func (ops *DatabaseOperations) SearchUserSuggest(ctx context.Context, keyword string) ([]string, error)

func (*DatabaseOperations) SetIllustsCount

func (ops *DatabaseOperations) SetIllustsCount(ctx context.Context, userId uint64, count uint) error

func (*DatabaseOperations) UpdateUserIllustsTime

func (ops *DatabaseOperations) UpdateUserIllustsTime(ctx context.Context, userId uint64) error

type SearchOperations

type SearchOperations struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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