51 lines
2.3 KiB
Go
51 lines
2.3 KiB
Go
package graph
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"git.dragse.it/anthrove/otter-space-sdk/internal"
|
|
"git.dragse.it/anthrove/otter-space-sdk/pkg/models"
|
|
)
|
|
|
|
func (g *graphConnection) CreateUser(ctx context.Context, anthroveUserID models.AnthroveUserID) error {
|
|
//TODO implement me
|
|
return fmt.Errorf("not implemented! Use the CreateUserWithRelationToSource function to create a user")
|
|
}
|
|
|
|
func (g *graphConnection) DeleteUser(ctx context.Context, anthroveUserID models.AnthroveUserID) error {
|
|
//TODO implement me
|
|
return fmt.Errorf("not implemented")
|
|
}
|
|
|
|
func (g *graphConnection) CreateUserWithRelationToSource(ctx context.Context, anthroveUserID models.AnthroveUserID, sourceDomain string, userID string, username string) error {
|
|
return internal.CreateUserNodeWithSourceRelation(ctx, g.driver, anthroveUserID, sourceDomain, userID, username)
|
|
}
|
|
|
|
func (g *graphConnection) GetUserTagsTroughFavedPosts(ctx context.Context, anthroveUserID models.AnthroveUserID) ([]models.TagsWithFrequency, error) {
|
|
return internal.GetUserTagNodeWitRelationToFavedPosts(ctx, g.driver, anthroveUserID)
|
|
}
|
|
|
|
func (g *graphConnection) GetUserFavoritePostsWithPagination(ctx context.Context, anthroveUserID models.AnthroveUserID, skip int, limit int) (*models.FavoriteList, error) {
|
|
return internal.GetUserFavoriteNodeWithPagination(ctx, g.driver, anthroveUserID, skip, limit)
|
|
}
|
|
|
|
func (g *graphConnection) GetAnthroveUser(ctx context.Context, anthroveUserID models.AnthroveUserID) (*models.AnthroveUser, error) {
|
|
return internal.GetAnthroveUser(ctx, g.driver, anthroveUserID)
|
|
}
|
|
|
|
func (g *graphConnection) GetUserFavoriteCount(ctx context.Context, anthroveUserID models.AnthroveUserID) (int64, error) {
|
|
return internal.GetUserFavoritesCount(ctx, g.driver, anthroveUserID)
|
|
}
|
|
|
|
func (g *graphConnection) CheckUserPostLink(ctx context.Context, anthroveUserID models.AnthroveUserID, sourcePostID string, sourceUrl string) (bool, error) {
|
|
return internal.CheckUserToPostLink(ctx, g.driver, anthroveUserID, sourcePostID, sourceUrl)
|
|
}
|
|
|
|
func (g *graphConnection) LinkUserWithPost(ctx context.Context, anthroveUser *models.AnthroveUser, anthrovePost *models.AnthrovePost) error {
|
|
return internal.EstablishUserToPostLink(ctx, g.driver, anthroveUser, anthrovePost)
|
|
}
|
|
|
|
func (g *graphConnection) GetAllAnthroveUserIDs(ctx context.Context) ([]models.AnthroveUserID, error) {
|
|
return internal.GetAllAnthroveUserIDs(ctx, g.driver)
|
|
}
|