operations

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 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 {
	Ctx     context.Context
	Flt     models.Filter
	Session mongo.Session
	Cols    *DatabaseCollections
	Sc      *SearchOperations
}

func (*DatabaseOperations) AddIllusts

func (ops *DatabaseOperations) AddIllusts(illusts []models.Illust) error

func (*DatabaseOperations) AddRankIllusts

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

func (*DatabaseOperations) ClearUserIllusts

func (ops *DatabaseOperations) ClearUserIllusts(userId uint64) error

func (*DatabaseOperations) DeleteIllust

func (ops *DatabaseOperations) DeleteIllust(illustId uint64) error

func (*DatabaseOperations) DeleteUgoira

func (ops *DatabaseOperations) DeleteUgoira(ugoiraId uint64) error

func (*DatabaseOperations) DeleteUser

func (ops *DatabaseOperations) DeleteUser(userId uint64) error

func (*DatabaseOperations) GetSampleIllusts

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

func (*DatabaseOperations) GetSampleUsers

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

func (*DatabaseOperations) InsertIllust

func (ops *DatabaseOperations) InsertIllust(illust *models.Illust) error

func (*DatabaseOperations) InsertIllustSearch

func (ops *DatabaseOperations) InsertIllustSearch(illust *models.Illust) error

func (*DatabaseOperations) InsertIllustTagNearDB

func (ops *DatabaseOperations) InsertIllustTagNearDB(illust *models.Illust) error

func (*DatabaseOperations) InsertIllusts

func (ops *DatabaseOperations) InsertIllusts(illusts []models.Illust) error

func (*DatabaseOperations) InsertRank

func (ops *DatabaseOperations) InsertRank(mode string, date string, content string) (bool, error)

func (*DatabaseOperations) InsertUgoira

func (ops *DatabaseOperations) InsertUgoira(ugoira *models.Ugoira) error

func (*DatabaseOperations) InsertUser

func (ops *DatabaseOperations) InsertUser(user *models.User) error

func (*DatabaseOperations) InsertUserSearch

func (ops *DatabaseOperations) InsertUserSearch(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(illustId uint64, resultbanned bool) (*models.Illust, error)

func (*DatabaseOperations) QueryIllustByUser

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

func (*DatabaseOperations) QueryIllustByUserWithPage

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

func (*DatabaseOperations) QueryIllusts

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

func (*DatabaseOperations) QueryIllustsByTags

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

func (*DatabaseOperations) QueryRankIllusts

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

func (*DatabaseOperations) QueryUgoira

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

func (*DatabaseOperations) QueryUser

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

func (*DatabaseOperations) QueryUsers

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

func (*DatabaseOperations) RecommendIllustsByIllustId

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

func (*DatabaseOperations) SearchIllust

func (ops *DatabaseOperations) SearchIllust(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(keyword string) ([]string, error)

func (*DatabaseOperations) SearchTagSuggest

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

func (*DatabaseOperations) SearchUser

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

func (*DatabaseOperations) SearchUserSuggest

func (ops *DatabaseOperations) SearchUserSuggest(keyword string) ([]string, error)

func (*DatabaseOperations) SetIllustsCount

func (ops *DatabaseOperations) SetIllustsCount(userId uint64, count uint) error

func (*DatabaseOperations) UpdateUserIllustsTime

func (ops *DatabaseOperations) UpdateUserIllustsTime(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