From 5de00e6861a438ef8a116b72f3ae7fb2f740120b Mon Sep 17 00:00:00 2001 From: SoXX Date: Fri, 28 Jun 2024 10:58:07 +0200 Subject: [PATCH] refactor: reorganized code structure Signed-off-by: SoXX --- pkg/database/database.go | 5 ----- pkg/database/user.go | 5 +++++ pkg/database/usersource.go | 14 -------------- 3 files changed, 5 insertions(+), 19 deletions(-) delete mode 100644 pkg/database/usersource.go diff --git a/pkg/database/database.go b/pkg/database/database.go index c721eb4..0cd0777 100644 --- a/pkg/database/database.go +++ b/pkg/database/database.go @@ -11,12 +11,7 @@ type OtterSpace interface { Connect(ctx context.Context, config models.DatabaseConfig) error User - Source - TagAlias - TagGroup - - UserSource } diff --git a/pkg/database/user.go b/pkg/database/user.go index 1b72e61..d90ca51 100644 --- a/pkg/database/user.go +++ b/pkg/database/user.go @@ -26,4 +26,9 @@ type User interface { GetUserFavoriteWithPagination(ctx context.Context, anthroveUserID models.AnthroveUserID, skip int, limit int) (*models.FavoriteList, error) // GetUserTagWitRelationToFavedPosts retrieves a user's tags through their favorited posts. GetUserTagWitRelationToFavedPosts(ctx context.Context, anthroveUserID models.AnthroveUserID) ([]models.TagsWithFrequency, error) + + UpdateUserSourceScrapeTimeInterval(ctx context.Context, anthroveUserID models.AnthroveUserID, sourceID models.AnthroveSourceID, scrapeTime models.AnthroveScrapeTimeInterval) error + UpdateUserSourceLastScrapeTime(ctx context.Context, anthroveUserID models.AnthroveUserID, sourceID models.AnthroveSourceID, lastScrapeTime models.AnthroveUserLastScrapeTime) error + + UpdateUserSourceValidation(ctx context.Context, anthroveUserID models.AnthroveUserID, sourceID models.AnthroveSourceID, valid bool) error } diff --git a/pkg/database/usersource.go b/pkg/database/usersource.go deleted file mode 100644 index 1f30a48..0000000 --- a/pkg/database/usersource.go +++ /dev/null @@ -1,14 +0,0 @@ -package database - -import ( - "context" - - "git.dragse.it/anthrove/otter-space-sdk/pkg/models" -) - -type UserSource interface { - UpdateUserSourceScrapeTimeInterval(ctx context.Context, anthroveUserID models.AnthroveUserID, sourceID models.AnthroveSourceID, scrapeTime models.AnthroveScrapeTimeInterval) error - UpdateUserSourceLastScrapeTime(ctx context.Context, anthroveUserID models.AnthroveUserID, sourceID models.AnthroveSourceID, lastScrapeTime models.AnthroveUserLastScrapeTime) error - - UpdateUserSourceValidation(ctx context.Context, anthroveUserID models.AnthroveUserID, sourceID models.AnthroveSourceID, valid bool) error -}