Domain Documentation

Structure Profiles​Use​Case

public struct ProfilesUseCase: UseCase  

Use cases for Profiles

Initializers

init()

public init()  

Default initializer.

Methods

profile(by:​reading​User​Id:​)

public func profile(by username: String, readingUserId: Int? ) -> Future<ProfileResponse>  

This use case has work of get profile.

Parameters

username String

Please pass the name of user who is the owner of profile.

reading​User​Id Int?

Please pass the id of the user reading the profile.

Returns

The Future that returns ProfileResponse.

follow(to:​from:​)

public func follow(to username: String, from userId: Int ) -> Future<ProfileResponse>  

This use case has work of follow user.

Parameters

username String

Please pass the name of the user who is Followee.

user​Id Int

Please pass the id of the user who is Follower.

Returns

The Future that returns ProfileResponse.

unfollow(to:​from:​)

public func unfollow(to username: String, from userId: Int ) -> Future<ProfileResponse>  

This use case has work of unfollow user.

Parameters

username String

Please pass the name of the user who be unfollowed.

user​Id Int

Please pass the id of the user who is stop following.

Returns

The Future that returns ProfileResponse.