diff --git a/pkg/database/database.go b/pkg/database/database.go index 7977186..bc31c17 100644 --- a/pkg/database/database.go +++ b/pkg/database/database.go @@ -22,11 +22,11 @@ type OtterSpace interface { CheckUserPostLink(ctx context.Context, anthroveUserID models.AnthroveUserID, sourcePostID string, sourceUrl string) (bool, error) - CheckPostNodeExistsByAnthroveID(ctx context.Context, anthrovePost *models.Post) (*models.Post, error) + GetPostByAnthroveID(ctx context.Context, anthrovePost *models.Post) (*models.Post, error) - CheckPostNodeExistsBySourceURL(ctx context.Context, sourceUrl string) (*models.Post, error) + GetPostBySourceURL(ctx context.Context, sourceUrl string) (*models.Post, error) - CheckPostNodeExistsBySourceID(ctx context.Context, sourcePostID string) (*models.Post, error) + GetPostBySourceID(ctx context.Context, sourcePostID string) (*models.Post, error) GetUserFavoriteCount(ctx context.Context, anthroveUserID models.AnthroveUserID) (int64, error) diff --git a/pkg/database/postgres.go b/pkg/database/postgres.go index d91f57a..f4a2750 100644 --- a/pkg/database/postgres.go +++ b/pkg/database/postgres.go @@ -92,15 +92,15 @@ func (p *postgresqlConnection) CheckUserPostLink(ctx context.Context, anthroveUs return postgres.CheckUserToPostLink(ctx, p.db, anthroveUserID, models.AnthrovePostID(sourcePostID)) } -func (p *postgresqlConnection) CheckPostNodeExistsByAnthroveID(ctx context.Context, anthrovePost *models.Post) (*models.Post, error) { +func (p *postgresqlConnection) GetPostByAnthroveID(ctx context.Context, anthrovePost *models.Post) (*models.Post, error) { return postgres.GetPostByAnthroveID(ctx, p.db, anthrovePost.ID) } -func (p *postgresqlConnection) CheckPostNodeExistsBySourceURL(ctx context.Context, sourceUrl string) (*models.Post, error) { +func (p *postgresqlConnection) GetPostBySourceURL(ctx context.Context, sourceUrl string) (*models.Post, error) { return postgres.GetPostBySourceURL(ctx, p.db, sourceUrl) } -func (p *postgresqlConnection) CheckPostNodeExistsBySourceID(ctx context.Context, sourcePostID string) (*models.Post, error) { +func (p *postgresqlConnection) GetPostBySourceID(ctx context.Context, sourcePostID string) (*models.Post, error) { return postgres.GetPostBySourceID(ctx, p.db, sourcePostID) }