From b11cfbaa245401fb84baeee9bcac5d35307a029c Mon Sep 17 00:00:00 2001 From: soxx Date: Sat, 22 Jun 2024 22:07:36 +0200 Subject: [PATCH] refactor(postgres): removed old graph related code Signed-off-by: soxx --- pkg/database/postgres.go | 1 - pkg/models/graphModels/api.go | 20 -------------------- pkg/models/graphModels/post.go | 8 -------- pkg/models/graphModels/relationships.go | 12 ------------ pkg/models/graphModels/source.go | 7 ------- pkg/models/graphModels/tag.go | 6 ------ pkg/models/graphModels/user.go | 8 -------- 7 files changed, 62 deletions(-) delete mode 100644 pkg/models/graphModels/api.go delete mode 100644 pkg/models/graphModels/post.go delete mode 100644 pkg/models/graphModels/relationships.go delete mode 100644 pkg/models/graphModels/source.go delete mode 100644 pkg/models/graphModels/tag.go delete mode 100644 pkg/models/graphModels/user.go diff --git a/pkg/database/postgres.go b/pkg/database/postgres.go index ff4eb16..7025a97 100644 --- a/pkg/database/postgres.go +++ b/pkg/database/postgres.go @@ -71,7 +71,6 @@ func (p *postgresqlConnection) AddUserWithRelationToSource(ctx context.Context, } func (p *postgresqlConnection) AddSource(ctx context.Context, anthroveSource *graphModels.AnthroveSource) error { - source := utils.GraphConvertSource(anthroveSource) return postgres.CreateSourceNode(ctx, p.db, source) } diff --git a/pkg/models/graphModels/api.go b/pkg/models/graphModels/api.go deleted file mode 100644 index 7683097..0000000 --- a/pkg/models/graphModels/api.go +++ /dev/null @@ -1,20 +0,0 @@ -package graphModels - -type FavoriteRelations struct { - SourcesID string `json:"sources_id"` - Relations AnthrovePostRelationship `json:"relations"` -} - -type FavoritePost struct { - AnthrovePost AnthrovePost `json:"anthrove_post"` - Relations []FavoriteRelations `json:"relations"` -} - -type FavoriteList struct { - Posts []FavoritePost `json:"posts,omitempty"` -} - -type TagsWithFrequency struct { - Frequency int64 `json:"frequency"` - Tags AnthroveTag `json:"tags"` -} diff --git a/pkg/models/graphModels/post.go b/pkg/models/graphModels/post.go deleted file mode 100644 index 28caa38..0000000 --- a/pkg/models/graphModels/post.go +++ /dev/null @@ -1,8 +0,0 @@ -package graphModels - -import "git.dragse.it/anthrove/otter-space-sdk/pkg/models" - -type AnthrovePost struct { - PostID models.AnthrovePostID `json:"post_id"` - Rating models.Rating `json:"rating"` -} diff --git a/pkg/models/graphModels/relationships.go b/pkg/models/graphModels/relationships.go deleted file mode 100644 index 639966f..0000000 --- a/pkg/models/graphModels/relationships.go +++ /dev/null @@ -1,12 +0,0 @@ -package graphModels - -type AnthroveUserRelationship struct { - UserID string `json:"user_id"` - Username string `json:"username"` - ScrapeTimeInterval string `json:"scrape_time_interval"` - Source AnthroveSource `json:"source"` -} -type AnthrovePostRelationship struct { - PostID string `json:"post_id"` - Url string `json:"url"` -} diff --git a/pkg/models/graphModels/source.go b/pkg/models/graphModels/source.go deleted file mode 100644 index 5e3795b..0000000 --- a/pkg/models/graphModels/source.go +++ /dev/null @@ -1,7 +0,0 @@ -package graphModels - -type AnthroveSource struct { - DisplayName string `json:"display_name"` - Domain string `json:"domain"` - Icon string `json:"icon"` -} diff --git a/pkg/models/graphModels/tag.go b/pkg/models/graphModels/tag.go deleted file mode 100644 index 699a1fc..0000000 --- a/pkg/models/graphModels/tag.go +++ /dev/null @@ -1,6 +0,0 @@ -package graphModels - -type AnthroveTag struct { - Name string `json:"name"` - Type string `json:"type"` -} diff --git a/pkg/models/graphModels/user.go b/pkg/models/graphModels/user.go deleted file mode 100644 index 3b74a51..0000000 --- a/pkg/models/graphModels/user.go +++ /dev/null @@ -1,8 +0,0 @@ -package graphModels - -import "git.dragse.it/anthrove/otter-space-sdk/pkg/models" - -type AnthroveUser struct { - UserID models.AnthroveUserID `json:"user_id"` - Relationship []AnthroveUserRelationship `json:"relationship"` -}