refactor(postgres): renamed functions to be more clear

Signed-off-by: soxx <soxx@fenpa.ws>
This commit is contained in:
SoXX 2024-06-22 22:30:03 +02:00
parent 78145fe02a
commit 55296d9a95
2 changed files with 6 additions and 6 deletions

View File

@ -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)

View File

@ -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)
}