Documentation ¶
Index ¶
- Variables
- func AddLikeCountToArtwork(ctx context.Context) error
- func CheckDeletedByURL(ctx context.Context, sourceURL string) bool
- func CleanPostingCachedArtwork(ctx context.Context) (*mongo.DeleteResult, error)
- func ConvertArtistUIDToString(ctx context.Context) error
- func CreateAdmin(ctx context.Context, admin *model.AdminModel) (*mongo.InsertOneResult, error)
- func CreateArtist(ctx context.Context, artist *model.ArtistModel) (*mongo.InsertOneResult, error)
- func CreateArtwork(ctx context.Context, artwork *model.ArtworkModel) (*mongo.InsertOneResult, error)
- func CreateCachedArtwork(ctx context.Context, artwork *types.Artwork, status types.ArtworkStatus) (*mongo.InsertOneResult, error)
- func CreateCallbackData(ctx context.Context, data string) (*model.CallbackDataModel, error)
- func CreateDeleted(ctx context.Context, deleted *model.DeletedModel) (*mongo.InsertOneResult, error)
- func CreateFavorite(ctx context.Context, userID, artworkID primitive.ObjectID) (*mongo.InsertOneResult, error)
- func CreateLike(ctx context.Context, like *model.LikeModel) (*mongo.InsertOneResult, error)
- func CreatePicture(ctx context.Context, picture *model.PictureModel) (*mongo.InsertOneResult, error)
- func CreatePictures(ctx context.Context, pictures []*model.PictureModel) (*mongo.InsertManyResult, error)
- func CreateSuperAdminByUserID(ctx context.Context, userID int64, grant int64) (*mongo.InsertOneResult, error)
- func CreateTag(ctx context.Context, tag *model.TagModel) (*mongo.InsertOneResult, error)
- func CreateTags(ctx context.Context, tags []*model.TagModel) (*mongo.InsertManyResult, error)
- func CreateUnauthUser(ctx context.Context, user *model.UnauthUserModel) (*mongo.InsertOneResult, error)
- func CreateUser(ctx context.Context, user *model.UserModel) (*mongo.InsertOneResult, error)
- func DeleteAdminByUserID(ctx context.Context, userID int64) (*mongo.DeleteResult, error)
- func DeleteArtworkByID(ctx context.Context, id primitive.ObjectID) (*mongo.DeleteResult, error)
- func DeleteDeletedByURL(ctx context.Context, sourceURL string) (*mongo.DeleteResult, error)
- func DeleteEtcData(ctx context.Context, key string) (*mongo.DeleteResult, error)
- func DeleteFavorite(ctx context.Context, userID, artworkID primitive.ObjectID) (*mongo.DeleteResult, error)
- func DeletePictureByID(ctx context.Context, id primitive.ObjectID) (*mongo.DeleteResult, error)
- func DeletePicturesByArtworkID(ctx context.Context, artworkID primitive.ObjectID) (*mongo.DeleteResult, error)
- func DeleteUnauthUser(ctx context.Context, id primitive.ObjectID) (*mongo.DeleteResult, error)
- func GetAdminByUserID(ctx context.Context, userID int64) (*model.AdminModel, error)
- func GetAdmins(ctx context.Context) ([]model.AdminModel, error)
- func GetArtistByID(ctx context.Context, id primitive.ObjectID) (*model.ArtistModel, error)
- func GetArtistByUID(ctx context.Context, uid string, sourceType types.SourceType) (*model.ArtistModel, error)
- func GetArtistByUserName(ctx context.Context, username string, sourceType types.SourceType) (*model.ArtistModel, error)
- func GetArtistCount(ctx context.Context) (int64, error)
- func GetArtworkByID(ctx context.Context, id primitive.ObjectID) (*model.ArtworkModel, error)
- func GetArtworkByURL(ctx context.Context, url string) (*model.ArtworkModel, error)
- func GetArtworkCount(ctx context.Context, r18 types.R18Type) (int64, error)
- func GetArtworkCountByArtistID(ctx context.Context, artistID primitive.ObjectID, r18 types.R18Type) (int64, error)
- func GetArtworksByArtistID(ctx context.Context, artistID primitive.ObjectID, r18 types.R18Type, ...) ([]*model.ArtworkModel, error)
- func GetArtworksByR18(ctx context.Context, r18 types.R18Type, limit int) ([]*model.ArtworkModel, error)
- func GetArtworksByTags(ctx context.Context, tags [][]primitive.ObjectID, r18 types.R18Type, ...) ([]*model.ArtworkModel, error)
- func GetCachedArtworkByURL(ctx context.Context, url string) (*model.CachedArtworksModel, error)
- func GetCallbackDataByID(ctx context.Context, id primitive.ObjectID) (*model.CallbackDataModel, error)
- func GetDeletedByURL(ctx context.Context, sourceURL string) (*model.DeletedModel, error)
- func GetEtcData(ctx context.Context, key string) (bson.M, error)
- func GetFavorite(ctx context.Context, userID, artworkID primitive.ObjectID) (*model.FavoriteModel, error)
- func GetLatestArtworks(ctx context.Context, r18 types.R18Type, page, pageSize int64) ([]*model.ArtworkModel, error)
- func GetLike(ctx context.Context, userID, artworkID primitive.ObjectID) (*model.LikeModel, error)
- func GetNoHashPictures(ctx context.Context) ([]*model.PictureModel, error)
- func GetNoRegularAndThumbPictures(ctx context.Context) ([]*model.PictureModel, error)
- func GetPictureByID(ctx context.Context, id primitive.ObjectID) (*model.PictureModel, error)
- func GetPictureByMessageID(ctx context.Context, messageID int) (*model.PictureModel, error)deprecated
- func GetPictureByOriginal(ctx context.Context, original string) (*model.PictureModel, error)
- func GetPictureCount(ctx context.Context) (int64, error)
- func GetPicturesByHash(ctx context.Context, hash string) ([]*model.PictureModel, error)
- func GetPicturesByHashHammingDistance(ctx context.Context, hashStr string, distance int) ([]*model.PictureModel, error)
- func GetRandomTags(ctx context.Context, limit int) ([]*model.TagModel, error)
- func GetTagByID(ctx context.Context, id primitive.ObjectID) (*model.TagModel, error)
- func GetTagByName(ctx context.Context, name string) (*model.TagModel, error)
- func GetTagCount(ctx context.Context) (int64, error)
- func GetUnauthUserByID(ctx context.Context, id primitive.ObjectID) (*model.UnauthUserModel, error)
- func GetUnauthUserByUsername(ctx context.Context, username string) (*model.UnauthUserModel, error)
- func GetUserByEmail(ctx context.Context, email string) (*model.UserModel, error)
- func GetUserByID(ctx context.Context, id primitive.ObjectID) (*model.UserModel, error)
- func GetUserByTelegramID(ctx context.Context, telegramID int64) (*model.UserModel, error)
- func GetUserByUsername(ctx context.Context, username string) (*model.UserModel, error)
- func IncrementArtworkLikeCountByID(ctx context.Context, id primitive.ObjectID) (*mongo.UpdateResult, error)
- func InitDB(ctx context.Context)
- func MigrateStorageInfo(ctx context.Context) error
- func QueryArtistsByName(ctx context.Context, name string) ([]*model.ArtistModel, error)
- func QueryArtistsByUserName(ctx context.Context, username string) ([]*model.ArtistModel, error)
- func QueryArtworksByTexts(ctx context.Context, texts [][]string, r18 types.R18Type, limit int) ([]*model.ArtworkModel, error)
- func QueryArtworksByTextsPage(ctx context.Context, texts [][]string, r18 types.R18Type, page, pageSize int64) ([]*model.ArtworkModel, error)
- func QueryTagsByName(ctx context.Context, name string) ([]*model.TagModel, error)
- func SetEtcData(ctx context.Context, key string, value any) (*mongo.UpdateResult, error)
- func TidyArtist(ctx context.Context) error
- func UpdateAdmin(ctx context.Context, admin *model.AdminModel) (*mongo.UpdateResult, error)
- func UpdateArtist(ctx context.Context, artist *model.ArtistModel) (*mongo.UpdateResult, error)
- func UpdateArtworkPicturesByID(ctx context.Context, id primitive.ObjectID, pictures []primitive.ObjectID) (*mongo.UpdateResult, error)
- func UpdateArtworkR18ByID(ctx context.Context, id primitive.ObjectID, r18 bool) (*mongo.UpdateResult, error)
- func UpdateArtworkTagsByID(ctx context.Context, id primitive.ObjectID, tags []primitive.ObjectID) (*mongo.UpdateResult, error)
- func UpdateArtworkTitleByID(ctx context.Context, id primitive.ObjectID, title string) (*mongo.UpdateResult, error)
- func UpdateCachedArtwork(ctx context.Context, artwork *model.CachedArtworksModel) (*mongo.UpdateResult, error)
- func UpdateCachedArtworkStatusByURL(ctx context.Context, url string, status types.ArtworkStatus) (*mongo.UpdateResult, error)
- func UpdatePictureHashAndBlurScoreByID(ctx context.Context, id primitive.ObjectID, hash string, blurScore float64) (*mongo.UpdateResult, error)
- func UpdatePictureIndexByID(ctx context.Context, id primitive.ObjectID, index uint) (*mongo.UpdateResult, error)
- func UpdatePictureSizeByID(ctx context.Context, id primitive.ObjectID, width, height int) (*mongo.UpdateResult, error)
- func UpdatePictureStorageInfoByID(ctx context.Context, id primitive.ObjectID, storageInfo *types.StorageInfo) (*mongo.UpdateResult, error)
- func UpdatePictureTelegramInfoByID(ctx context.Context, id primitive.ObjectID, telegramInfo *types.TelegramInfo) (*mongo.UpdateResult, error)
- func UpdateUnauthUser(ctx context.Context, id primitive.ObjectID, user *model.UnauthUserModel) (*mongo.UpdateResult, error)
- func UpdateUserSettings(ctx context.Context, id primitive.ObjectID, settings *model.UserSettings) (*mongo.UpdateResult, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Client *mongo.Client
View Source
var DB *mongo.Database
Functions ¶
func AddLikeCountToArtwork ¶
func CleanPostingCachedArtwork ¶
func CleanPostingCachedArtwork(ctx context.Context) (*mongo.DeleteResult, error)
func CreateAdmin ¶
func CreateAdmin(ctx context.Context, admin *model.AdminModel) (*mongo.InsertOneResult, error)
func CreateArtist ¶
func CreateArtist(ctx context.Context, artist *model.ArtistModel) (*mongo.InsertOneResult, error)
func CreateArtwork ¶
func CreateArtwork(ctx context.Context, artwork *model.ArtworkModel) (*mongo.InsertOneResult, error)
func CreateCachedArtwork ¶
func CreateCachedArtwork(ctx context.Context, artwork *types.Artwork, status types.ArtworkStatus) (*mongo.InsertOneResult, error)
func CreateCallbackData ¶
func CreateDeleted ¶
func CreateDeleted(ctx context.Context, deleted *model.DeletedModel) (*mongo.InsertOneResult, error)
func CreateFavorite ¶
func CreateLike ¶
func CreatePicture ¶
func CreatePicture(ctx context.Context, picture *model.PictureModel) (*mongo.InsertOneResult, error)
func CreatePictures ¶
func CreatePictures(ctx context.Context, pictures []*model.PictureModel) (*mongo.InsertManyResult, error)
func CreateTags ¶
func CreateUnauthUser ¶
func CreateUnauthUser(ctx context.Context, user *model.UnauthUserModel) (*mongo.InsertOneResult, error)
func CreateUser ¶
func DeleteAdminByUserID ¶
func DeleteArtworkByID ¶
func DeleteDeletedByURL ¶
func DeleteEtcData ¶
func DeleteFavorite ¶
func DeletePictureByID ¶
func DeleteUnauthUser ¶
func GetAdminByUserID ¶
func GetArtistByID ¶
func GetArtistByUID ¶
func GetArtistByUID(ctx context.Context, uid string, sourceType types.SourceType) (*model.ArtistModel, error)
func GetArtistByUserName ¶
func GetArtistByUserName(ctx context.Context, username string, sourceType types.SourceType) (*model.ArtistModel, error)
func GetArtworkByID ¶
func GetArtworkByURL ¶
func GetArtworksByArtistID ¶
func GetArtworksByR18 ¶
func GetArtworksByTags ¶
func GetCachedArtworkByURL ¶
func GetCallbackDataByID ¶
func GetDeletedByURL ¶
func GetFavorite ¶
func GetLatestArtworks ¶
func GetNoHashPictures ¶
func GetNoHashPictures(ctx context.Context) ([]*model.PictureModel, error)
func GetNoRegularAndThumbPictures ¶
func GetNoRegularAndThumbPictures(ctx context.Context) ([]*model.PictureModel, error)
func GetPictureByID ¶
func GetPictureByMessageID
deprecated
func GetPictureByOriginal ¶
func GetPicturesByHash ¶
func GetPicturesByHashHammingDistance ¶
func GetPicturesByHashHammingDistance(ctx context.Context, hashStr string, distance int) ([]*model.PictureModel, error)
全库遍历搜索
func GetTagByID ¶
func GetUnauthUserByID ¶
func GetUnauthUserByUsername ¶
func GetUserByEmail ¶
func GetUserByID ¶
func GetUserByTelegramID ¶
func GetUserByUsername ¶
func MigrateStorageInfo ¶
func QueryArtistsByName ¶
func QueryArtistsByUserName ¶
func QueryArtworksByTexts ¶
func QueryTagsByName ¶
func SetEtcData ¶
func TidyArtist ¶
func UpdateAdmin ¶
func UpdateAdmin(ctx context.Context, admin *model.AdminModel) (*mongo.UpdateResult, error)
func UpdateArtist ¶
func UpdateArtist(ctx context.Context, artist *model.ArtistModel) (*mongo.UpdateResult, error)
func UpdateArtworkR18ByID ¶
func UpdateArtworkTagsByID ¶
func UpdateArtworkTitleByID ¶
func UpdateCachedArtwork ¶
func UpdateCachedArtwork(ctx context.Context, artwork *model.CachedArtworksModel) (*mongo.UpdateResult, error)
func UpdateCachedArtworkStatusByURL ¶
func UpdateCachedArtworkStatusByURL(ctx context.Context, url string, status types.ArtworkStatus) (*mongo.UpdateResult, error)
func UpdatePictureIndexByID ¶
func UpdatePictureSizeByID ¶
func UpdatePictureStorageInfoByID ¶
func UpdatePictureStorageInfoByID(ctx context.Context, id primitive.ObjectID, storageInfo *types.StorageInfo) (*mongo.UpdateResult, error)
func UpdatePictureTelegramInfoByID ¶
func UpdatePictureTelegramInfoByID(ctx context.Context, id primitive.ObjectID, telegramInfo *types.TelegramInfo) (*mongo.UpdateResult, error)
func UpdateUnauthUser ¶
func UpdateUnauthUser(ctx context.Context, id primitive.ObjectID, user *model.UnauthUserModel) (*mongo.UpdateResult, error)
func UpdateUserSettings ¶
func UpdateUserSettings(ctx context.Context, id primitive.ObjectID, settings *model.UserSettings) (*mongo.UpdateResult, error)
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.