UserController

io.letsstreamit.services.profile.infrastructure.controllers.UserController
class UserController(userUseCase: UserUseCase)

UserController responsible for handling user related requests

Value parameters

userUseCase

UserUseCase to interact with the database

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def addVideo(email: String, videoId: String): Future[Either[Exception, String]]

addVideo adds a video to the user's list of videos

addVideo adds a video to the user's list of videos

Value parameters

email

email of the user

videoId

id of the video

Attributes

Returns

Future[Either[Exception, String]] Right if successful, Left otherwise

def createUser(user: User): Future[Either[Exception, String]]

createUser adds a user to the database

createUser adds a user to the database

Value parameters

user

user to be added

Attributes

Returns

Future[Either[Exception, String]] Right if successful, Left otherwise

def getUser(email: String): Future[Option[User]]

getUser fetches a user by email

getUser fetches a user by email

Value parameters

email

email of the user

Attributes

Returns

Future[Option[User]] user if found, None otherwise

def updateUser(user: User): Future[Either[Exception, String]]

updateUser updates a user in the database

updateUser updates a user in the database

Value parameters

user

user to be updated

Attributes

Returns

Future[Either[Exception, String]] Right if successful, Left otherwise